Skip to content

Commit

Permalink
update(sinsp_cgroup): add with_self_cg to the ctors
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 e8c495c commit ef6aea3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions userspace/libsinsp/sinsp_cgroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ limitations under the License.
#include <libscap/scap.h>
#include <libsinsp/sinsp.h>

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<std::string> sinsp_cgroup::lookup_cgroup_dir(const std::string &subsys, int &version)
Expand Down
4 changes: 2 additions & 2 deletions userspace/libsinsp/sinsp_cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit ef6aea3

Please sign in to comment.