Bug 600404 - RFE: add command to list groups and show attributes of group
RFE: add command to list groups and show attributes of group
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libcgroup (Show other bugs)
6.0
All Linux
low Severity medium
: rc
: ---
Assigned To: Ivana Varekova
Red Hat Kernel QE team
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-04 12:12 EDT by Kirby Zhou
Modified: 2010-06-07 04:04 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-06-07 03:54:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kirby Zhou 2010-06-04 12:12:50 EDT
RFE: add command to list groups and show attributes of group

We can use cgcreate to create group, cgset to modify group, but no commands can tell us the list of alredy created groups nor the attributes of a group. So we have to check the /cgroup directory manually.

So, commands like 'cggrps', 'cgshow' is suggested.

cggrps list the cgroup of specified controller. for example:
]# cggrps -g cpu:/test
cpu:/test/
cpu:/test/a
...
]# cglist
cpu:/
cpu:/test/
cpu:/test/a
cpuacct:/
...

cggrps can also tell us which groups a pid stay in.
]# cppgrps -p 12131
cpu:/test/a
cpuacct:/
...
]# cppgrps -p 12131 -g cpu
/test/a

cgshow show us the attributes of a group. for example:
]# cgshow cpu:/test
cpu.rt_runtime_us=950000
...
Comment 2 Jan Safranek 2010-06-07 03:33:10 EDT
There already are some tools to satisfy your needs:

(In reply to comment #0)
> cggrps list the cgroup of specified controller. for example:
> ]# cggrps -g cpu:/test
> cpu:/test/
> cpu:/test/a

Use lscgroup

> cggrps can also tell us which groups a pid stay in.
> ]# cppgrps -p 12131

This is not yet implemented in any libcgroup tool... use cat /proc/12131/cgroup

> cgshow show us the attributes of a group. for example:
> ]# cgshow cpu:/test
> cpu.rt_runtime_us=950000

use cgget -g cpu /test
Comment 3 Kirby Zhou 2010-06-07 03:48:25 EDT
there is no lscgroup nor cgget in libcgroup-0.34-4.el6.x86_64
Comment 4 Kirby Zhou 2010-06-07 03:49:26 EDT
Additionally, please add ' blkio   = /cgroup/blkio;' into  /etc/cgconfig.conf.
Comment 5 Kirby Zhou 2010-06-07 03:51:48 EDT
And, add support of 'include /etc/cgconfig.d/*.conf' to /etc/cgconfig.conf, and add 'include /etc/cgrules.d/*.conf' to /etc/cgrules.conf
Comment 6 Jan Safranek 2010-06-07 03:54:48 EDT
Ahh, I see, the public beta has older libcgroup. Don't worry, libcgroup-0.36 is scheduled to RHEL 6.0. Which includes also blkio in default config.
Comment 7 Kirby Zhou 2010-06-07 04:04:53 EDT
Thanks,
Is therer a new public beta-2 scheduled?

Note You need to log in before you can comment on or make changes to this bug.