From b4f48f34f9c195e8e82b31ecd8202445962c734b Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Thu, 14 Sep 2023 14:19:48 -0700 Subject: [PATCH] perf test: Detect off-cpu support from build options Use perf version to detect whether BPF skeletons were enabled in a build rather than a failing perf record. Signed-off-by: Ian Rogers Tested-by: Namhyung Kim Cc: James Clark Cc: Mark Rutland Cc: Nick Terrell Cc: Patrice Duroux Cc: Nick Desaulniers Cc: Andrii Nakryiko Cc: Nathan Chancellor Cc: Kajol Jain Cc: Athira Rajeev Cc: Tiezhu Yang Cc: Tom Rix Cc: llvm@lists.linux.dev Cc: bpf@vger.kernel.org Link: https://lore.kernel.org/r/20230914211948.814999-6-irogers@google.com Signed-off-by: Namhyung Kim --- tools/perf/tests/shell/record_offcpu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/tests/shell/record_offcpu.sh b/tools/perf/tests/shell/record_offcpu.sh index a0d14cd0aa798..a1ef8f0d2b5cc 100755 --- a/tools/perf/tests/shell/record_offcpu.sh +++ b/tools/perf/tests/shell/record_offcpu.sh @@ -28,7 +28,7 @@ test_offcpu_priv() { err=2 return fi - if perf record --off-cpu -o /dev/null --quiet true 2>&1 | grep BUILD_BPF_SKEL + if perf version --build-options 2>&1 | grep HAVE_BPF_SKEL | grep -q OFF then echo "off-cpu test [Skipped missing BPF support]" err=2