[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0f55cde3-cba0-4e43-b2ac-1f1b506f4e15@linux.ibm.com>
Date: Wed, 7 Jan 2026 14:01:06 +0100
From: Thomas Richter <tmricht@...ux.ibm.com>
To: James Clark <james.clark@...aro.org>
Cc: agordeev@...ux.ibm.com, gor@...ux.ibm.com, sumanthk@...ux.ibm.com,
hca@...ux.ibm.com, japo@...ux.ibm.com, linux-kernel@...r.kernel.org,
linux-s390@...r.kernel.org, linux-perf-users@...r.kernel.org,
acme@...nel.org, namhyung@...nel.org, irogers@...gle.com
Subject: Re: [PATCH] perf test: Fix test perf stat tests for virtualized
machines
On 1/7/26 12:18, James Clark wrote:
>
>
> On 07/01/2026 9:48 am, Thomas Richter wrote:
>> On s390 perf test 'perf stat tests', subtest test_hybrid fails
>> for z/VM systems.
>> The root cause is this statement:
>>
>> $(perf stat -a -- sleep 0.1 2>&1 |\
>> grep -E "/cpu-cycles/[uH]*| cpu-cycles[:uH]* -c)
>>
>> The perf stat output on a s390 z/VM system is
>>
>> # perf stat -a -- sleep 0.1 2>&1
>> Performance counter stats for 'system wide':
>>
>> 56 context-switches # 46.3 cs/sec cs_per_second
>> 1,210.41 msec cpu-clock # 11.9 CPUs CPUs_utilized
>> 12 cpu-migrations # 9.9 migrations/sec ...
>> 81 page-faults # 66.9 faults/sec ...
>>
>> 0.100891009 seconds time elapsed
>>
>> The grep command does not match any single line and exits with error
>> code 1. As the bash script is executed with set -e, it aborts with the
>> first error code being non-zero.
>>
>> Fix this and use wc -l to count matching lines instead of grep ... -c.
>>
>> Output before:
>> # perf test 102
>> 102: perf stat tests : FAILED!
>> #
>> Output after:
>> # perf test 102
>> 102: perf stat tests : Ok
>> #
>>
>> Fixes: 65d11821910bd ("perf test: Add a test for default perf stat command")
>
> I think the change looks ok, but doesn't it fix 65d11821910bd ("perf tools: Add fallback for exclude_guest") where the existing wc -l was changed to grep -c?
>
You are correct, James.
I will send V2 with updated Fixes tag.
Thanks
--
Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany
--
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Wolfgang Wendt
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294
Powered by blists - more mailing lists