]> git.ipfire.org Git - thirdparty/libcgroup.git/log
thirdparty/libcgroup.git
19 months agoftests/069: skip test on non-systemd configuration
Kamalesh Babulal [Wed, 29 Nov 2023 09:34:24 +0000 (09:34 +0000)] 
ftests/069: skip test on non-systemd configuration

Skip running the testcase, when compiled with --enable-systemd=no,
using Systemd.is_systemd_enabled().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agoftests/068: skip test on non-systemd configuration
Kamalesh Babulal [Wed, 29 Nov 2023 09:33:21 +0000 (09:33 +0000)] 
ftests/068: skip test on non-systemd configuration

Skip running the testcase, when compiled with --enable-systemd=no,
using Systemd.is_systemd_enabled().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agoftests/067: skip test on non-systemd configuration
Kamalesh Babulal [Wed, 29 Nov 2023 09:32:28 +0000 (09:32 +0000)] 
ftests/067: skip test on non-systemd configuration

Skip running the testcase, when compiled with --enable-systemd=no,
using Systemd.is_systemd_enabled().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agoftests/066: skip test on non-systemd configuration
Kamalesh Babulal [Wed, 29 Nov 2023 09:31:33 +0000 (09:31 +0000)] 
ftests/066: skip test on non-systemd configuration

Skip running the testcase, when compiled with --enable-systemd=no,
using Systemd.is_systemd_enabled().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agoftests/065: skip test on non-systemd configuration
Kamalesh Babulal [Wed, 29 Nov 2023 09:30:36 +0000 (09:30 +0000)] 
ftests/065: skip test on non-systemd configuration

Skip running the testcase, when compiled with --enable-systemd=no,
using Systemd.is_systemd_enabled().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agoftests/064: skip test on non-systemd configuration
Kamalesh Babulal [Wed, 29 Nov 2023 09:28:14 +0000 (09:28 +0000)] 
ftests/064: skip test on non-systemd configuration

Skip running the testcase, when compiled with --enable-systemd=no,
using Systemd.is_systemd_enabled().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agoftests/063: skip test on non-systemd configuration
Kamalesh Babulal [Wed, 29 Nov 2023 09:27:18 +0000 (09:27 +0000)] 
ftests/063: skip test on non-systemd configuration

Skip running the testcase, when compiled with --enable-systemd=no,
using Systemd.is_systemd_enabled().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agoftests/062: skip test on non-systemd configuration
Kamalesh Babulal [Wed, 29 Nov 2023 09:25:55 +0000 (09:25 +0000)] 
ftests/062: skip test on non-systemd configuration

Skip running the testcase, when compiled with --enable-systemd=no,
using Systemd.is_systemd_enabled().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agoftests/061: skip test on non-systemd configuration
Kamalesh Babulal [Wed, 29 Nov 2023 09:23:05 +0000 (09:23 +0000)] 
ftests/061: skip test on non-systemd configuration

Skip running the testcase, when compiled with --enable-systemd=no,
using Systemd.is_systemd_enabled().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agoftests/060: skip test on non-systemd configuration
Kamalesh Babulal [Wed, 29 Nov 2023 09:22:11 +0000 (09:22 +0000)] 
ftests/060: skip test on non-systemd configuration

Skip running the testcase, when compiled with --enable-systemd=no,
using Systemd.is_systemd_enabled().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agoftests/059: skip test on non-systemd configuration
Kamalesh Babulal [Wed, 29 Nov 2023 09:20:34 +0000 (09:20 +0000)] 
ftests/059: skip test on non-systemd configuration

Skip running the testcase, when compiled with --enable-systemd=no,
using Systemd.is_systemd_enabled().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agoftests/058: skip test on non-systemd configuration
Kamalesh Babulal [Wed, 29 Nov 2023 09:19:10 +0000 (09:19 +0000)] 
ftests/058: skip test on non-systemd configuration

Skip running the testcase, when compiled with --enable-systemd=no,
using Systemd.is_systemd_enabled().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agoftests/050: skip test on non-systemd configuration
Kamalesh Babulal [Wed, 29 Nov 2023 09:18:01 +0000 (09:18 +0000)] 
ftests/050: skip test on non-systemd configuration

Skip running the testcase, when compiled with --enable-systemd=no,
using Systemd.is_systemd_enabled().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agoftests/049: skip test on non-systemd configuration
Kamalesh Babulal [Wed, 29 Nov 2023 09:08:14 +0000 (09:08 +0000)] 
ftests/049: skip test on non-systemd configuration

Skip running the testcase, when compiled with --enable-systemd=no,
using Systemd.is_systemd_enabled().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agoftests/systemd: add method to check if systemd support
Tom Hromatka [Wed, 6 Dec 2023 15:37:44 +0000 (15:37 +0000)] 
ftests/systemd: add method to check if systemd support

Add a method to check if libcgroup is compiled with --enable-systemd
support. The newly introduced is_systemd_enabled(), calls systemd C
function is_systemd_enabled(), that return true if configured with
--enable-systemd, false otherwise.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agopython: Introduce is_systemd_enabled()
Tom Hromatka [Thu, 7 Dec 2023 04:20:13 +0000 (04:20 +0000)] 
python: Introduce is_systemd_enabled()

Add python interface for systemd C function cgroup_is_systemd_enabled(),
that return true if the --enable-systemd was set or false.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agopython: compile systemd support by default
Tom Hromatka [Thu, 7 Dec 2023 04:19:07 +0000 (04:19 +0000)] 
python: compile systemd support by default

Compile systemd support file by default, there are two versions of
systemd functions available now, those get called based on the
--enable-systemd configuration, hence remove the #ifdef WITH_SYSTEMD
guards from bindings.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agoinclude/Makefile: install systemd.h by default
Kamalesh Babulal [Mon, 27 Nov 2023 14:37:33 +0000 (20:07 +0530)] 
include/Makefile: install systemd.h by default

Install systemd.h header file by default, as we have stub and defined
versions of the systemd functions for both non-systemd and systemd
enabled configurations.  This will help packagers to ship package
without systemd support (--enable-systemd=no).

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agosrc/Makefile: compile systemd support by default
Kamalesh Babulal [Sat, 25 Nov 2023 14:32:34 +0000 (20:02 +0530)] 
src/Makefile: compile systemd support by default

Compile systemd support file by default, now we have stub and defined
versions of the systemd functions for both non-systemd and systemd
enabled configurations.  Pass linker flag WITH_SYSTEMD only when
--enable-systemd is set, that will call the defined function, otherwise
call the stub functions.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agosystemd: add cgroup_is_systemd_enabled() helper
Tom Hromatka [Wed, 6 Dec 2023 15:07:15 +0000 (15:07 +0000)] 
systemd: add cgroup_is_systemd_enabled() helper

Add a helper function cgroup_is_systemd_enabled(), that would return
true, when compiled with --enabled-systemd option or false when
disabled.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agosystemd: add function stubs for non-systemd
Kamalesh Babulal [Mon, 27 Nov 2023 14:30:14 +0000 (20:00 +0530)] 
systemd: add function stubs for non-systemd

Add systemd function stubs for --enable-systemd=no configuration.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agotools/lscgroup: guard systemd default delegate slice
Kamalesh Babulal [Fri, 24 Nov 2023 08:49:51 +0000 (14:19 +0530)] 
tools/lscgroup: guard systemd default delegate slice

Guard setting default systemd delegate slice with WITH_SYSTEMD, to limit
the systemd delegation only to --enable-systemd=yes only.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agotools/cgxset: guard systemd default delegate slice
Kamalesh Babulal [Thu, 23 Nov 2023 08:48:50 +0000 (14:18 +0530)] 
tools/cgxset: guard systemd default delegate slice

Guard setting default systemd delegate slice with WITH_SYSTEMD, to limit
the systemd delegation only to --enable-systemd=yes only.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agotools/cgxget: guard systemd default delegate slice
Kamalesh Babulal [Wed, 22 Nov 2023 08:47:45 +0000 (14:17 +0530)] 
tools/cgxget: guard systemd default delegate slice

Guard setting default systemd delegate slice with WITH_SYSTEMD, to limit
the systemd delegation only to --enable-systemd=yes only.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agotools/cgset: guard systemd default delegate slice
Kamalesh Babulal [Tue, 21 Nov 2023 08:46:47 +0000 (14:16 +0530)] 
tools/cgset: guard systemd default delegate slice

Guard setting default systemd delegate slice with WITH_SYSTEMD, to limit
the systemd delegation only to --enable-systemd=yes only.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agotools/cgget: guard systemd default delegate slice
Kamalesh Babulal [Mon, 20 Nov 2023 08:45:54 +0000 (14:15 +0530)] 
tools/cgget: guard systemd default delegate slice

Guard setting default systemd delegate slice with WITH_SYSTEMD, to limit
the systemd delegation only to --enable-systemd=yes only.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agotools/cgexec: guard systemd default delegate slice
Kamalesh Babulal [Sun, 19 Nov 2023 08:44:57 +0000 (14:14 +0530)] 
tools/cgexec: guard systemd default delegate slice

Guard setting default systemd delegate slice with WITH_SYSTEMD, to limit
the systemd delegation only to --enable-systemd=yes only.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agotools/cgdelete: guard systemd default delegate slice
Kamalesh Babulal [Sat, 18 Nov 2023 08:43:46 +0000 (14:13 +0530)] 
tools/cgdelete: guard systemd default delegate slice

Guard setting default systemd delegate slice with WITH_SYSTEMD, to limit
the systemd delegation only to --enable-systemd=yes only.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agotools/cgcreate: guard systemd default delegate slice
Kamalesh Babulal [Fri, 17 Nov 2023 08:42:26 +0000 (14:12 +0530)] 
tools/cgcreate: guard systemd default delegate slice

Guard setting default systemd delegate slice with WITH_SYSTEMD, to limit
the systemd delegation only to --enable-systemd=yes only.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
19 months agotools/cgclassify: guard systemd default delegate slice
Kamalesh Babulal [Thu, 16 Nov 2023 08:38:03 +0000 (14:08 +0530)] 
tools/cgclassify: guard systemd default delegate slice

Guard setting default systemd delegate slice with WITH_SYSTEMD, to limit
the systemd delegation only to --enable-systemd=yes only.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agoman: cgset: document -R option
Kamalesh Babulal [Sat, 14 Oct 2023 11:24:12 +0000 (16:54 +0530)] 
man: cgset: document -R option

Document -R option. It recursively sets variable settings passed with -r
option to cgroup_path and its descendant cgroups.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agoftests: add test to exercise cgset recursive set option
Kamalesh Babulal [Fri, 13 Oct 2023 12:02:24 +0000 (17:32 +0530)] 
ftests: add test to exercise cgset recursive set option

Add a test to recursive set settings of the controller(s) in a cgroup
and its descendants using cgset '-R' flag.
-----------------------------------------------------------------
Test Results:
        Run Date:                          Oct 28 15:25:57
        Passed:                                  1 test(s)
        Skipped:                                 0 test(s)
        Failed:                                  0 test(s)
-----------------------------------------------------------------
Timing Results:
        Test                            Time (sec)
        ------------------------------------------
        setup                                 0.00
        089-cgset-recursive_flag.py           0.13
        teardown                              0.00
        ------------------------------------------
        Total Run Time                        0.13

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agoftests/cgroup: Add recursive support for set()
Kamalesh Babulal [Thu, 12 Oct 2023 09:10:20 +0000 (14:40 +0530)] 
ftests/cgroup: Add recursive support for set()

Add support to recursively set controller settings of a cgroup and its
descendants.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agotools/cgset: add support for cgroup.subtree_control
Kamalesh Babulal [Wed, 11 Oct 2023 11:29:38 +0000 (16:59 +0530)] 
tools/cgset: add support for cgroup.subtree_control

The cgroup.subtree_control settings are special, in comparison to other
controller settings. It can both enable and disable the controllers in
the single argument, depending on the argument the cgroup hierarchy walk
is either pre-order or post-order.

example:
--------
$ sudo cgget -n -v -r cgroup.subtree_control a
cpu memory pids
$ sudo cgget -n -v -r cgroup.subtree_control a/b
cpu memory pids
$ sudo cgget -n -v -r cgroup.subtree_control a/b/c

$
$ sudo cgset -R -r cgroup.subtree_control="-pids +cpuset" a
$ sudo cgget -n -v -r cgroup.subtree_control a
cpuset cpu memory
$ sudo cgget -n -v -r cgroup.subtree_control a/b
cpuset cpu memory
$ sudo cgget -n -v -r cgroup.subtree_control a/b/c

$

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agotools/cgset: add -R option to recursively set variables
Kamalesh Babulal [Mon, 9 Oct 2023 11:00:10 +0000 (16:30 +0530)] 
tools/cgset: add -R option to recursively set variables

Add -R option to recursively set variable(s) passed to cgroups under
<cgroup_path>. This will help users to set a controller setting for
all the cgroups under a cgroup hierarchy, instead of passing the
cgroups multiple times on the command line.

example:
--------
./cgcreate -gcpu,memory:foo -gcpu:memory:foo/ch1 -gcpu,memory:foo/ch2
./cgget -r cpu.shares foo foo/ch1 foo/ch2
foo:
cpu.shares: 1024

foo/ch1:
cpu.shares: 1024

foo/ch2:
cpu.shares: 1024

Without the patch
------------------
./cgset -r cpu.shares=256 foo
./cgget -r cpu.shares foo
foo/ch1 foo/ch2
foo:
cpu.shares: 256

foo/ch1:
cpu.shares: 1024

foo/ch2:
cpu.shares: 1024

With the patch
--------------
./cgset -R -r cpu.shares=512 foo
./cgget  -r cpu.shares foo foo/ch1 foo/ch2
foo:
cpu.shares: 512

foo/ch1:
cpu.shares: 512

foo/ch2:
cpu.shares: 512

[check for ECGEOF recommend by Tom Hromatka]
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agotools/cgset: add cgroup_set_cgroup_values() helper
Kamalesh Babulal [Sun, 8 Oct 2023 09:40:42 +0000 (15:10 +0530)] 
tools/cgset: add cgroup_set_cgroup_values() helper

Move the cgroup controller value setting logic to a helper function,
cgroup_set_cgroup_values() and also introduce program_name variable, to
be used instead of argv[0], when printing the info()/err() messages.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agoftests: add test to cgcreate of non default controllers
Kamalesh Babulal [Tue, 17 Oct 2023 10:26:37 +0000 (15:56 +0530)] 
ftests: add test to cgcreate of non default controllers

Add test to create cgroups with non default controllers (hugetlb, misc)
using the cgcreate.

-----------------------------------------------------------------
Test Results:
        Run Date:                          Oct 20 05:21:48
        Passed:                                  1 test(s)
        Skipped:                                 0 test(s)
        Failed:                                  0 test(s)
-----------------------------------------------------------------
Timing Results:
        Test                                           Time (sec)
        ---------------------------------------------------------
        setup                                                0.00
        091-cgcreate-non-default-controllers-v2.py           0.04
        teardown                                             0.00
        ---------------------------------------------------------
        Total Run Time                                       0.04

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agogunit/012: populate root_cgroup.controllers file
Kamalesh Babulal [Mon, 16 Oct 2023 08:43:56 +0000 (14:13 +0530)] 
gunit/012: populate root_cgroup.controllers file

To enable a controller in a cgroup, its parent's subtree_control file is
read to check if the controller is enabled, if not enabled, parent's
cgroup.controllers is checked for the supported controllers, before
enabling it in the cgroup.subtree_control.

Populate controllers in the root_cgroup.controllers file, to help with
the check for supported controllers, without this
cgroupv2_subtree_control_recursive() will fail, when it is checked for
controller existence.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agoapi.c: enable controller in the root_cgroup.subtree_file
Kamalesh Babulal [Sun, 15 Oct 2023 08:43:56 +0000 (14:13 +0530)] 
api.c: enable controller in the root_cgroup.subtree_file

systemd by default only enables cpu, cpuset, io, memory, and pids
controller the root_cgroup.subtree_control. Trying to enable other
controllers (hugetlb and misc) in a nested cgroups create scenario,
will fail because they are not, enabled the controller in the
root_cgroup.subtree_control file.

$ sudo cgcreate -ghugetlb:foo/bar
Error: Failed to delete foo/bar: No such file or directory
cgcreate: can't create cgroup foo/bar: No such file or directory

Fix this by enabling the controller in the root_cgroup.subtree_control
file unconditionally for all controllers, if not already enabled, while
calling cgroupv2_subtree_control_recursive() to enable the controller
in the given cgroup and its descendants. Checking and enabling every
controller unconditionally should work in the future, in case systemd
disables some other controllers too.

Fixes: https://github.com/libcgroup/libcgroup/issues/405
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agogunit/017: fix build warnings
Kamalesh Babulal [Sat, 30 Sep 2023 09:09:17 +0000 (14:39 +0530)] 
gunit/017: fix build warnings

Fix unused variable and sign comparison warnings across the test case:

017-API_fuzz_test.cpp: In member function â€˜virtual void APIArgsTest_API_cgroup_add_controller_Test::TestBody()’:
017-API_fuzz_test.cpp:190:6: warning: unused variable â€˜ret’ [-Wunused-variable]
  int ret;
      ^~~
In file included from 017-API_fuzz_test.cpp:11:
../../googletest/googletest/include/gtest/gtest.h: In instantiation of â€˜testing::AssertionResult testing::internal::CmpHelperEQ(const char*, const char*, const T1&, const T2&) [with T1 = long unsigned int; T2 = int]’:
../../googletest/googletest/include/gtest/gtest.h:1421:23:   required from â€˜static testing::AssertionResult testing::internal::EqHelper<lhs_is_null_literal>::Compare(const char*, const char*, const T1&, const T2&) [with T1 = long unsigned int; T2 = int; bool lhs_is_null_literal = false]’
017-API_fuzz_test.cpp:480:2:   required from here
../../googletest/googletest/include/gtest/gtest.h:1392:11: warning: comparison of integer expressions of different signedness: â€˜const long unsigned int’ and â€˜const int’ [-Wsign-compare]
   if (lhs == rhs) {
       ~~~~^~~~~~

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agogunit/015: fix unused variable warning
Kamalesh Babulal [Fri, 29 Sep 2023 09:06:56 +0000 (14:36 +0530)] 
gunit/015: fix unused variable warning

Fix unused variable warning:

015-cgroupv2_controller_enabled.cpp: In member function â€˜void CgroupV2ControllerEnabled::InitMountTable()’:
015-cgroupv2_controller_enabled.cpp:69:7: warning: unused variable â€˜ret’ [-Wunused-variable]
   int ret, i;
       ^~~

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agogunit/014: fix unused variable warnings
Kamalesh Babulal [Thu, 28 Sep 2023 09:04:52 +0000 (14:34 +0530)] 
gunit/014: fix unused variable warnings

Fix unused variable warnings, across the test case:

014-cgroupv2_get_subtree_control.cpp: In member function â€˜virtual void GetSubtreeControlTest::SetUp()’:
014-cgroupv2_get_subtree_control.cpp:27:8: warning: unused variable â€˜tmp_path’ [-Wunused-variable]
   char tmp_path[FILENAME_MAX];
        ^~~~~~~~
014-cgroupv2_get_subtree_control.cpp:28:12: warning: unused variable â€˜i’ [-Wunused-variable]
   int ret, i;
            ^
014-cgroupv2_get_subtree_control.cpp:29:9: warning: unused variable â€˜f’ [-Wunused-variable]
   FILE *f;

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agogunit/013: fix build warnings
Kamalesh Babulal [Tue, 19 Sep 2023 04:59:53 +0000 (10:29 +0530)] 
gunit/013: fix build warnings

Fix unused variable warnings and signed comparison warning across the
test case:

013-cgroup_build_tasks_procs_path.cpp: In member function â€˜virtual void BuildTasksProcPathTest_BuildTasksProcPathTest_CgV2_Test::TestBody()’:
013-cgroup_build_tasks_procs_path.cpp:112:27: warning: unused variable â€˜ctrlr’ [-Wunused-variable]
  struct cgroup_controller ctrlr = {0};
                           ^~~~~
013-cgroup_build_tasks_procs_path.cpp: In member function â€˜virtual void BuildTasksProcPathTest_BuildTasksProcPathTest_CgV1WithNs_Test::TestBody()’:
013-cgroup_build_tasks_procs_path.cpp:126:27: warning: unused variable â€˜ctrlr’ [-Wunused-variable]
  struct cgroup_controller ctrlr = {0};
                           ^~~~~
013-cgroup_build_tasks_procs_path.cpp: In member function â€˜virtual void BuildTasksProcPathTest_BuildTasksProcPathTest_CgV2WithNs_Test::TestBody()’:
013-cgroup_build_tasks_procs_path.cpp:140:27: warning: unused variable â€˜ctrlr’ [-Wunused-variable]
  struct cgroup_controller ctrlr = {0};
                           ^~~~~
In file included from 013-cgroup_build_tasks_procs_path.cpp:9:
../../googletest/googletest/include/gtest/gtest.h: In instantiation of â€˜testing::AssertionResult testing::internal::CmpHelperLT(const char*, const char*, const T1&, const T2&) [with T1 = int; T2 = long unsigned int]’:
013-cgroup_build_tasks_procs_path.cpp:53:4:   required from here
../../googletest/googletest/include/gtest/gtest.h:1526:28: warning: comparison of integer expressions of different signedness: â€˜const int’ and â€˜const long unsigned int’ [-Wsign-compare]
../../googletest/googletest/include/gtest/gtest.h:1510:7:
   if (val1 op val2) {\
       ~~~~~~~~~~~~
../../googletest/googletest/include/gtest/gtest.h:1526:28:
 GTEST_IMPL_CMP_HELPER_(LT, <);
../../googletest/googletest/include/gtest/gtest.h:1510:12: note: in definition of macro â€˜GTEST_IMPL_CMP_HELPER_’
   if (val1 op val2) {\
            ^~

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agogunit/011: fix unused variable warning
Kamalesh Babulal [Mon, 18 Sep 2023 04:57:40 +0000 (10:27 +0530)] 
gunit/011: fix unused variable warning

Fix unused variable warning:

011-cgroupv2_subtree_control.cpp: In member function â€˜virtual void SubtreeControlTest::SetUp()’:
011-cgroupv2_subtree_control.cpp:24:12: warning: unused variable â€˜i’ [-Wunused-variable]
   int ret, i;

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agogunit/009: fix string truncation warnings
Kamalesh Babulal [Sun, 17 Sep 2023 04:52:56 +0000 (10:22 +0530)] 
gunit/009: fix string truncation warnings

Fix string truncation warnings across the test case:

009-cgroup_set_values_recursive.cpp: In member function â€˜virtual void SetValuesRecursiveTest_SuccessfulSetValues_Test::TestBody()’:
009-cgroup_set_values_recursive.cpp:96:10: warning: â€˜char* strncpy(char*, const char*, size_t)’ specified bound 4096 equals destination size [-Wstringop-truncation]
   strncpy(ctrlr.values[i]->name, NAMES[i], FILENAME_MAX);
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
009-cgroup_set_values_recursive.cpp:97:10: warning: â€˜char* strncpy(char*, const char*, size_t)’ specified bound 4096 equals destination size [-Wstringop-truncation]
   strncpy(ctrlr.values[i]->value, VALUES[i],
   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    CG_CONTROL_VALUE_MAX);
    ~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agogunit/008: fix unused variable warnings
Kamalesh Babulal [Thu, 14 Sep 2023 02:52:56 +0000 (08:22 +0530)] 
gunit/008: fix unused variable warnings

Fix unused variable warnings across the test case:

008-cgroup_process_v2_mount.cpp: In member function â€˜virtual void CgroupProcessV2MntTest::SetUp()’:
008-cgroup_process_v2_mount.cpp:59:8: warning: unused variable â€˜tmp_path’ [-Wunused-variable]
   char tmp_path[FILENAME_MAX];
        ^~~~~~~~
008-cgroup_process_v2_mount.cpp:60:7: warning: unused variable â€˜i’ [-Wunused-variable]
   int i, ret;
       ^
008-cgroup_process_v2_mount.cpp:60:10: warning: unused variable â€˜ret’ [-Wunused-variable]
   int i, ret;
          ^~~
008-cgroup_process_v2_mount.cpp:61:9: warning: unused variable â€˜f’ [-Wunused-variable]
   FILE *f;

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agogunit/006: fix unused variables warnings
Kamalesh Babulal [Wed, 13 Sep 2023 02:50:39 +0000 (08:20 +0530)] 
gunit/006: fix unused variables warnings

Fix unused variable warnings across the test case:

006-cgroup_get_cgroup.cpp: In member function â€˜virtual void CgroupGetCgroupTest::SetUp()’:
006-cgroup_get_cgroup.cpp:98:10: warning: unused variable â€˜j’ [-Wunused-variable]
   int i, j, names_len, ret;
          ^
006-cgroup_get_cgroup.cpp:98:13: warning: unused variable â€˜names_len’ [-Wunused-variable]
   int i, j, names_len, ret;
             ^~~~~~~~~
006-cgroup_get_cgroup.cpp: In function â€˜void vectorize_cg(const cgroup*, std::vector<std::__cxx11::basic_string<char> >&)’:
006-cgroup_get_cgroup.cpp:169:14: warning: unused variable â€˜cgname’ [-Wunused-variable]
  const char *cgname, *cgcname, *value;
              ^~~~~~
006-cgroup_get_cgroup.cpp:169:23: warning: unused variable â€˜cgcname’ [-Wunused-variable]
  const char *cgname, *cgcname, *value;
                       ^~~~~~~
006-cgroup_get_cgroup.cpp:169:33: warning: unused variable â€˜value’ [-Wunused-variable]
  const char *cgname, *cgcname, *value;
                                 ^~~~~

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agogunit/001: fix sign compare build warning
Kamalesh Babulal [Tue, 12 Sep 2023 02:45:00 +0000 (08:15 +0530)] 
gunit/001: fix sign compare build warning

Fix the following sign compare build warning:

In file included from 001-path.cpp:9:
../../googletest/googletest/include/gtest/gtest.h: In instantiation of â€˜testing::AssertionResult testing::internal::CmpHelperLT(const char*, const char*, const T1&, const T2&) [with T1 = int; T2 = long unsigned int]’:
001-path.cpp:53:4:   required from here
../../googletest/googletest/include/gtest/gtest.h:1526:28: warning: comparison of integer expressions of different signedness: â€˜const int’ and â€˜const long unsigned int’ [-Wsign-compare]
../../googletest/googletest/include/gtest/gtest.h:1510:7:
   if (val1 op val2) {\
       ~~~~~~~~~~~~
../../googletest/googletest/include/gtest/gtest.h:1526:28: GTEST_IMPL_CMP_HELPER_(LT, <);
../../googletest/googletest/include/gtest/gtest.h:1510:12: note: in
definition of macro â€˜GTEST_IMPL_CMP_HELPER_’
   if (val1 op val2) {\
            ^~

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agoRFE: Bump actions/checkout from 3 to 4
dependabot[bot] [Mon, 4 Sep 2023 22:35:16 +0000 (22:35 +0000)] 
RFE: Bump actions/checkout from 3 to 4

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agotools/cgexec: fix error msg in find_scope_pid()
Kamalesh Babulal [Wed, 6 Sep 2023 10:55:20 +0000 (16:25 +0530)] 
tools/cgexec: fix error msg in find_scope_pid()

Un-split the error message by removing the newline character in the
err() in the find_scope_pid().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agotools/cgclassify: fix error msg in find_scope_pid()
Kamalesh Babulal [Wed, 6 Sep 2023 10:55:20 +0000 (16:25 +0530)] 
tools/cgclassify: fix error msg in find_scope_pid()

Un-split the error message by removing the newline character in the
err() in the find_scope_pid().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
21 months agoRFE: Bump redhat-plumbers-in-action/differential-shellcheck from 4 to 5
dependabot[bot] [Mon, 9 Oct 2023 22:17:42 +0000 (22:17 +0000)] 
RFE: Bump redhat-plumbers-in-action/differential-shellcheck from 4 to 5

Bumps [redhat-plumbers-in-action/differential-shellcheck](https://github.com/redhat-plumbers-in-action/differential-shellcheck) from 4 to 5.
- [Release notes](https://github.com/redhat-plumbers-in-action/differential-shellcheck/releases)
- [Changelog](https://github.com/redhat-plumbers-in-action/differential-shellcheck/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/redhat-plumbers-in-action/differential-shellcheck/compare/v4...v5)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/differential-shellcheck
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agoftests: Add a test to stress create systemd scope via cgcreate
Kamalesh Babulal [Wed, 23 Aug 2023 11:05:12 +0000 (11:05 +0000)] 
ftests: Add a test to stress create systemd scope via cgcreate

Add a test to stress creation of systemd scope via the cgcreate command
line tool, by passing invalid slice and scope names.

-----------------------------------------------------------------
Test Results:
        Run Date:                          Aug 23 11:03:00
        Passed:                                  1 test(s)
        Skipped:                                 0 test(s)
        Failed:                                  0 test(s)
-----------------------------------------------------------------
Timing Results:
        Test                                   Time (sec)
        -------------------------------------------------
        setup                                        0.00
        997-sudo-cgcreate_systemd_scope.py           0.13
        teardown                                     0.00
        -------------------------------------------------
        Total Run Time                               0.13

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agoadd FILE_PATH_CHANGES to ignore list of patch review
Kamalesh Babulal [Wed, 30 Aug 2023 06:00:31 +0000 (11:30 +0530)] 
add FILE_PATH_CHANGES to ignore list of patch review

Add FILE_PATH_CHANGES to the list of warnings, that is very specific to
Linux Kernel, which is triggered when a file is added, moved, or deleted
to the source tree. Let's ignore it and this patch also removes an extra
new line in the .checkpatch.conf.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agoftests: update test to check for ctrl name in scope name
Kamalesh Babulal [Sun, 20 Aug 2023 05:42:47 +0000 (11:12 +0530)] 
ftests: update test to check for ctrl name in scope name

Update the test case to check for controller names in the scope name.

-----------------------------------------------------------------
Test Results:
        Run Date:                          Aug 18 07:57:32
        Passed:                                  1 test(s)
        Skipped:                                 0 test(s)
        Failed:                                  0 test(s)
-----------------------------------------------------------------
Timing Results:
        Test                                   Time (sec)
        -------------------------------------------------
        setup                                        0.00
        078-sudo-cgcreate_systemd_scope.py           5.28
        teardown                                     0.00
        -------------------------------------------------
        Total Run Time                               5.28

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agosrc/systemd: check for ctrl name in scope name
Kamalesh Babulal [Tue, 22 Aug 2023 06:34:13 +0000 (12:04 +0530)] 
src/systemd: check for ctrl name in scope name

systemd will silently prefix a '_' to the scope name and create, and
delegate it under the slice. If it matches with any of the original
cgroup and pseudo BPF-base systemd controllers. i.e.,

 # cgcreate -c -g cpuset,cpu:oracle.slice/cpuset.scope
 # tree /sys/fs/cgroup/oracle.slice/ -d
 /sys/fs/cgroup/oracle.slice/
 â”œâ”€â”€ _cpuset.scope
 â””── cpuset.scope

 2 directories

 # systemd-cgls /oracle.slice
 Control group /oracle.slice:
 â””─cpuset.scope â€¦
   â””─969 libcgroup_systemd_idle_thread

 # cat /proc/969/cgroup
 0::/oracle.slice/_cpuset.scope

this implicit rename will cause confusion to the users, who would not
see any errors during creation but operate on non-delegated cgroup scope
created by libcgroup internally. Disallow such systemd scope names.

Reported-by: Tom Hromatka <tom.hromatka@oracle.com>
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agoinclude/iterators.h: fix spellings across the file
Kamalesh Babulal [Mon, 14 Aug 2023 07:55:35 +0000 (13:25 +0530)] 
include/iterators.h: fix spellings across the file

Fix the spelling mistakes across the file and also fix word case.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agoinclude/groups.h: fix spellings across the file
Kamalesh Babulal [Mon, 14 Aug 2023 07:55:35 +0000 (13:25 +0530)] 
include/groups.h: fix spellings across the file

Fix the spelling mistakes across the file and also fix word case.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agoinclude/config.h: fix spellings across the file
Kamalesh Babulal [Mon, 14 Aug 2023 07:55:35 +0000 (13:25 +0530)] 
include/config.h: fix spellings across the file

Fix the spelling mistakes across the file and also fix word case.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agosamples/c/test_functions: fix spellings across the file
Kamalesh Babulal [Mon, 14 Aug 2023 07:55:35 +0000 (13:25 +0530)] 
samples/c/test_functions: fix spellings across the file

Fix the spelling mistakes across the file and also fix word case.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agotools/tools-common.h:fix spellings across the file
Kamalesh Babulal [Mon, 14 Aug 2023 07:55:35 +0000 (13:25 +0530)] 
tools/tools-common.h:fix spellings across the file

Fix the spelling mistakes across the file and also fix word case.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agotools/tools-common.c: fix spellings across the file
Kamalesh Babulal [Mon, 14 Aug 2023 07:55:35 +0000 (13:25 +0530)] 
tools/tools-common.c: fix spellings across the file

Fix the spelling mistakes across the file and also fix word case.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agotools/lssubsys: fix spellings across the file
Kamalesh Babulal [Mon, 14 Aug 2023 07:55:35 +0000 (13:25 +0530)] 
tools/lssubsys: fix spellings across the file

Fix the spelling mistakes across the file and also fix word case.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agotools/lscgroup: fix spellings across the file
Kamalesh Babulal [Mon, 14 Aug 2023 07:55:35 +0000 (13:25 +0530)] 
tools/lscgroup: fix spellings across the file

Fix the spelling mistakes across the file and also fix word case.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agotools/cgxset: fix spellings across the file
Kamalesh Babulal [Mon, 14 Aug 2023 07:55:35 +0000 (13:25 +0530)] 
tools/cgxset: fix spellings across the file

Fix the spelling mistakes across the file and also fix word case.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agotools/cgcreate: fix spellings across the file
Kamalesh Babulal [Mon, 14 Aug 2023 07:55:35 +0000 (13:25 +0530)] 
tools/cgcreate: fix spellings across the file

Fix the spelling mistakes across the file and also fix word case.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agopam/pam_cgroup.c: fix spellings across the file
Kamalesh Babulal [Mon, 14 Aug 2023 07:55:35 +0000 (13:25 +0530)] 
pam/pam_cgroup.c: fix spellings across the file

Fix the spelling mistakes across the file and also fix word case.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agodaemon/cgrulesengd: fix spellings across the file
Kamalesh Babulal [Mon, 14 Aug 2023 07:55:35 +0000 (13:25 +0530)] 
daemon/cgrulesengd: fix spellings across the file

Fix the spelling mistakes across the file and also fix word case.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agodaemon/cgrulesengd: fix spellings across the file
Kamalesh Babulal [Mon, 14 Aug 2023 07:55:35 +0000 (13:25 +0530)] 
daemon/cgrulesengd: fix spellings across the file

Fix the spelling mistakes across the file and also fix word case.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agosrc/libcgroup-internal.h: fix spellings across the file
Kamalesh Babulal [Mon, 14 Aug 2023 07:55:35 +0000 (13:25 +0530)] 
src/libcgroup-internal.h: fix spellings across the file

Fix the spelling mistakes across the file and also fix word case.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agosrc/config.c: fix spellings across the file
Kamalesh Babulal [Mon, 14 Aug 2023 07:55:35 +0000 (13:25 +0530)] 
src/config.c: fix spellings across the file

Fix the spelling mistakes across the file and also fix word case.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agosrc/abstraction-common.h: fix spellings across the file
Kamalesh Babulal [Mon, 14 Aug 2023 07:55:35 +0000 (13:25 +0530)] 
src/abstraction-common.h: fix spellings across the file

Fix the spelling mistakes across the file and also fix word case.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agosrc/api.c: fix spellings across the file
Kamalesh Babulal [Mon, 14 Aug 2023 07:53:49 +0000 (13:23 +0530)] 
src/api.c: fix spellings across the file

Fix the spelling mistakes across the file and also fix word case.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agotests/gunit/001-path.cpp: fix coding style complaint
Kamalesh Babulal [Fri, 11 Aug 2023 06:55:04 +0000 (12:25 +0530)] 
tests/gunit/001-path.cpp: fix coding style complaint

Fix the checkpatch.pl warnings, making it coding style complaint.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agosamples/c/get_setup_mode.c: fix coding style complaint
Kamalesh Babulal [Fri, 11 Aug 2023 06:55:04 +0000 (12:25 +0530)] 
samples/c/get_setup_mode.c: fix coding style complaint

Fix the checkpatch.pl warnings, making it coding style complaint.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agosamples/c/create_systemd_scope.c: fix coding style complaint
Kamalesh Babulal [Fri, 11 Aug 2023 06:55:04 +0000 (12:25 +0530)] 
samples/c/create_systemd_scope.c: fix coding style complaint

Fix the checkpatch.pl warnings, making it coding style complaint.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agotools/cgget: fix coding style complaint
Kamalesh Babulal [Fri, 11 Aug 2023 06:55:04 +0000 (12:25 +0530)] 
tools/cgget: fix coding style complaint

Fix the checkpatch.pl warnings, making it coding style complaint.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agotools/cgconfig.c: fix coding style complaint
Kamalesh Babulal [Fri, 11 Aug 2023 06:55:04 +0000 (12:25 +0530)] 
tools/cgconfig.c: fix coding style complaint

Fix the checkpatch.pl warnings, making it coding style complaint.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agotools/tools-common.c: fix coding style complaint
Kamalesh Babulal [Fri, 11 Aug 2023 06:55:04 +0000 (12:25 +0530)] 
tools/tools-common.c: fix coding style complaint

Fix the checkpatch.pl warnings, making it coding style complaint.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agotools/cgsnapshot.c fix coding style complaint
Kamalesh Babulal [Fri, 11 Aug 2023 06:55:04 +0000 (12:25 +0530)] 
tools/cgsnapshot.c fix coding style complaint

Fix the checkpatch.pl warnings, making it coding style complaint.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agotools/cgcreate.c: fix coding style complaint
Kamalesh Babulal [Fri, 11 Aug 2023 06:55:04 +0000 (12:25 +0530)] 
tools/cgcreate.c: fix coding style complaint

Fix the checkpatch.pl warnings, making it coding style complaint.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agotools/cgclassify: fix coding style complaint
Kamalesh Babulal [Fri, 11 Aug 2023 06:55:04 +0000 (12:25 +0530)] 
tools/cgclassify: fix coding style complaint

Fix the checkpatch.pl warnings, making it coding style complaint.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agosrc/daemon/cgrulesengd.c: fix coding style complaint
Kamalesh Babulal [Fri, 11 Aug 2023 06:55:04 +0000 (12:25 +0530)] 
src/daemon/cgrulesengd.c: fix coding style complaint

Fix the checkpatch.pl warnings, making it coding style complaint.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agosrc/libcgroup_systemd_idle_thread.c: fix coding style complaint
Kamalesh Babulal [Fri, 11 Aug 2023 06:55:04 +0000 (12:25 +0530)] 
src/libcgroup_systemd_idle_thread.c: fix coding style complaint

Fix the checkpatch.pl warnings, making it coding style complaint.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agosrc/libcgroup-internal.h: fix coding style complaint
Kamalesh Babulal [Fri, 11 Aug 2023 06:55:04 +0000 (12:25 +0530)] 
src/libcgroup-internal.h: fix coding style complaint

Fix the checkpatch.pl warnings, making it coding style complaint.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agosrc/abstraction-common.c: fix coding style complaint
Kamalesh Babulal [Fri, 11 Aug 2023 06:55:04 +0000 (12:25 +0530)] 
src/abstraction-common.c: fix coding style complaint

Fix the checkpatch.pl warnings, making it coding style complaint.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agosrc/systemd.c: fix coding style complaint
Kamalesh Babulal [Fri, 11 Aug 2023 06:55:04 +0000 (12:25 +0530)] 
src/systemd.c: fix coding style complaint

Fix the checkpatch.pl warnings, making it coding style complaint.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agosrc/wrapper.c: fix coding style complaint
Kamalesh Babulal [Fri, 11 Aug 2023 06:55:04 +0000 (12:25 +0530)] 
src/wrapper.c: fix coding style complaint

Fix the checkpatch.pl warnings, making it coding style complaint.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agosrc/config.c: fix coding style complaint
Kamalesh Babulal [Fri, 11 Aug 2023 06:55:04 +0000 (12:25 +0530)] 
src/config.c: fix coding style complaint

Fix the checkpatch.pl warnings, making it coding style complaint.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agosrc/api.c: fix coding style complaint
Kamalesh Babulal [Fri, 11 Aug 2023 06:55:04 +0000 (12:25 +0530)] 
src/api.c: fix coding style complaint

Fix the checkpatch.pl warnings, making it coding style complaint.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agoinclude/libcgroup/systemd.h: fix coding style complaint
Kamalesh Babulal [Fri, 11 Aug 2023 06:55:04 +0000 (12:25 +0530)] 
include/libcgroup/systemd.h: fix coding style complaint

Fix the checkpatch.pl warnings, making it coding style complaint.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agogunit/015: use ARRAY_SIZE() macro
Kamalesh Babulal [Tue, 8 Aug 2023 10:56:58 +0000 (16:26 +0530)] 
gunit/015: use ARRAY_SIZE() macro

Use ARRAY_SIZE() macro to calculate the length of the array, across the
file.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agogunit/012: use ARRAY_SIZE() macro
Kamalesh Babulal [Tue, 8 Aug 2023 10:56:53 +0000 (16:26 +0530)] 
gunit/012: use ARRAY_SIZE() macro

Use ARRAY_SIZE() macro to calculate the length of the array, across the
file.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agogunit/009: use ARRAY_SIZE() macro
Kamalesh Babulal [Tue, 8 Aug 2023 10:56:49 +0000 (16:26 +0530)] 
gunit/009: use ARRAY_SIZE() macro

Use ARRAY_SIZE() macro to calculate the length of the array, across the
file.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agogunit/008: use ARRAY_SIZE() macro
Kamalesh Babulal [Tue, 8 Aug 2023 10:56:45 +0000 (16:26 +0530)] 
gunit/008: use ARRAY_SIZE() macro

Use ARRAY_SIZE() macro to calculate the length of the array, across the
file.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agogunit/006: use ARRAY_SIZE() macro
Kamalesh Babulal [Tue, 8 Aug 2023 10:56:40 +0000 (16:26 +0530)] 
gunit/006: use ARRAY_SIZE() macro

Use ARRAY_SIZE() macro to calculate the length of the array, across the
file.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agosrc/systemd.c: use ARRAY_SIZE() macro
Kamalesh Babulal [Tue, 8 Aug 2023 10:16:10 +0000 (15:46 +0530)] 
src/systemd.c: use ARRAY_SIZE() macro

Use ARRAY_SIZE() macro to calculate the length of the array, across the
file.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agosrc/api.c: use ARRAY_SIZE() macro
Kamalesh Babulal [Tue, 8 Aug 2023 10:16:03 +0000 (15:46 +0530)] 
src/api.c: use ARRAY_SIZE() macro

Use ARRAY_SIZE() macro to calculate the length of the array, across the
file.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agosrc/abstraction-map.c: use ARRAY_SIZE() macro
Kamalesh Babulal [Tue, 8 Aug 2023 10:15:56 +0000 (15:45 +0530)] 
src/abstraction-map.c: use ARRAY_SIZE() macro

Use ARRAY_SIZE() macro to calculate the length of the array, across the
file.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
23 months agolibcgroup-internal.h: add ARRAY_SIZE macro
Kamalesh Babulal [Mon, 7 Aug 2023 09:26:36 +0000 (14:56 +0530)] 
libcgroup-internal.h: add ARRAY_SIZE macro

Add ARRAY_SIZE macro to calculate the size of an array, this helper
macro improves readability.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>