]> git.baikalelectronics.ru Git - kernel.git/commitdiff
perf test: Do not fail Intel-PT misc test w/o libpython
authorNamhyung Kim <namhyung@kernel.org>
Fri, 21 Oct 2022 18:10:55 +0000 (11:10 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 25 Oct 2022 20:40:48 +0000 (17:40 -0300)
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: ccf05c960e8a1e04 ("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>
tools/perf/tests/shell/test_intel_pt.sh

index 4c0aabbe33bdfaf05df66747a7091edc5ddb7651..f5ed7b1af419cdd4a9f94b06b84aa386cb981126 100755 (executable)
@@ -526,6 +526,12 @@ test_kernel_trace()
 test_virtual_lbr()
 {
        echo "--- Test virtual LBR ---"
+       # Check if python script is supported
+       libpython=$(perf version --build-options | grep python | grep -cv OFF)
+       if [ "${libpython}" != "1" ] ; then
+               echo "SKIP: python scripting is not supported"
+               return 2
+       fi
 
        # Python script to determine the maximum size of branch stacks
        cat << "_end_of_file_" > "${maxbrstack}"