]> git.ipfire.org Git - thirdparty/libcgroup.git/log
thirdparty/libcgroup.git
3 years agotools/cgxget: fix coverity warning about resource leak
Kamalesh Babulal [Wed, 25 May 2022 17:11:43 +0000 (11:11 -0600)] 
tools/cgxget: fix coverity warning about resource leak

Fix a resource leaks reported by Coverity tool:

CID 258302 (#1 of 1): Resource leak (RESOURCE_LEAK). leaked_storage:
Variable dir going out of scope leaks the storage it points to

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agotools/cgget: fix coverity warning about double free
Kamalesh Babulal [Wed, 25 May 2022 13:47:48 +0000 (07:47 -0600)] 
tools/cgget: fix coverity warning about double free

Fix double free warning, reported by Coverity tool:

CID 258297 (#1 of 1): Double free (USE_AFTER_FREE). double_free:
Calling closedir frees pointer dir which has already been freed.

As per the man page, the closedir(), closes the directory stream
associated with the dirp, but is ambiguous about if dirp is set to NULL
or not. Coverity answers that with the above report, that dirp is not
NULL and hence the double free.

Fixes: fea1ab8b45d7 ("tools/cgget: fix coverity warning about resource leak")
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoapi.c: fix coverity out of bounds read warning
Kamalesh Babulal [Wed, 25 May 2022 13:40:10 +0000 (07:40 -0600)] 
api.c: fix coverity out of bounds read warning

Fix out of bounds read, reported by Coverity tool:

CID 1412156 (#1 of 1): Out-of-bounds read (OVERRUN).
overrun-local: Overrunning array cgroup_strerror_codes of 30 8-byte
elements at element index 49999 (byte offset 399999) using index
code % ECGROUPNOTCOMPILED (which evaluates to 49999).

Reproducer:
-----------
$ cat cgrp-strerr.c

int main(void)
{
        int err = ECGNONEMPTY;

        fprintf(stderr, "%s\n", cgroup_strerror(err));

        return 0;
}

without the patch:
-----------------
$ ./cgrp-stderr
(null)

with the patch:
---------------
$ ./cgrp-stderr
Failed to remove a non-empty group

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoconfigure: introduce --enable-tests/--disable-tests
Kamalesh Babulal [Mon, 23 May 2022 19:49:50 +0000 (13:49 -0600)] 
configure: introduce --enable-tests/--disable-tests

There are scenarios where running tests as part of the make check is
not desirable, like rpmbuild.  The build systems might not have the
environment to run the tests and might fail to build the packages.

This patch introduces, --enable-tests as a configure option, which
is set by default and can be disabled using the --disable-tests flag.
When disabled, the configure will skip creating the Makefiles for the
tests/* directories and in the top-level Makefile the SUBDIRS omits
tests. For example, consider the rpmbuild case to build rpm with
--disable-tests passed:
1. ./bootstrap.sh
2. ./configure ./configure --enable-opaque-hierarchy="name=systemd"
   --disable-tests
3. make check
4. make dist
5. cp libcgroup-3.0.0.tar.gz ~/rpmbuild/SOURCES
6. append --disable-tests to configure in libcgroup.spec
7. rpmbuild -ba libcgroup.spec

this will skip running the test/*, during the build, avoiding unexpected
failures

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agotools/cgxset: fix Coverity uninitialized variable warning
Kamalesh Babulal [Fri, 20 May 2022 14:45:16 +0000 (08:45 -0600)] 
tools/cgxset: fix Coverity uninitialized variable warning

Originally this issue got reported on tools/cgset and since tools/cgxset
borrows most of the code from cgset, fix the issue here too.  The
original warning (cgset):

CID 1488715 (#1 of 1): Uninitialized scalar variable (UNINIT).
uninit_use_in_call: Using uninitialized value *src_cg_path as
argument to %s when calling fprintf.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agotools/cgsnapshot: fix coverity uninitialized variable warning
Kamalesh Babulal [Fri, 20 May 2022 14:44:58 +0000 (08:44 -0600)] 
tools/cgsnapshot: fix coverity uninitialized variable warning

Fix uninitialized scalar variable, reported by Coverity tool:

CID 1412125 (#1 of 1): Uninitialized scalar variable (UNINIT).
uninit_use_in_call: Using uninitialized element of array *controllers
when calling is_ctlr_on_list.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agotools/cgset: fix coverity uninitialized variable warning
Kamalesh Babulal [Fri, 20 May 2022 14:44:27 +0000 (08:44 -0600)] 
tools/cgset: fix coverity uninitialized variable warning

Fix uninitialized scalar variable, reported by Coverity tool:

CID 1488715 (#1 of 1): Uninitialized scalar variable (UNINIT).
uninit_use_in_call: Using uninitialized value *src_cg_path as argument
to %s when calling fprintf.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agotools/lssubsys: fix coverity uninitialized variable warning
Kamalesh Babulal [Fri, 20 May 2022 14:40:47 +0000 (08:40 -0600)] 
tools/lssubsys: fix coverity uninitialized variable warning

Fix uninitialized scalar variable, reported by Coverity tool:

CID 1488707 (#1 of 1): Uninitialized scalar variable (UNINIT).
uninit_use_in_call: Using uninitialized value *cont_names when calling
print_controller_mount.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agosrc/config: fix coverity warning about add missing unlock()
Kamalesh Babulal [Fri, 20 May 2022 14:25:35 +0000 (08:25 -0600)] 
src/config: fix coverity warning about add missing unlock()

Add missing unlock() of cg_mount_table_lock, reported by Coverity tool:

CID 1412126 (#1 of 1): Missing unlock (LOCK). missing_unlock:
Returning without unlocking cg_mount_table_lock.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agotools/cgdelete: fix coverity wrong argument size warning
Kamalesh Babulal [Wed, 18 May 2022 17:09:51 +0000 (11:09 -0600)] 
tools/cgdelete: fix coverity wrong argument size warning

Fix a wrong argument size, reported by Coverity tool:

CID 1412122 (#1 of 1): Wrong sizeof argument (SIZEOF_MISMATCH)
suspicious_sizeof: Passing argument 8UL
/* sizeof (struct ext_cgroup_record *) */ to function calloc and then
casting the return value to struct ext_cgroup_record * is suspicious.

Also, fix the typo in the variable name, that's being allocated memory.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoworkflows/CI: upgrade CodeQL actions used to v2
Kamalesh Babulal [Mon, 16 May 2022 22:05:39 +0000 (16:05 -0600)] 
workflows/CI: upgrade CodeQL actions used to v2

CodeQL warns about deprecating v1 by Dec 2022.  Upgrade the CodeQL
actions, as per the recommendation made in the upgrade guide at:
https://github.blog/changelog/2022-04-27-code-scanning-deprecation-of-codeql-action-v1/

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agotools/cgget: fix coverity warning about resource leak
Kamalesh Babulal [Mon, 16 May 2022 21:57:45 +0000 (15:57 -0600)] 
tools/cgget: fix coverity warning about resource leak

Fix two resource leaks reported by Coverity tool:

CID 1488718 (#1 of 1): Resource leak (RESOURCE_LEAK) leaked_storage:
Variable handle going out of scope leaks the storage it points to.

CID 1488723 (#1 of 1): Resource leak (RESOURCE_LEAK) leaked_storage:
Variable dir going out of scope leaks the storage it points to.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoapi.c: resize controller name to 32 from 4096 bytes
Kamalesh Babulal [Fri, 6 May 2022 15:36:33 +0000 (21:06 +0530)] 
api.c: resize controller name to 32 from 4096 bytes

Linux kernel warns on the cgroup controller name length greater than
32 bytes during the cgroup initialization in cgroup_init_early().  Adopt
the same size of 32 bytes (including the null byte) for controller name
in the struct cg_controller and struct cg_mount_table_s.  This resize
from FILENAME_MAX (4096 bytes) to a mere 32 bytes, reduces the
libcgroup.so library:

Without the patch:
------------------
$ size -d src/.libs/libcgroup.so
   text    data     bss     dec     hex filename
 123841    3600 2476532 2603973  27bbc5 src/.libs/libcgroup.so

With the patch:
---------------
$ size -d src/.libs/libcgroup.so
   text    data     bss     dec     hex filename
 123569    3600 1257332 1384501  152035 src/.libs/libcgroup.so

also replace the index FILENAME_MAX with CONTROL_NAMELEN_MAX at the
struct cg_controller::name and struct cg_mount_table_s::name references.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoman/lscgroup: add tool support status
Kamalesh Babulal [Fri, 13 May 2022 15:17:48 +0000 (20:47 +0530)] 
man/lscgroup: add tool support status

lscgroup is currently supported on cgroups v1 only, add the note about
the support status in the man page.

Suggested-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>
3 years agoman/lssubsys: add tool support status
Kamalesh Babulal [Fri, 13 May 2022 15:17:43 +0000 (20:47 +0530)] 
man/lssubsys: add tool support status

lssubsys is currently supported on cgroups v1 only, add the note about
the support status in the man page.

Suggested-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>
3 years agotools/lscgroup: add support status for the tool
Kamalesh Babulal [Fri, 13 May 2022 15:17:39 +0000 (20:47 +0530)] 
tools/lscgroup: add support status for the tool

lscgroup currently doesn't support the cgroupv2 filesystem.  Add the
warning about the support status in the help.

Fixes: https://github.com/libcgroup/libcgroup/issues/50
Suggested-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>
3 years agotools/lssubsys: add support status for the tool
Kamalesh Babulal [Fri, 13 May 2022 15:17:33 +0000 (20:47 +0530)] 
tools/lssubsys: add support status for the tool

lssubsys currently doesn't support the cgroups v2 filesystem.  Add the
warning about the support status in the help.

Fixes: https://github.com/libcgroup/libcgroup/issues/50
Suggested-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>
3 years agoapi.c: fix segfault in cgroup_populate_mount_points()
Kamalesh Babulal [Mon, 2 May 2022 21:40:36 +0000 (15:40 -0600)] 
api.c: fix segfault in cgroup_populate_mount_points()

In cgroup_populate_mount_points(),  cgroup v1/v2 mount points get read
from /proc/mounts and populated into cg_mount_table[].  The size of
cg_mount_table[] is set to CG_CONTROLLER_MAX, that's defined as 100 and
if the system has more than CG_CONTROLLER_MAX, unique mount points, it
will segfault while processing them.  Fix this by checking, the mount
point count after processing every mount entry and bailout in case it
reaches CG_CONTROLLER_MAX.

The issue can be reproduced using, following simple bash commands on
cgroup v1:
1. sudo for i in $(seq 0 100); do sudo mkdir /name$i; done
2. sudo for i in $(seq 0 86); do sudo mount -t cgroup -o none,name=named$i
none /name$i; done
3. sudo cgget -g <controller>:<existing cgroup name>

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agopython: Make Cgroup.mount_points() more pythonic
Tom Hromatka [Fri, 29 Apr 2022 16:52:25 +0000 (10:52 -0600)] 
python: Make Cgroup.mount_points() more pythonic

Rename cgroup_list_mount_points() to mount_points() and
convert it to an @staticmethod.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Reviewed-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
3 years agoapi.c: fix deleting cgroup created on shared mnt point
Kamalesh Babulal [Fri, 22 Apr 2022 20:55:12 +0000 (14:55 -0600)] 
api.c: fix deleting cgroup created on shared mnt point

cgroup v1 allows mounting of two or more controllers on a single
mount point.  This fails currently when trying to delete the cgroup
recursively for all the mounted controllers because the cgroup is
already deleted by the first controller of the share mount point and
the next controllers sharing the mount point complain about
missing cgroup path.

Fix this issue by introducing shared_mnt flag to cg_mount_table_s
struct and setting it during cgroup_init() on finding a mount point
shared by controllers and repeats the check in cgroup_find_parent()
on the error to check its share mount point and ignore the error if the
file doesn't exist, similar to ignoring if the file exists during
creation.

Fixes: https://github.com/libcgroup/libcgroup/issues/127
Reported-by: Vijayendra Lakkundi <vijayendra.lakkundi@oracle.com>
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoapi.c: add support to attach tid to an empty cgroup v2
Kamalesh Babulal [Mon, 4 Apr 2022 06:48:46 +0000 (12:18 +0530)] 
api.c: add support to attach tid to an empty cgroup v2

Currently, cgroup_attach_task_pid() checks for enabled
controllers before attaching the given tid to it, but in the case of
empty cgroup, it simply ignores the attaching due to no controllers
available, a.k.a. cgroup->index is 0.  Add support to recognize empty
controller cgroups.

Fixes: https://github.com/libcgroup/libcgroup/issues/129
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoapi.c: add check for empty cgroup v2 controller
Kamalesh Babulal [Mon, 4 Apr 2022 06:48:44 +0000 (12:18 +0530)] 
api.c: add check for empty cgroup v2 controller

There can be cgroup v2 cgroup with no controllers attached to it and
while checking for enabled controllers always return true in
cgroupv2_controller_enabled() for such cgroups.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoapi.c: fix build warnings
Kamalesh Babulal [Wed, 20 Apr 2022 15:09:33 +0000 (09:09 -0600)] 
api.c: fix build warnings

Fix the use before initialization build warnings:

api.c: In function ‘cgroup_populate_controllers.constprop’:
api.c:1386:5: warning: ‘buf’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 1386 |  if (buf)
      |     ^
api.c: In function ‘cgroup_populate_mount_points.constprop’:
api.c:1461:5: warning: ‘temp_ent’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 1461 |  if (temp_ent)
      |     ^

this patch, initializes them to NULL.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoapi.c: add support for empty cgroup v2 deletion
Kamalesh Babulal [Thu, 31 Mar 2022 12:21:55 +0000 (17:51 +0530)] 
api.c: add support for empty cgroup v2 deletion

Add support to recognize empty cgroup v2 with no controllers attached to
it in cgroup_delete_cgroup_ext(), that gets called to remove a cgroup.

In the deletion path, cgroup_build_tasks_procs_path() builds the path
of the cgroup for re-assignment/movement of tasks from the cgroup that's
getting deleted, teach it to recognize the empty controller as cgroup
V2.

Fixes: https://github.com/libcgroup/libcgroup/issues/125
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
TJH: Fix a couple small typos in commit message

3 years agopython: add support to list cgroup mount points
Kamalesh Babulal [Wed, 30 Mar 2022 06:19:14 +0000 (11:49 +0530)] 
python: add support to list cgroup mount points

Add support to the python bindings to list cgroup mount points.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoapi.c: API to list mount points of a cgroup type
Kamalesh Babulal [Wed, 30 Mar 2022 06:19:03 +0000 (11:49 +0530)] 
api.c: API to list mount points of a cgroup type

Currently, there is no easy way for a user to list cgroup mount points,
one way to acquire required information is by manually reading the
/proc/mounts and parsing the information they are interested in.

Add a new API:
cgroup_list_mount_points(cg_version_t version, char ***mnts),

where the first argument is either CGROUP_V1 or CGROUP_V2, that
specifies the mount point types and the second argument is a char**,
that will hold the mount point paths of the cgroup version specified in
the first agrument. Note that the mnts pointers are supposed to free'd.
mnts pointers.

$ cat get_mount.c

int main(void)
{
        enum cg_version_t t = CGROUP_V2;
        char **mount_paths = NULL;
        int i = 0;
        int ret;

        cgroup_init();

         ret = cgroup_list_mount_points(t, &mount_paths);
         if (ret != 0) {
                 fprintf(stderr, "Failed to get mount points\n");
                 return ret;
        }

        while (mount_paths[i]) {
                fprintf(stderr, "%s\n", mount_paths[i]);
                free(mount_paths[i]);
                i++;
        }
        free(mount_paths);

        return 0;
}

$ gcc -o get_mount get_mount.c -lcgroup

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoapi.c: refactor cgroup_process_*_mnt()
Kamalesh Babulal [Sat, 26 Mar 2022 13:40:50 +0000 (19:10 +0530)] 
api.c: refactor cgroup_process_*_mnt()

Abstract appending new mount point to the cg_mount_table[] into new
function, reducing the duplication in both cgroup_process_v1_mnt()
and cgroup_process_v2_mnt().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
TJH: Remove erroneous whitespace addition

3 years agoapi.c: refactor cgroup_init()
Kamalesh Babulal [Sat, 26 Mar 2022 13:40:43 +0000 (19:10 +0530)] 
api.c: refactor cgroup_init()

Refactor cgroup_init() by abstracting freeing of previous cg_mount_table,
populating controller by reading /proc/cgroups file and populating
mount points into its own function.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
TJH: Fix minor typo in commit message

3 years agosamples/c: add empty_cgroup_v2 to the makefile
Kamalesh Babulal [Mon, 28 Mar 2022 06:11:57 +0000 (11:41 +0530)] 
samples/c: add empty_cgroup_v2 to the makefile

Add the empty_cgroup_v2.c to the makefile, to maintain it like other
sample programs in the directory.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agosamples/c: add empty cgroup v2 creation program
Kamalesh Babulal [Mon, 28 Mar 2022 06:11:50 +0000 (11:41 +0530)] 
samples/c: add empty cgroup v2 creation program

Add a simple program, that demonstrates the creation of an empty cgroup
on cgroup v2.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agobootstrap.sh: make it shellcheck complaint
Kamalesh Babulal [Fri, 25 Mar 2022 06:06:21 +0000 (11:36 +0530)] 
bootstrap.sh: make it shellcheck complaint

Make bootstrap.in shellcheck complaint.  It fixes all the issues
reported by the shellcheck version version 0.7.0.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoscripts/init.d/cgred.in: add fallback logging on non-lsb systems
Kamalesh Babulal [Fri, 25 Mar 2022 06:06:19 +0000 (11:36 +0530)] 
scripts/init.d/cgred.in: add fallback logging on non-lsb systems

Add support for fallback logging on non-lsb system, this logic is
borrowed from the commit 63a8972bac45 ("Modernise cgconfig initscript").

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoscripts/init.d/cgconfig.in: make it shellcheck complaint
Kamalesh Babulal [Fri, 25 Mar 2022 06:06:17 +0000 (11:36 +0530)] 
scripts/init.d/cgconfig.in: make it shellcheck complaint

Make cgconfig.in shellcheck complaint.  It fixes all the issues reported
by the shellcheck version version 0.7.0.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoscripts/init.d/cgred.in: make it shellcheck complaint
Kamalesh Babulal [Fri, 25 Mar 2022 06:06:14 +0000 (11:36 +0530)] 
scripts/init.d/cgred.in: make it shellcheck complaint

Make cgred.in shellcheck complaint.  It fixes all the issues reported by
the shellcheck version version 0.7.0.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agolssubsys.c: adopt err()/info() for printing messages
Kamalesh Babulal [Tue, 22 Mar 2022 10:04:38 +0000 (15:34 +0530)] 
lssubsys.c: adopt err()/info() for printing messages

Replace usage of fprintf(stderr, ...) with err() and printf(...) with
info().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agolscgroup.c: adopt err()/info() for printing messages
Kamalesh Babulal [Tue, 22 Mar 2022 10:04:35 +0000 (15:34 +0530)] 
lscgroup.c: adopt err()/info() for printing messages

Replace usage of fprintf(stderr, ...) with err() and printf(...) with
info().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agocgxset.c: adopt err()/info() for printing messages
Kamalesh Babulal [Tue, 22 Mar 2022 10:04:32 +0000 (15:34 +0530)] 
cgxset.c: adopt err()/info() for printing messages

Replace usage of fprintf(stderr, ...) with err() and printf(...) with
info().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agocgxget.c: adopt err()/info() for printing messages
Kamalesh Babulal [Tue, 22 Mar 2022 10:04:29 +0000 (15:34 +0530)] 
cgxget.c: adopt err()/info() for printing messages

Replace usage of fprintf(stderr, ...) with err() and printf(...) with
info().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agocgsnapshot.c: adopt err()/info() for printing messages
Kamalesh Babulal [Tue, 22 Mar 2022 10:04:27 +0000 (15:34 +0530)] 
cgsnapshot.c: adopt err()/info() for printing messages

Replace usage of fprintf(stderr, ...) with err() and printf(...) with
info().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agocgset.c: adopt err()/info() for printing messages
Kamalesh Babulal [Tue, 22 Mar 2022 10:04:25 +0000 (15:34 +0530)] 
cgset.c: adopt err()/info() for printing messages

Replace usage of fprintf(stderr, ...) with err() and printf(...) with
info().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agocgget.c: adopt err()/info() for printing messages
Kamalesh Babulal [Tue, 22 Mar 2022 10:04:23 +0000 (15:34 +0530)] 
cgget.c: adopt err()/info() for printing messages

Replace usage of fprintf(stderr, ...) with err() and printf(...) with
info().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agocgexec: adopt err()/info() for printing messages
Kamalesh Babulal [Tue, 22 Mar 2022 10:04:20 +0000 (15:34 +0530)] 
cgexec: adopt err()/info() for printing messages

Replace usage of fprintf(stderr, ...) with err() and printf(...) with
info().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agocgdelete.c: adopt err()/info() for printing messages
Kamalesh Babulal [Tue, 22 Mar 2022 10:04:18 +0000 (15:34 +0530)] 
cgdelete.c: adopt err()/info() for printing messages

Replace usage of fprintf(stderr, ...) with err() and printf(...) with
info().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agocgcreate: adopt err()/info() for printing messages
Kamalesh Babulal [Tue, 22 Mar 2022 10:04:15 +0000 (15:34 +0530)] 
cgcreate: adopt err()/info() for printing messages

Replace usage of fprintf(stderr, ...) with err() and printf(...)
with info().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agocgconfig.c: adopt err()/info() for printing messages
Kamalesh Babulal [Tue, 22 Mar 2022 10:04:13 +0000 (15:34 +0530)] 
cgconfig.c: adopt err()/info() for printing messages

Replace usage of fprintf(stderr, ...) with err() and printf(...) with
info().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agocgclassify: adopt err()/info() for printing messages
Kamalesh Babulal [Tue, 22 Mar 2022 10:04:10 +0000 (15:34 +0530)] 
cgclassify: adopt err()/info() for printing messages

Replace usage of fprintf(stderr, ...) with err() and printf(...) with
info().

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agotools-common.h: add logging helpers
Kamalesh Babulal [Tue, 22 Mar 2022 10:03:41 +0000 (15:33 +0530)] 
tools-common.h: add logging helpers

fprintf(stderr, ...); is used across the tools to notify the user about
something that went wrong and needs to abort. Similarly, printf() is
used to print information, may continue with the code execution.

This patch adds helper macro err(), info(), that can replace messaging
printing to stderr/stdout, making code readable and compact.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agospecfile: fix the samples/config path
Kamalesh Babulal [Thu, 24 Mar 2022 13:55:40 +0000 (07:55 -0600)] 
specfile: fix the samples/config path

Change the location of sample configuration files from sample/ to
samples/config/, this movement got introduced by Commit b546e328e00c
"samples: Move the config examples to samples/config/").

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agodoc: Update the github release process
Tom Hromatka [Fri, 18 Mar 2022 16:34:23 +0000 (10:34 -0600)] 
doc: Update the github release process

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Reviewed-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
3 years agogithub: Add make distcheck Github Action
Tom Hromatka [Fri, 18 Mar 2022 14:49:30 +0000 (08:49 -0600)] 
github: Add make distcheck Github Action

Add a step to run `make distcheck` in the continuous integration
GitHub Action.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Reviewed-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
3 years agoMakefile.am: Add support for make distcheck
Tom Hromatka [Fri, 18 Mar 2022 13:53:58 +0000 (07:53 -0600)] 
Makefile.am: Add support for make distcheck

Add support for `make distcheck`.  Provide the requisite
./configure options during the build and clean up Python
build artifacts afterwards.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Reviewed-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
3 years agocgrulesend: fix typo in help options
Kamalesh Babulal [Wed, 23 Mar 2022 13:49:18 +0000 (07:49 -0600)] 
cgrulesend: fix typo in help options

Fix a typo 'nodaemom' -> 'nodaemon' in the help options.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agosrc/config.c: remove log level prefix
Kamalesh Babulal [Thu, 17 Mar 2022 12:47:27 +0000 (18:17 +0530)] 
src/config.c: remove log level prefix

With commit 97a0e195ddd7 ("log: add log level string prefix to
logging functions"), log level prefixes gets added to message
printed by cgroup_{err,warn,info} functions, remove them from
message passed to these functions.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agosrc/api.c: remove log level prefix
Kamalesh Babulal [Sat, 19 Mar 2022 14:14:40 +0000 (19:44 +0530)] 
src/api.c: remove log level prefix

With commit 97a0e195ddd7 ("log: add log level string prefix to
logging functions"), log level prefixes gets added to message
printed by cgroup_{err,warn,info} functions, remove them from
message passed to these functions.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agosrc/abstraction-common.c: remove log level prefix
Kamalesh Babulal [Sat, 19 Mar 2022 14:14:29 +0000 (19:44 +0530)] 
src/abstraction-common.c: remove log level prefix

With commit 97a0e195ddd7 ("log: add log level string prefix to
logging functions"), log level prefixes gets added to message
printed by cgroup_{err,warn,info} functions, remove them from
message passed to these functions.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoapi.c: fix a memory leak in cgroup_init()
Kamalesh Babulal [Sat, 19 Mar 2022 06:41:50 +0000 (12:11 +0530)] 
api.c: fix a memory leak in cgroup_init()

temp_ent is not free'ed in the error path if cgroup_process_v1_mnt() or
cgroup_process_v2_mnt() fails.  Move the free'ing of temp_ent to error
path.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoMakefile: fix samples/c build dependency
Kamalesh Babulal [Sat, 19 Mar 2022 06:55:25 +0000 (12:25 +0530)] 
Makefile: fix samples/c build dependency

If the user chooses to build the samples/c programs, it will fail to
build, with the error:

config.status: creating samples/c/Makefile
  CC       setuid.o
make: *** No rule to make target '../../src/.libs/libcgroup.la', needed by 'setuid'.  Stop.

it is due to the dependency on libcgroup.la, which is currently built
after samples. Fix it by moving the samples directory to be built after
src directory.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoModernise cgconfig initscript.
Vladimir Nikishkin [Thu, 17 Mar 2022 16:15:05 +0000 (10:15 -0600)] 
Modernise cgconfig initscript.

1. Remove obsolete constructions from scripts/init/cgconfig.in
2. Add fallback logging functions for non-lsb systems.

Signed-off-by: Vladimir Nikishkin <libcgroup@lockywolf.net>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
TJH: Merged the original patch and review comments patch into one commit

3 years agoCOPYING: fix trailing white spaces
Kamalesh Babulal [Wed, 16 Mar 2022 16:23:02 +0000 (21:53 +0530)] 
COPYING: fix trailing white spaces

checkpatch.pl reported trailing white spaces, fix them.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoscripts/init.d/cgred.in: fix trailing white spaces
Kamalesh Babulal [Wed, 16 Mar 2022 16:22:32 +0000 (21:52 +0530)] 
scripts/init.d/cgred.in: fix trailing white spaces

checkpatch.pl reported trailing white spaces, fix them.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoman/cgexec.1: fix trailing white spaces
Kamalesh Babulal [Wed, 16 Mar 2022 16:20:06 +0000 (21:50 +0530)] 
man/cgexec.1: fix trailing white spaces

checkpatch.pl reported trailing white spaces, fix them.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoman/cgexec.1: fix trailing white spaces
Kamalesh Babulal [Wed, 16 Mar 2022 16:19:45 +0000 (21:49 +0530)] 
man/cgexec.1: fix trailing white spaces

checkpatch.pl reported trailing white spaces, fix them.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoman/cgconfig.conf.5: fix trailing white spaces
Kamalesh Babulal [Wed, 16 Mar 2022 16:19:26 +0000 (21:49 +0530)] 
man/cgconfig.conf.5: fix trailing white spaces

checkpatch.pl reported trailing white spaces, fix them.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoman/cgrules.conf.5: fix trailing white spaces
Kamalesh Babulal [Wed, 16 Mar 2022 16:18:56 +0000 (21:48 +0530)] 
man/cgrules.conf.5: fix trailing white spaces

checkpatch.pl reported trailing white spaces, fix them.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agodist/libcgroup.spec.in: fix trailing white spaces
Kamalesh Babulal [Wed, 16 Mar 2022 16:18:29 +0000 (21:48 +0530)] 
dist/libcgroup.spec.in: fix trailing white spaces

checkpatch.pl reported trailing white spaces, fix them.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agolibcgroup.doxyfile: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 16:18:08 +0000 (21:48 +0530)] 
libcgroup.doxyfile: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG, USE_NEGATIVE_ERRNO types.  It also introduces
reverse xmas tree local variable declarations and header file
reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 0 errors, 1 warnings, 1519 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoinclude/tools.h: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 16:17:38 +0000 (21:47 +0530)] 
include/tools.h: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG.  It also introduces reverse xmas tree local
variable declarations and header file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 1 errors, 3 warnings, 73 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoinclude/tasks.h: introduce coding style changes
Kamalesh Babulal [Wed, 16 Mar 2022 16:17:11 +0000 (21:47 +0530)] 
include/tasks.h: introduce coding style changes

This patch introduces coding style changes such as reverse xmas tree
local variable declarations, header file reordering, and many other
minor tweaks such as line spacing, removing trailing white spaces.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoinclude/log.h: introduce coding style changes
Kamalesh Babulal [Wed, 16 Mar 2022 16:16:41 +0000 (21:46 +0530)] 
include/log.h: introduce coding style changes

This patch introduces coding style changes such as reverse xmas tree
local variable declarations, header file reordering, and many other
minor tweaks such as line spacing, removing trailing white spaces.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoinclude/iterators.h: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 16:16:22 +0000 (21:46 +0530)] 
include/iterators.h: fix checkpatch.pl warnings

This patch introduces coding style changes such as reverse xmas tree
local variable declarations, header file reordering, and many other
minor tweaks such as line spacing, removing trailing white spaces.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 0 errors, 25 warnings, 432 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoinclude/init.h: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 16:16:04 +0000 (21:46 +0530)] 
include/init.h: fix checkpatch.pl warnings

This patch introduces coding style changes such as reverse xmas tree
local variable declarations, header file reordering, and many other
minor tweaks such as line spacing, removing trailing white spaces.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 0 errors, 1 warnings, 86 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agoinclude/groups.h: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 16:15:44 +0000 (21:45 +0530)] 
include/groups.h: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG.  It also introduces reverse xmas tree local
variable declarations and header file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 0 errors, 27 warnings, 630 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agosamples/config/cgred.conf: fix trailing white spaces
Kamalesh Babulal [Wed, 16 Mar 2022 16:15:06 +0000 (21:45 +0530)] 
samples/config/cgred.conf: fix trailing white spaces

checkpatch.pl reported trailing white space, fix it.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agosamples/test_functions.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 16:14:46 +0000 (21:44 +0530)] 
samples/test_functions.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG.  It also introduces reverse xmas tree local
variable declarations and header file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 2 errors, 19 warnings, 927 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agosamples/wrapper_test.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 16:14:20 +0000 (21:44 +0530)] 
samples/wrapper_test.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG.  It also introduces reverse xmas tree local
variable declarations and header file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 1 errors, 0 warnings, 44 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agosamples/walk_test.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 16:13:15 +0000 (21:43 +0530)] 
samples/walk_test.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG.  It also introduces reverse xmas tree local
variable declarations and header file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 0 errors, 0 warnings, 121 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agosamples/walk_task.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 16:12:57 +0000 (21:42 +0530)] 
samples/walk_task.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG.  It also introduces reverse xmas tree local
variable declarations and header file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 0 errors, 1 warnings, 49 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agosamples/test_named_hierarchy.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 16:09:07 +0000 (21:39 +0530)] 
samples/test_named_hierarchy.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG.  It also introduces reverse xmas tree local
variable declarations and header file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 1 errors, 0 warnings, 47 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agosamples/setuid.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 16:07:47 +0000 (21:37 +0530)] 
samples/setuid.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG.  It also introduces reverse xmas tree local
variable declarations and header file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
0 errors, 1 warnings, 82 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agosamples/read_stats.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 16:07:14 +0000 (21:37 +0530)] 
samples/read_stats.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG.  It also introduces reverse xmas tree local
variable declarations and header file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 0 errors, 0 warnings, 84 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agosamples/proctest.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 16:05:16 +0000 (21:35 +0530)] 
samples/proctest.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG.  It also introduces reverse xmas tree local
variable declarations and header file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
0 errors, 1 warnings, 55 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agosamples/logger.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 16:04:27 +0000 (21:34 +0530)] 
samples/logger.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG.  It also introduces reverse xmas tree local
variable declarations and header file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 0 errors, 0 warnings, 53 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agosamples/get_variable_names.c:fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 16:04:00 +0000 (21:34 +0530)] 
samples/get_variable_names.c:fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG.  It also introduces reverse xmas tree local
variable declarations and header file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 0 errors, 2 warnings, 59 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agosamples/get_procs.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 16:00:10 +0000 (21:30 +0530)] 
samples/get_procs.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG.  It also introduces reverse xmas tree local
variable declarations and header file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 1 errors, 0 warnings, 36 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agosamples/get_mount_point.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 15:57:25 +0000 (21:27 +0530)] 
samples/get_mount_point.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG.  It also introduces reverse xmas tree local
variable declarations and header file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 1 errors, 1 warnings, 49 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agosamples/get_controller.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 15:55:22 +0000 (21:25 +0530)] 
samples/get_controller.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG.  It also introduces reverse xmas tree local
variable declarations and header file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 1 errors, 0 warnings, 34 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agosamples/get_all_controller.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 15:54:28 +0000 (21:24 +0530)] 
samples/get_all_controller.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG.  It also introduces reverse xmas tree local
variable declarations and header file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 1 errors, 0 warnings, 34 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agocgrulesengd.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 15:54:04 +0000 (21:24 +0530)] 
cgrulesengd.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG, USE_NEGATIVE_ERRNO and NEW_TYPEDEFS types.  It
also introduces reverse xmas tree local variable declarations and header
file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 10 errors, 36 warnings, 1306 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agocgrulesengd.h: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 15:53:45 +0000 (21:23 +0530)] 
cgrulesengd.h: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG, USE_NEGATIVE_ERRNO and NEW_TYPEDEFS types.  It
also introduces reverse xmas tree local variable declarations and header
file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 0 errors, 18 warnings, 129 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agopam/pam_cgroup.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 15:51:53 +0000 (21:21 +0530)] 
pam/pam_cgroup.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG, USE_NEGATIVE_ERRNO types.  It also introduces
reverse xmas tree local variable declarations and header file
reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 0 errors, 10 warnings, 163 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agotools-common.h: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 15:51:36 +0000 (21:21 +0530)] 
tools-common.h: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG, USE_NEGATIVE_ERRNO and NEW_TYPEDEFS types.  It
also introduces reverse xmas tree local variable declarations and header
file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 0 errors, 7 warnings, 145 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agotools-common.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 15:50:38 +0000 (21:20 +0530)] 
tools-common.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG, USE_NEGATIVE_ERRNO and NEW_TYPEDEFS types.  It
also introduces reverse xmas tree local variable declarations and header
file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 1 errors, 2 warnings, 312 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agolssubsys.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 16:24:34 +0000 (21:54 +0530)] 
lssubsys.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG, USE_NEGATIVE_ERRNO and NEW_TYPEDEFS types.  It
also introduces reverse xmas tree local variable declarations and header
file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 0 errors, 16 warnings, 295 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agolscgroup.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 15:45:33 +0000 (21:15 +0530)] 
lscgroup.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG, USE_NEGATIVE_ERRNO and NEW_TYPEDEFS types.  It
also introduces reverse xmas tree local variable declarations and header
file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 0 errors, 9 warnings, 328 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agocgxset.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 15:45:01 +0000 (21:15 +0530)] 
cgxset.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG, USE_NEGATIVE_ERRNO and NEW_TYPEDEFS types.  It
also introduces reverse xmas tree local variable declarations and header
file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 1 errors, 20 warnings, 385 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agocgxget.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 15:42:43 +0000 (21:12 +0530)] 
cgxget.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG, USE_NEGATIVE_ERRNO and NEW_TYPEDEFS types.  It
also introduces reverse xmas tree local variable declarations and header
file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 2 errors, 17 warnings, 921 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agocgsnapshot.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 15:37:43 +0000 (21:07 +0530)] 
cgsnapshot.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG, USE_NEGATIVE_ERRNO and NEW_TYPEDEFS types.  It
also introduces reverse xmas tree local variable declarations and header
file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 1 errors, 39 warnings, 847 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agocgset.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 15:36:34 +0000 (21:06 +0530)] 
cgset.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG, USE_NEGATIVE_ERRNO and NEW_TYPEDEFS types.  It
also introduces reverse xmas tree local variable declarations and header
file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 1 errors, 16 warnings, 284 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agocgget.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 15:32:16 +0000 (21:02 +0530)] 
cgget.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG, USE_NEGATIVE_ERRNO and NEW_TYPEDEFS types.  It
also introduces reverse xmas tree local variable declarations and header
file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 2 errors, 13 warnings, 772 lines checked

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
3 years agocgexec.c: fix checkpatch.pl warnings
Kamalesh Babulal [Wed, 16 Mar 2022 15:25:09 +0000 (20:55 +0530)] 
cgexec.c: fix checkpatch.pl warnings

Fix all of the warnings/errors reported by Linux Kernel's checkpatch.pl,
except SPDX_LICENSE_TAG, USE_NEGATIVE_ERRNO and NEW_TYPEDEFS types.  It
also introduces reverse xmas tree local variable declarations and header
file reordering.

In summary, this patch fixes the following checkpatch.pl
recommendations:
total: 2 errors, 8 warnings, 178 lines checked

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