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: <86abd4dd-a92b-f69b-64e0-7f985506f717@huawei.com>
Date:   Tue, 19 Jan 2021 11:04:38 +0000
From:   John Garry <john.garry@...wei.com>
To:     Joakim Zhang <qiangqing.zhang@....com>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "acme@...nel.org" <acme@...nel.org>,
        "mark.rutland@....com" <mark.rutland@....com>,
        "alexander.shishkin@...ux.intel.com" 
        <alexander.shishkin@...ux.intel.com>,
        "jolsa@...hat.com" <jolsa@...hat.com>,
        "namhyung@...nel.org" <namhyung@...nel.org>,
        "irogers@...gle.com" <irogers@...gle.com>,
        "kjain@...ux.ibm.com" <kjain@...ux.ibm.com>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linuxarm@...neuler.org" <linuxarm@...neuler.org>
Subject: Re: [PATCH] perf metricgroup: Fix system PMU metrics

On 19/01/2021 10:56, Joakim Zhang wrote:
>> Joakim reports that getting "perf stat" for multiple system PMU metrics
>> segfaults:
>> ./perf stat -a -I 1000 -M imx8mm_ddr_write.all,imx8mm_ddr_write.all
>> Segmentation fault
>>
>> While the same works without issue for a single metric.
>>
>> The logic in metricgroup__add_metric_sys_event_iter() is broken, in that
>> add_metric() @m argument should be NULL for each new metric. Fix by not
>> passing a holder for that, and rather make local in
>> metricgroup__add_metric_sys_event_iter().
>>
>> Fixes: be335ec28efa ("perf metricgroup: Support adding metrics for system
>> PMUs")
>> Reported-by: Joakim Zhang<qiangqing.zhang@....com>
>> Signed-off-by: John Garry<john.garry@...wei.com>
> root@...8mmevk:~# ./perf stat -a -I 1000 -M imx8mm_ddr_read.all,imx8mm_ddr_write                                                                                                    .all
> #           time             counts unit events
>       1.001446500              40832      imx8mm_ddr.read_cycles    #    638.0 KB  imx8mm_ddr_read.all
>       1.001446500              16973      imx8mm_ddr.write_cycles   #    265.2 KB  imx8mm_ddr_write.all
>       2.003150250              28836      imx8mm_ddr.read_cycles    #    450.6 KB  imx8mm_ddr_read.all
>       2.003150250               6705      imx8mm_ddr.write_cycles   #    104.8 KB  imx8mm_ddr_write.all
> 
> For this issue, Tested-by: Joakim Zhang<qiangqing.zhang@....com>
> 
> Hi John,
> 
> It seems have other issue compared to 5.10 kernel after switching to this framework, below metric can't work.
> "MetricExpr": "(( imx8_ddr0@...d\\-cycles@ + imx8_ddr0@...te\\-cycles@ ) * 4 * 4 / duration_time) / (750 * 1000000 * 4 * 4)"
> After change to:
> "MetricExpr": "(( imx8mm_ddr.read_cycles + imx8mm_ddr.write_cycles ) * 4 * 4 / duration_time) / (750 * 1000000 * 4 * 4)",

Hmmm... not sure what you mean by "compared to 5.10 kernel". As far as 
I'm concerned, none of this was supported in 5.10 and metrics did not 
work for arm64. Support for sys PMU events+metrics only came in 5.11-rc.

Anyway, can you share the full metric event which you say does not work, 
not just the "MetricExpr"?

Thanks,
John

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ