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-next>] [day] [month] [year] [list]
Message-ID: <20250610144507.2839326-1-tmricht@linux.ibm.com>
Date: Tue, 10 Jun 2025 16:45:07 +0200
From: Thomas Richter <tmricht@...ux.ibm.com>
To: linux-kernel@...r.kernel.org, linux-s390@...r.kernel.org,
        linux-perf-users@...r.kernel.org, acme@...nel.org, namhyung@...nel.org,
        ctshao@...gle.com
Cc: agordeev@...ux.ibm.com, gor@...ux.ibm.com, sumanthk@...ux.ibm.com,
        hca@...ux.ibm.com, japo@...ux.ibm.com,
        Thomas Richter <tmricht@...ux.ibm.com>
Subject: [PATCH] perf test: Skip stat uniquifying test if unavailable

Commit cb422594d6206 ("perf test: Add stat uniquifying test")
introduced a new test case which uses an event named clockticks
which is exported as sysfs file .../uncore_imc_0/clockticks.
This file does not exist on s390 and causes the test case to
always fail.

Check for the existence of file clockticks and skip this
test if the event does not exist.

Output before:
 #  perf test 87
 87: perf stat events uniquifying       : FAILED!
 # ./perf stat -e clockticks -A
   event syntax error: 'clockticks'
                        \___ Bad event name
   ...
 #

Output after:
 #  perf test 87
 87: perf stat events uniquifying       : Skip
 #

Fixes: cb422594d6206 ("perf test: Add stat uniquifying test")
Signed-off-by: Thomas Richter <tmricht@...ux.ibm.com>
Acked-by: Sumanth Korikkar <sumanthk@...ux.ibm.com>
Cc: Chun-Tse Shao <ctshao@...gle.com>
---
 tools/perf/tests/shell/stat+event_uniquifying.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/perf/tests/shell/stat+event_uniquifying.sh b/tools/perf/tests/shell/stat+event_uniquifying.sh
index 5ec35c52b7d9..485ee6e8f574 100755
--- a/tools/perf/tests/shell/stat+event_uniquifying.sh
+++ b/tools/perf/tests/shell/stat+event_uniquifying.sh
@@ -49,6 +49,11 @@ test_event_uniquifying() {
     uniquified_event_array+=("${uniquified_event}")
   done < <(${perf_tool} list -v ${event} | grep "\[Kernel PMU event\]")
 
+  if [ -z "$uniquified_event" ]
+  then
+    err=2
+    return
+  fi
   perf_command="${perf_tool} stat -e $event -A -o ${stat_output} -- true"
   $perf_command
 
-- 
2.49.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ