]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
adds lscgroup tool
authorIvana Hutarova Varekova <varekova@redhat.com>
Fri, 9 Oct 2009 09:40:04 +0000 (11:40 +0200)
committerDhaval Giani <dhaval@linux.vnet.ibm.com>
Fri, 9 Oct 2009 10:15:26 +0000 (15:45 +0530)
commit9c012385dbd80003ba5fe920e644f944ae8eceb3
tree267e2ad7941f746988fb84c1ff997201af6d2514
parent9d8f0ae5c3b3df6bef2f12738f62397623481090
adds lscgroup tool

Description:
create tool which shows cgroups which are on system:

Usage: lscgroup [<controllers>:<path>] [...]
list all cgroups

Changes since V1(the previous versions was not enumerated):
* fix the format of comments which have more than 1 line
* printf of help -> fprintf(stdout,...
* change the sequence of processing of cgroups on input (now
    first) and internal controller list(first in the previous version), now the
    cgroups are output in order in which they are put to input
* fix return values/error messages - now if the controller is not mount
    the tool return error - it returns 0 otherwise
Changes since V2
    * fix problem with slash characters
  ( $ lscgroup cpu:/1/2
  cpu:/1/2/
  cpu:/1/2/1
  $ lscgroup cpu:1/2
  cpu:/2/
  cpu:/2/1 )
Changes since V3
    * rename the variables (dp1 -> cgroup_dir_path, dp2 -> input_dir_path)
    * improve the coding style

Examples:
    $ lscgroup
    devices:/
    devices:/sysdefault
    cpuset,cpuacct:/
    cpuset,cpuacct:/sysdefault
    cpuset,cpuacct:/daemons
    cpuset,cpuacct:/daemons/ftp

    $ lscgroup cpuset:/
    cpuset,cpuacct:/
    cpuset,cpuacct:/sysdefault
    cpuset,cpuacct:/daemons
    cpuset,cpuacct:/daemons/ftp

    $ lscgroup cpuset:/daemons
    cpuset,cpuacct:/daemons/
    cpuset,cpuacct:/daemons/ftp

Signed-off-by: Ivana Hutarova Varekova <varekova@redhat.com>
Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com>
src/tools/Makefile.am
src/tools/lscgroup.c [new file with mode: 0644]