Code

cgroups: don't fail parsing when colon not found
authorMarc Fournier <marc.fournier@camptocamp.com>
Wed, 21 Aug 2013 14:22:32 +0000 (16:22 +0200)
committerMarc Fournier <marc.fournier@camptocamp.com>
Wed, 21 Aug 2013 14:22:32 +0000 (16:22 +0200)
commit4b4eee900b167cfdf17528e70c9c0659eb0329b0
treec9be3d77aa0b1d6d2ac636459dc6cea364bc03a2
parentf6b9d3b2d95a140eaf9537cae08069b6856684b2
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
src/cgroups.c