Skip to content

Commit

Permalink
update(sinsp_cgroup): expose self_v2
Browse files Browse the repository at this point in the history
Signed-off-by: Angelo Puglisi <[email protected]>
  • Loading branch information
deepskyblue86 authored and poiana committed May 10, 2024
1 parent 0c83bf1 commit e8c495c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions userspace/libsinsp/sinsp_cgroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,12 @@ bool sinsp_cgroup::in_cgroupns() const
{
return m_scap_cgroup.m_in_cgroupns;
}

std::string sinsp_cgroup::self_v2() const
{
if(!m_scap_cgroup.m_self_v2[0])
{
return {};
}
return m_scap_cgroup.m_self_v2;
}
2 changes: 2 additions & 0 deletions userspace/libsinsp/sinsp_cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class sinsp_cgroup {

bool in_cgroupns() const;

std::string self_v2() const;

protected:
std::string m_root;
struct scap_cgroup_interface m_scap_cgroup;
Expand Down

0 comments on commit e8c495c

Please sign in to comment.