提交 fb5962f8 编写于 作者: T Thomas Richter 提交者: Arnaldo Carvalho de Melo

perf test: Fix test case 95 ("Check branch stack sampling") on s390 and use same event

On linux-next tree 'perf test 95' ("Check branch stack sampling") was
added recently.

s390 does not support branch sampling at all and the test case fails
despite for checking branch support before hand.

The check for support of branching uses the software event named "dummy",
as seen in the line:

  perf record -b -o- -e dummy -B true > /dev/null 2>&1 || exit 2

However when the branch recording is actually done, a different event is
used, as seen in the line:

  perf record -o $TMPDIR/... --branch-filter any,save_type,u -- ...

The event is omitted and for "perf record" the default event is cycles,
which is not supported by s390 and this fails when executed on s390:

  # perf record --branch-filter any,save_type,u -- /tmp/__perf_test.program.iDSmQ/a.out
  Error:
  cycles: PMU Hardware or event type doesn't support branch stack sampling.
  #

Therefore fix this and use the same event cycles for testing support
and actually running the test.

Output before:

  # ./perf test -Fv 95
  95: Check branch stack sampling                                     :
  --- start ---
  Testing user branch stack sampling
  ---- end ----
  Check branch stack sampling: FAILED!
  #

Output after:

  # ./perf test -Fv 95
  95: Check branch stack sampling                                     :
  --- start ---
  ---- end ----
  Check branch stack sampling: Skip
  #

Fixes: b55878c9 ("perf test: Add test for branch stack sampling")
Reviewed-by: NJames Clark <james.clark@arm.com>
Signed-off-by: NThomas Richter <tmricht@linux.ibm.com>
Acked-by: NGerman Gomez <german.gomez@arm.com>
Cc: German Gomez <german.gomez@arm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Link: https://lore.kernel.org/r/20220727141439.712582-1-tmricht@linux.ibm.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 08c1d7a1
...@@ -12,7 +12,7 @@ if ! [ -x "$(command -v cc)" ]; then ...@@ -12,7 +12,7 @@ if ! [ -x "$(command -v cc)" ]; then
fi fi
# skip the test if the hardware doesn't support branch stack sampling # skip the test if the hardware doesn't support branch stack sampling
perf record -b -o- -e dummy -B true > /dev/null 2>&1 || exit 2 perf record -b -o- -B true > /dev/null 2>&1 || exit 2
TMPDIR=$(mktemp -d /tmp/__perf_test.program.XXXXX) TMPDIR=$(mktemp -d /tmp/__perf_test.program.XXXXX)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册