Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf test: Do not fail Intel-PT misc test w/o libpython

The virtual LBR test uses a python script to check the max size of
branch stack in the Intel-PT generated LBR. But it didn't check whether
python scripting is available (as it's optional).

Let's skip the test if the python support is not available.

Fixes: f77811a0f62577d2 ("perf test: test_intel_pt.sh: Add 9 tests")
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Ian Rogers <irogers@google.com>
Cc: Ammy Yi <ammy.yi@intel.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20221021181055.60183-1-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Namhyung Kim and committed by
Arnaldo Carvalho de Melo
246122a8 5a6c184a

+6
+6
tools/perf/tests/shell/test_intel_pt.sh
··· 526 526 test_virtual_lbr() 527 527 { 528 528 echo "--- Test virtual LBR ---" 529 + # Check if python script is supported 530 + libpython=$(perf version --build-options | grep python | grep -cv OFF) 531 + if [ "${libpython}" != "1" ] ; then 532 + echo "SKIP: python scripting is not supported" 533 + return 2 534 + fi 529 535 530 536 # Python script to determine the maximum size of branch stacks 531 537 cat << "_end_of_file_" > "${maxbrstack}"