Skip to content

Commit 7be1a7b

Browse files
captain5050gregkh
authored andcommitted
perf test trace_btf_enum: Skip if permissions are insufficient
[ Upstream commit 4bd5bd8 ] Modify test behavior to skip if BPF calls fail with "Operation not permitted". Fixes: d66763f ("perf test trace_btf_enum: Add regression test for the BTF augmentation of enums in 'perf trace'") Reviewed-by: James Clark <james.clark@linaro.org> Signed-off-by: Ian Rogers <irogers@google.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Athira Rajeev <atrajeev@linux.ibm.com> Cc: Blake Jones <blakejones@google.com> Cc: Chun-Tse Shao <ctshao@google.com> Cc: Collin Funk <collin.funk1@gmail.com> Cc: Howard Chu <howardchu95@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jan Polensky <japo@linux.ibm.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Li Huafei <lihuafei1@huawei.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Nam Cao <namcao@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Steinar H. Gunderson <sesse@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20250821163820.1132977-3-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 2692752 commit 7be1a7b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tools/perf/tests/shell/trace_btf_enum.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ check_vmlinux() {
2323
fi
2424
}
2525

26+
check_permissions() {
27+
if perf trace -e $syscall $TESTPROG 2>&1 | grep -q "Operation not permitted"
28+
then
29+
echo "trace+enum test [Skipped permissions]"
30+
err=2
31+
fi
32+
}
33+
2634
trace_landlock() {
2735
echo "Tracing syscall ${syscall}"
2836

@@ -54,6 +62,9 @@ trace_non_syscall() {
5462
}
5563

5664
check_vmlinux
65+
if [ $err = 0 ]; then
66+
check_permissions
67+
fi
5768

5869
if [ $err = 0 ]; then
5970
trace_landlock

0 commit comments

Comments
 (0)