linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] perf test: Fix test case perf script tests on s390
@ 2024-01-22  9:59 Thomas Richter
  2024-01-23 17:42 ` Ian Rogers
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Richter @ 2024-01-22  9:59 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users, acme, namhyung
  Cc: svens, gor, sumanthk, hca, 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")
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Cc: Ian Rogers <irogers@google.com>
---
 tools/perf/tests/shell/script.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tools/perf/tests/shell/script.sh b/tools/perf/tests/shell/script.sh
index 5ae7bd0031a8..2973adab445d 100755
--- a/tools/perf/tests/shell/script.sh
+++ b/tools/perf/tests/shell/script.sh
@@ -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]"
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] perf test: Fix test case perf script tests on s390
  2024-01-22  9:59 [PATCH v2] perf test: Fix test case perf script tests on s390 Thomas Richter
@ 2024-01-23 17:42 ` Ian Rogers
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Rogers @ 2024-01-23 17:42 UTC (permalink / raw)
  To: Thomas Richter
  Cc: linux-kernel, linux-perf-users, acme, namhyung, svens, gor,
	sumanthk, hca

On Mon, Jan 22, 2024 at 2:00 AM Thomas Richter <tmricht@linux.ibm.com> wrote:
>
> 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")
> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
> Cc: Ian Rogers <irogers@google.com>

Thanks Thomas!
Reviewed-by: Ian Rogers <irogers@google.com>

> ---
>  tools/perf/tests/shell/script.sh | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/tests/shell/script.sh b/tools/perf/tests/shell/script.sh
> index 5ae7bd0031a8..2973adab445d 100755
> --- a/tools/perf/tests/shell/script.sh
> +++ b/tools/perf/tests/shell/script.sh
> @@ -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]"
>  }
> --
> 2.43.0
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-23 17:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-22  9:59 [PATCH v2] perf test: Fix test case perf script tests on s390 Thomas Richter
2024-01-23 17:42 ` Ian Rogers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).