From ef6aea37c8a2acd04c7c99e9bd0d51372131e981 Mon Sep 17 00:00:00 2001 From: Angelo Puglisi Date: Tue, 7 May 2024 17:25:20 +0200 Subject: [PATCH] update(sinsp_cgroup): add with_self_cg to the ctors Signed-off-by: Angelo Puglisi --- userspace/libsinsp/sinsp_cgroup.cpp | 8 ++++---- userspace/libsinsp/sinsp_cgroup.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/userspace/libsinsp/sinsp_cgroup.cpp b/userspace/libsinsp/sinsp_cgroup.cpp index c63c2984a6..cc7064bc04 100644 --- a/userspace/libsinsp/sinsp_cgroup.cpp +++ b/userspace/libsinsp/sinsp_cgroup.cpp @@ -21,17 +21,17 @@ limitations under the License. #include #include -sinsp_cgroup::sinsp_cgroup() : - sinsp_cgroup(scap_get_host_root()) +sinsp_cgroup::sinsp_cgroup(bool with_self_cg) : + sinsp_cgroup(scap_get_host_root(), with_self_cg) { } -sinsp_cgroup::sinsp_cgroup(std::string &&root) : +sinsp_cgroup::sinsp_cgroup(std::string &&root, bool with_self_cg) : m_root(std::move(root)), m_scap_cgroup({}) { char error[SCAP_LASTERR_SIZE]; - scap_cgroup_interface_init(&m_scap_cgroup, m_root.c_str(), error, false); + scap_cgroup_interface_init(&m_scap_cgroup, m_root.c_str(), error, with_self_cg); } std::shared_ptr sinsp_cgroup::lookup_cgroup_dir(const std::string &subsys, int &version) diff --git a/userspace/libsinsp/sinsp_cgroup.h b/userspace/libsinsp/sinsp_cgroup.h index 404f0cc54c..c68edec89b 100644 --- a/userspace/libsinsp/sinsp_cgroup.h +++ b/userspace/libsinsp/sinsp_cgroup.h @@ -28,9 +28,9 @@ class sinsp_threadinfo; class sinsp_cgroup { public: - sinsp_cgroup(); + sinsp_cgroup(bool with_self_cg = false); - explicit sinsp_cgroup(std::string &&root); + explicit sinsp_cgroup(std::string &&root, bool with_self_cg = false); virtual ~sinsp_cgroup();