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: <b9a1f3fd-de17-492b-91c3-950131912f71@linaro.org>
Date: Fri, 30 Aug 2024 09:45:11 +0100
From: James Clark <james.clark@...aro.org>
To: Namhyung Kim <namhyung@...nel.org>
Cc: irogers@...gle.com, linux-perf-users@...r.kernel.org,
 kan.liang@...ux.intel.com, ak@...ux.intel.com,
 John Garry <john.g.garry@...cle.com>, Will Deacon <will@...nel.org>,
 Mike Leach <mike.leach@...aro.org>, Leo Yan <leo.yan@...ux.dev>,
 Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
 Arnaldo Carvalho de Melo <acme@...nel.org>,
 Mark Rutland <mark.rutland@....com>,
 Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
 Jiri Olsa <jolsa@...nel.org>, Adrian Hunter <adrian.hunter@...el.com>,
 Weilin Wang <weilin.wang@...el.com>,
 Dominique Martinet <asmadeus@...ewreck.org>,
 Athira Rajeev <atrajeev@...ux.vnet.ibm.com>,
 Colin Ian King <colin.i.king@...il.com>,
 Yang Jihong <yangjihong@...edance.com>, Ze Gao <zegao2021@...il.com>,
 Sun Haiyong <sunhaiyong@...ngson.cn>, Jing Zhang
 <renyu.zj@...ux.alibaba.com>, Yicong Yang <yangyicong@...ilicon.com>,
 linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 7/7] perf test: Add a test for default perf stat
 command



On 30/08/2024 9:29 am, James Clark wrote:
> 
> 
> On 30/08/2024 7:32 am, Namhyung Kim wrote:
>> Hello,
>>
>> On Wed, Aug 28, 2024 at 03:07:21PM +0100, James Clark wrote:
>>> Test that one cycles event is opened for each core PMU when "perf stat"
>>> is run without arguments.
>>>
>>> The event line can either be output as "pmu/cycles/" or just "cycles" if
>>> there is only one PMU. Include 2 spaces for padding in the one PMU case
>>> to avoid matching when the word cycles is included in metric
>>> descriptions.
>>>
>>> Signed-off-by: James Clark <james.clark@...aro.org>
>>> ---
>>>   tools/perf/tests/shell/stat.sh | 21 +++++++++++++++++++++
>>>   1 file changed, 21 insertions(+)
>>>
>>> diff --git a/tools/perf/tests/shell/stat.sh 
>>> b/tools/perf/tests/shell/stat.sh
>>> index 525d0c44fdc6..24ace1de71cc 100755
>>> --- a/tools/perf/tests/shell/stat.sh
>>> +++ b/tools/perf/tests/shell/stat.sh
>>> @@ -148,6 +148,26 @@ test_cputype() {
>>>     echo "cputype test [Success]"
>>>   }
>>> +test_hybrid() {
>>> +  # Test the default stat command on hybrid devices opens one cycles 
>>> event for
>>> +  # each CPU type.
>>> +  echo "hybrid test"
>>> +
>>> +  # Count the number of core PMUs
>>> +  pmus=$(ls /sys/bus/event_source/devices/*/cpus 2>/dev/null | wc -l)
>>
>> Is it working on non-hybrid systems?  I don't think they have cpus file
>> in the core PMU.
>>
>> Thanks,
>> Namhyung
>>
> 
> Good point I only tested on Arm non-hybrid. I can change it to assume 1 
> PMU for no cpus files?

Or maybe assume 1 if a /sys/bus/event_source/devices/cpu folder exists? 
Not sure which is best but either will work.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ