Skip to contentSkip to conversation

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

PATCH In review Namhyung Kim 4 participants 4 messages Oct 21, 2022 – Oct 24, 2022 perf events

lore
Share & tools
lore

Namhyung Kim

author maintainer
#0 lore raw

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

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 <[email protected]>
---
 tools/perf/tests/shell/test_intel_pt.sh | 6 ++++++
 1 file changed, 6 insertions(+)
tools/perf/tests/shell/test_intel_pt.sh +6 -0
index 4c0aabbe33bd..f5ed7b1af419 100755
@@ -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}"
Signature · 1 line
2.38.0.135.g90850a2211-goog
reviewer Acked-by on v2 1/1
#1 lore raw
Quoted 2 lines · Namhyung Kim

The virtuall LBR test uses a python script to check the max size of

nit: virtual

Quoted 8 lines

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 <[email protected]>

Thanks,
Ian

Quoted 24 lines
---
 tools/perf/tests/shell/test_intel_pt.sh | 6 ++++++
 1 file changed, 6 insertions(+)
tools/perf/tests/shell/test_intel_pt.sh +6 -1
index 4c0aabbe33bd..f5ed7b1af419 100755
@@ -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}"
--

2.38.0.135.g90850a2211-goog

#2 lore raw

Em Fri, Oct 21, 2022 at 03:00:04PM -0700, Ian Rogers escreveu:

Quoted 5 lines · Namhyung Kim
Quoted 2 lines

The virtuall LBR test uses a python script to check the max size of

nit: virtual

Thanks, fixed and applied.

- Arnaldo

Quoted 38 lines
Quoted 8 lines

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 <[email protected]>

Thanks,
Ian

Quoted 24 lines
---
 tools/perf/tests/shell/test_intel_pt.sh | 6 ++++++
 1 file changed, 6 insertions(+)
tools/perf/tests/shell/test_intel_pt.sh +6 -1
index 4c0aabbe33bd..f5ed7b1af419 100755
@@ -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}"
--

2.38.0.135.g90850a2211-goog

Signature · 1 line
- Arnaldo
reviewer Reviewed-by on v2 1/1
#3 lore raw
In reply to Namhyung Kim
Quoted 9 lines · Namhyung Kim

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 <[email protected]>
Quoted 21 lines
---
 tools/perf/tests/shell/test_intel_pt.sh | 6 ++++++
 1 file changed, 6 insertions(+)
tools/perf/tests/shell/test_intel_pt.sh +6 -0
index 4c0aabbe33bd..f5ed7b1af419 100755
@@ -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}"