Skip to content

Commit 11f5710

Browse files
namhyungacmel
authored andcommitted
perf test shell record_bpf_filter: Skip 6.2 kernel
The BPF sample filtering requires two kernel changes below: * bpf_cast_to_kernel_ctx() kfunc (added in v6.2) * setting perf_sample_data->sample_flags (finished in v6.3) The perf tools can check bpf_cast_to_kernel_ctx() easily so it can refuse BPF filters on those old kernels (v6.1 and earlier). But checking sample_flags appears to be difficult so current code won't work on v6.2 kernel. That's unfortunate but I don't know what's the correct way to handle it. For now, let's skip v6.2 kernels explicitly (if failed) in the test. Fixes: 9575ecd ("perf test: Add perf record sample filtering test") Reported-by: Arnaldo Carvalho de Melo <acme@kernel.org> Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230825164152.165610-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent c091c78 commit 11f5710

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/perf/tests/shell/record_bpf_filter.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ test_bpf_filter_basic() {
4949
fi
5050
if perf script -i "${perfdata}" -F ip | grep 'ffffffff[0-9a-f]*'
5151
then
52+
if uname -r | grep -q ^6.2
53+
then
54+
echo "Basic bpf-filter test [Skipped unsupported kernel]"
55+
err=2
56+
return
57+
fi
5258
echo "Basic bpf-filter test [Failed invalid output]"
5359
err=1
5460
return

0 commit comments

Comments
 (0)