orbit icon indicating copy to clipboard operation
orbit copied to clipboard

Support cgroup version 2 for memory tracing

Open florian-kuebler opened this issue 3 years ago • 1 comments
trafficstars

florian-kuebler avatar Nov 17 '22 12:11 florian-kuebler

Some relevant links: https://www.kernel.org/doc/Documentation/cgroup-v2.txt https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt https://www.usenix.org/system/files/lisa21_slides_down.pdf

To get the basic information (such as pagefaults), we can do the following:

$cat /proc/%PID%/cgroup
0::/A/B/C/D 

$cat /sys/fs/cgroup/A/B/C/D/memory.stat

From there read the fields according to the spec. Note, that this will give use the info of the inner-most cgroup, which might or might not what the user expects. A detailed description is needed.

However, version 2 drops some fields, like rss, which are not yet clear how to retrieve them.

A simple first version could be to start with the pagefault track.

florian-kuebler avatar Nov 22 '22 13:11 florian-kuebler