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] [day] [month] [year] [list]
Message-ID: <6308de05-c5dd-44f3-949e-56e54f7be812@linaro.org>
Date: Thu, 30 Jan 2025 15:05:43 +0000
From: James Clark <james.clark@...aro.org>
To: Thomas Richter <tmricht@...ux.ibm.com>
Cc: agordeev@...ux.ibm.com, gor@...ux.ibm.com, sumanthk@...ux.ibm.com,
 hca@...ux.ibm.com, linux-kernel@...r.kernel.org,
 linux-perf-users@...r.kernel.org, acme@...nel.org, namhyung@...nel.org
Subject: Re: [PATCH 1/2] perf test: Fix perf test 114 perf record test subtest
 precise_max



On 30/01/2025 11:57 am, Thomas Richter wrote:
> On s390 the event instructions can not be used for recording.
> This event is only supported by perf stat.
> 
> Test that each event cycles and instructions supports sampling.
> If the event can not be sampled, skip it.
> 
> Signed-off-by: Thomas Richter <tmricht@...ux.ibm.com>
> Suggested-by: James Clark <james.clark@...aro.org>
> ---
>   tools/perf/tests/shell/record.sh | 43 +++++++++++++++++++++-----------
>   1 file changed, 29 insertions(+), 14 deletions(-)
> 
> diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh
> index 0fc7a909ae9b..b905acde8358 100755
> --- a/tools/perf/tests/shell/record.sh
> +++ b/tools/perf/tests/shell/record.sh
> @@ -273,27 +273,42 @@ test_topdown_leader_sampling() {
>   }
>   
>   test_precise_max() {
> +  local -i skipped=0
> +
>     echo "precise_max attribute test"
> -  if ! perf stat -e "cycles,instructions" true 2> /dev/null
> +  # Just to make sure event cycles is supported for sampling
> +  if perf record -o "${perfdata}" -e "cycles:P" true 2> /dev/null

This needs to check -e cycles, not cycles:P. Otherwise the test doesn't 
do anything anymore, because it only tests that cycles:P opens anyway.

So now in failure conditions where it can't be opened the test skips 
instead of fails.

With that change:

Reviewed-by: James Clark <james.clark@...aro.org>

>     then
> -    echo "precise_max attribute [Skipped no hardware events]"
> -    return
> +    if ! perf record -o "${perfdata}" -e "cycles:P" true 2> /dev/null
> +    then
> +      echo "precise_max attribute [Failed cycles:P event]"
> +      err=1
> +      return
> +    fi
> +  else
> +    echo "precise_max attribute [Skipped no cycles:P event]"
> +    ((skipped+=1))


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ