perf stat: Support old kernels for bperf cgroup counting
authorNamhyung Kim <namhyung@kernel.org>
Tue, 11 Oct 2022 05:28:08 +0000 (22:28 -0700)
committerTejun Heo <tj@kernel.org>
Tue, 11 Oct 2022 16:53:12 +0000 (06:53 -1000)
commit8248fe413216732f98563e8882b6c6ae617c327b
tree13111d3d7358a108e04f07e6490d45cc50e1802b
parent35256d673a9cf723d9e2edb5d51e1b1b6b197ba3
perf stat: Support old kernels for bperf cgroup counting

The recent change in the cgroup will break the backward compatiblity in
the BPF program.  It should support both old and new kernels using BPF
CO-RE technique.

Like the task_struct->__state handling in the offcpu analysis, we can
check the field name in the cgroup struct.

Acked-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Tejun Heo <tj@kernel.org>
tools/perf/util/bpf_skel/bperf_cgroup.bpf.c