diff options
author | Namhyung Kim <namhyung@kernel.org> | 2022-06-25 02:13:08 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-06-28 17:41:26 +0300 |
commit | d6838ec44b4513280a3f43fcc402e246d543fb53 (patch) | |
tree | cb12e505d57794c6937ffdd3ef28524e2e614e8c /tools/debugging | |
parent | 941e3e7912696b9fbe3586083a7c2e102cee7a87 (diff) | |
download | linux-d6838ec44b4513280a3f43fcc402e246d543fb53.tar.xz |
perf offcpu: Fix build failure on old kernels
Old kernels have a 'struct task_struct' which contains a "state" field
and newer kernels have "__state" instead.
While the get_task_state() in the BPF code handles that in some way, it
assumed the current kernel has the new definition and it caused a build
error on old kernels.
We should not assume anything and access them carefully. Do not use
'task struct' directly access it instead using new and old definitions
in a row.
Fixes: edc41a1099c2d08c ("perf record: Enable off-cpu analysis with BPF")
Reported-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Blake Jones <blakejones@google.com>
Cc: Hao Luo <haoluo@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: bpf@vger.kernel.org
Link: http://lore.kernel.org/lkml/20220624231313.367909-2-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/debugging')
0 files changed, 0 insertions, 0 deletions