author | Marc Fournier <marc.fournier@camptocamp.com> | |
Wed, 21 Aug 2013 14:22:32 +0000 (16:22 +0200) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Wed, 21 Aug 2013 14:22:32 +0000 (16:22 +0200) | ||
commit | 4b4eee900b167cfdf17528e70c9c0659eb0329b0 | |
tree | c9be3d77aa0b1d6d2ac636459dc6cea364bc03a2 | tree | snapshot |
parent | f6b9d3b2d95a140eaf9537cae08069b6856684b2 | commit | diff |
cgroups: don't fail parsing when colon not found
The format of cpuacct.stat seems to not always have a colon as separator.
It appears to *not* have the colon at least on debian's kernel 3.2.41 and
3.2.35, as well as on RHEL6 with 2.6.32. All of them have decent support for
cgroups/lxc, and the cgroups plugin fails to work with them without this patch.
Also, looking at other implementations shows that they *don't* expect a colon:
https://bitbucket.org/dotcloud/liblxcstats/src/2558b4fbbf589c609895b0badbfc7d413466d716/probes/cpuacct.c?at=default#cl-71
https://github.com/BrightcoveOS/Diamond/blob/master/src/collectors/cpuacct_cgroup/cpuacct_cgroup.py#L55
The format of cpuacct.stat seems to not always have a colon as separator.
It appears to *not* have the colon at least on debian's kernel 3.2.41 and
3.2.35, as well as on RHEL6 with 2.6.32. All of them have decent support for
cgroups/lxc, and the cgroups plugin fails to work with them without this patch.
Also, looking at other implementations shows that they *don't* expect a colon:
https://bitbucket.org/dotcloud/liblxcstats/src/2558b4fbbf589c609895b0badbfc7d413466d716/probes/cpuacct.c?at=default#cl-71
https://github.com/BrightcoveOS/Diamond/blob/master/src/collectors/cpuacct_cgroup/cpuacct_cgroup.py#L55
src/cgroups.c | diff | blob | history |