From: Ian Rogers Date: Wed, 3 Sep 2025 18:42:47 +0000 (-0700) Subject: perf test: Add an 'import perf' test shell script X-Git-Tag: v6.18-rc1~35^2~53 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=33706fb0aa6c2f7eb869a0a9ad569e414ff11375;p=thirdparty%2Flinux.git perf test: Add an 'import perf' test shell script The 'import perf' test needs to set up a path to the python module as well as to know the python command to invoke. These are hard coded at build time to be build a directory and the python used in the build, which is less than desirable. Avoid the hard coded values by reusing the existing shell script python setup and determine a potential built python module via the path of the perf executable. Signed-off-by: Ian Rogers Tested-by: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Collin Funk Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Ravi Bangoria Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/tests/shell/python-use.sh b/tools/perf/tests/shell/python-use.sh new file mode 100755 index 000000000000..fd2ee5390060 --- /dev/null +++ b/tools/perf/tests/shell/python-use.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# 'import perf' in python +# SPDX-License-Identifier: GPL-2.0 +# Just test if we can load the python binding. +set -e + +shelldir=$(dirname "$0") +# shellcheck source=lib/setup_python.sh +. "${shelldir}"/lib/setup_python.sh + +MODULE_DIR=$(dirname "$(which perf)")/python + +if [ -d "$MODULE_DIR" ] +then + CMD=$(cat <