lkml.org 
[lkml]   [2022]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] perf test: Do not fail Intel-PT misc test w/o libpython
From
On 20/10/22 22:29, Namhyung Kim wrote:
> The virtuall 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: f77811a0f625 ("perf test: test_intel_pt.sh: Add 9 tests")
> Cc: Ammy Yi <ammy.yi@intel.com>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
> tools/perf/tests/shell/test_intel_pt.sh | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/tools/perf/tests/shell/test_intel_pt.sh b/tools/perf/tests/shell/test_intel_pt.sh
> index 4c0aabbe33bd..e66b7d977462 100755
> --- a/tools/perf/tests/shell/test_intel_pt.sh
> +++ b/tools/perf/tests/shell/test_intel_pt.sh
> @@ -526,6 +526,12 @@ test_kernel_trace()
> test_virtual_lbr()
> {
> echo "--- Test virtual LBR ---"
> + # Check if python script is supported
> + libpython=$(ldd $(which perf) | grep -c python)

'which' might not be installed. Don't about 'ldd'.

Maybe 'perf version --build-options' can be used instead e.g.

$ perf version --build-options | grep -i libpython | grep -vi off
libpython: [ on ] # HAVE_LIBPYTHON_SUPPORT

> + 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}"

\
 
 \ /
  Last update: 2022-10-21 07:23    [W:0.037 / U:0.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site