Discussion:
procfs cgroups string problem
Guy Streeter
2015-09-17 22:07:11 UTC
Permalink
The cgroups string returned is built by joining the entries in
/proc/PID/cgroup by a comma. Unfortunately, cgroup controller names can
contain commas. This make parsing out the cgroups problematic.

$ cat /proc/self/cgroup
10:hugetlb:/
9:perf_event:/
8:net_cls,net_prio:/
7:freezer:/
6:devices:/user.slice
5:memory:/
4:blkio:/
3:cpu,cpuacct:/
2:cpuset:/
1:name=systemd:/user.slice/user-5160.slice/session-1.scope


It looks like anything that is a valid filename can be a controller name.
It might be better to return a tuple of entries.

- --Guy

Loading...