Skip to contentSkip to conversation

perf test: Fix test case perf script tests on s390

PATCH Superseded Thomas Richter 2 participants 2 messages Jan 15, 2024 – Jan 19, 2024 perf events

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf test: Fix test case perf script tests on s390

In linux next repo, test case 'perf script tests' fails on s390. The root case is a command line invocation of perf record with call-graph information. On s390 only dwarf formatted call-graphs are supported and only on software events.

Change the command line parameters fors s390.

Output before:

 # perf test 89
 89: perf script tests              : FAILED!
 #

Output after:

 # perf test 89
 89: perf script tests              : Ok
 #
Fixes 0dd5041c9a0e ("perf addr_location: Add init/exit/copy functions")
Cc Ian Rogers <[email protected]>
---
 tools/perf/tests/shell/script.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
tools/perf/tests/shell/script.sh +8 -1
index 5ae7bd0031a8..a6a09ef16e06 100755
@@ -54,7 +54,14 @@ def sample_table(*args):
 def call_path_table(*args):
     print(f'call_path_table({args}')
 _end_of_file_
-	perf record -g -o "${perfdatafile}" true
+	case $(uname -m)
+	in s390x)
+		cmd_flags="--call-graph dwarf -e cpu-clock"
+	;; *)
+		cmd_flags="-g"
+	esac
+
+	perf record $cmd_flags -o "${perfdatafile}" true
 	perf script -i "${perfdatafile}" -s "${db_test}"
 	echo "DB test [Success]"
 }
Signature · 1 line
2.43.0
#1 lore raw

Hello,

Quoted 30 lines · Thomas Richter

In linux next repo, test case 'perf script tests' fails on s390. The root case is a command line invocation of perf record with call-graph information. On s390 only dwarf formatted call-graphs are supported and only on software events.

Change the command line parameters fors s390.

Output before:

 # perf test 89
 89: perf script tests              : FAILED!
 #

Output after:

 # perf test 89
 89: perf script tests              : Ok
 #
Fixes 0dd5041c9a0e ("perf addr_location: Add init/exit/copy functions")
Cc Ian Rogers <[email protected]>
---
 tools/perf/tests/shell/script.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
tools/perf/tests/shell/script.sh +0 -0
index 5ae7bd0031a8..a6a09ef16e06 100755

tools/perf/tests/shell/script.sh def sample_table(*args): · line 62

Quoted 10 lines
tools/perf/tests/shell/script.sh +6 -1
@@ -54,7 +54,14 @@ def sample_table(*args):
 def call_path_table(*args):
     print(f'call_path_table({args}')
 _end_of_file_
-       perf record -g -o "${perfdatafile}" true
+       case $(uname -m)
+       in s390x)
+               cmd_flags="--call-graph dwarf -e cpu-clock"
+       ;; *)
+               cmd_flags="-g"
+       esac

I think this is unusual. Maybe something like this?

    case $(uname -m) in
    s390x)
        cmd_flags="...";;
    *)
        cmd_flags="...";;
    esac

Thanks,
Namhyung

Quoted 9 lines
tools/perf/tests/shell/script.sh +2 -1
+
+       perf record $cmd_flags -o "${perfdatafile}" true
        perf script -i "${perfdatafile}" -s "${db_test}"
        echo "DB test [Success]"
 }
--

2.43.0