lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3dc28d5e-46ce-fd33-82c1-4e27b60dfef0@arm.com>
Date:   Thu, 28 Jul 2022 10:25:17 +0100
From:   German Gomez <german.gomez@....com>
To:     Thomas Richter <tmricht@...ux.ibm.com>,
        linux-kernel@...r.kernel.org, linux-perf-users@...r.kernel.org,
        acme@...nel.org, james.clark@....com
Cc:     svens@...ux.ibm.com, gor@...ux.ibm.com, sumanthk@...ux.ibm.com,
        hca@...ux.ibm.com, Namhyung Kim <namhyung@...nel.org>,
        Jiri Olsa <jolsa@...nel.org>
Subject: Re: [PATCH] perf/tests: Fix test case 95 on s390 and use same event

Thanks for the fix, Thomas

On 27/07/2022 15:14, Thomas Richter wrote:
> On linux-next tree perf test 95 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

Just curious, do you know why the command succeeds in this platform (and
potentially others)?

I got the idea of using "dummy" from [1] but only tested on arm64 and
x86. I thought the platforms would reject it if -b was not implemented
regardless of the event. Did I misunderstand the use of dummy?

Thanks,
German

[1] https://lore.kernel.org/all/20220617073840.GA45710@leoy-ThinkPad-X240s/

>
> 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: b55878c90ab9 ("perf test: Add test for branch stack sampling")
> Signed-off-by: Thomas Richter <tmricht@...ux.ibm.com>
> ---
>  tools/perf/tests/shell/test_brstack.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/tests/shell/test_brstack.sh b/tools/perf/tests/shell/test_brstack.sh
> index 113ccd17bf03..c644f94a6500 100755
> --- a/tools/perf/tests/shell/test_brstack.sh
> +++ b/tools/perf/tests/shell/test_brstack.sh
> @@ -12,7 +12,7 @@ if ! [ -x "$(command -v cc)" ]; then
>  fi
>  
>  # 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)
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ