linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] perf test: Skip 6.2 kernel for bpf-filter test
@ 2023-08-25 16:41 Namhyung Kim
  2023-08-25 16:41 ` [PATCH 2/3] perf test: Fix perf stat bpf counters test on Intel Namhyung Kim
  2023-08-25 16:41 ` [PATCH 3/3] perf test: Enhance perf stat cgroup BPF counter test Namhyung Kim
  0 siblings, 2 replies; 4+ messages in thread
From: Namhyung Kim @ 2023-08-25 16:41 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Jiri Olsa
  Cc: Ian Rogers, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, bpf

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: 9575ecdd198a ("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>
---
 tools/perf/tests/shell/record_bpf_filter.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/perf/tests/shell/record_bpf_filter.sh b/tools/perf/tests/shell/record_bpf_filter.sh
index e76ea861b92c..31c593966e8c 100755
--- a/tools/perf/tests/shell/record_bpf_filter.sh
+++ b/tools/perf/tests/shell/record_bpf_filter.sh
@@ -49,6 +49,12 @@ test_bpf_filter_basic() {
   fi
   if perf script -i "${perfdata}" -F ip | grep 'ffffffff[0-9a-f]*'
   then
+    if uname -r | grep -q ^6.2
+    then
+      echo "Basic bpf-filter test [Skipped unsupported kernel]"
+      err=2
+      return
+    fi
     echo "Basic bpf-filter test [Failed invalid output]"
     err=1
     return
-- 
2.42.0.rc1.204.g551eb34607-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-25 16:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-25 16:41 [PATCH 1/3] perf test: Skip 6.2 kernel for bpf-filter test Namhyung Kim
2023-08-25 16:41 ` [PATCH 2/3] perf test: Fix perf stat bpf counters test on Intel Namhyung Kim
2023-08-25 16:47   ` Song Liu
2023-08-25 16:41 ` [PATCH 3/3] perf test: Enhance perf stat cgroup BPF counter test Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).