diff --git a/userspace/libsinsp/sinsp_cgroup.cpp b/userspace/libsinsp/sinsp_cgroup.cpp index 2525288080..c63c2984a6 100644 --- a/userspace/libsinsp/sinsp_cgroup.cpp +++ b/userspace/libsinsp/sinsp_cgroup.cpp @@ -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; +} diff --git a/userspace/libsinsp/sinsp_cgroup.h b/userspace/libsinsp/sinsp_cgroup.h index b40fbac8f8..404f0cc54c 100644 --- a/userspace/libsinsp/sinsp_cgroup.h +++ b/userspace/libsinsp/sinsp_cgroup.h @@ -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;