0

i am running a stress-ng inside a docker container (alexeiled/stress-ng) and would like to run perf record which can be converted in to Flamegraphs

docker run -it --rm --privileged alexeiled/stress-ng --cpu 1 --cpu-load 100 --verify -t 5m --metrics-brief

and following perf record command as detailed under Brendan Gregg's post (https://www.brendangregg.com/perf.html#FlameGraphs)

Sample CPU stack traces for a container identified by its /sys/fs/cgroup/perf_event cgroup: perf record -F 99 -e cpu-clock --cgroup=docker/1d567f4393190204...etc... -a -- sleep 10

i have tried my command here below:

perf_5.15 record -F 99 -a --call-graph dwarf -e cpu-clock --cgroup=docker/3db7f7e270ef1397924cd6fc35885f98849f8c94f49a65f59db3c214ac8f72a4 sleep 10

But i am getting this error: no access to cgroup /sys/fs/cgroup/docker/3db7f7e270ef1397924cd6fc35885f98849f8c94f49a65f59db3c214ac8f72a4

And i could see i do not have /sys/fs/cgroup/docker directory on my system.

What i could do to use perf to profile container wide?

  • My system as below: My hardware is raspberry pi 4b debian based distro (Debian 11) Cgroups version 2 Perf 5.15

i have tried my command here below:

perf_5.15 record -F 99 -a --call-graph dwarf -e cpu-clock --cgroup=docker/3db7f7e270ef1397924cd6fc35885f98849f8c94f49a65f59db3c214ac8f72a4 sleep 10

expecting to get a proper samples in my perf.data

0 Answers0