From: John Garry <john.garry@huawei.com>
To: Joakim Zhang <qiangqing.zhang@nxp.com>
Cc: "mark.rutland@arm.com" <mark.rutland@arm.com>,
Zhangshaokun <zhangshaokun@hisilicon.com>,
Jiri Olsa <jolsa@redhat.com>, Frank Li <frank.li@nxp.com>,
Linuxarm <linuxarm@huawei.com>,
"acme@kernel.org" <acme@kernel.org>,
"linux-perf-users@vger.kernel.org"
<linux-perf-users@vger.kernel.org>,
dl-linux-imx <linux-imx@nxp.com>,
"will@kernel.org" <will@kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 0/6] perf/imx_ddr: Add namespace for i.MX8 DDR Perf
Date: Wed, 8 Apr 2020 11:25:59 +0100 [thread overview]
Message-ID: <ca2db002-975a-ffe0-2dfc-c85f4e6205bb@huawei.com> (raw)
In-Reply-To: <VI1PR04MB68000808CEE4BC23403C35A0E6C00@VI1PR04MB6800.eurprd04.prod.outlook.com>
On 08/04/2020 06:04, Joakim Zhang wrote:
>> . Can you add this, regenerate,
>> and retry:
>>
>> diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
>> index 675aec9881ce..16dcf00c792a 100644
>> --- a/tools/perf/pmu-events/jevents.c
>> +++ b/tools/perf/pmu-events/jevents.c
>> @@ -258,6 +258,7 @@ static struct map {
>> { "hisi_sccl,l3c", "hisi_sccl,l3c" },
>> /* it's not realistic to keep adding these, we need something more
>> scalable ... */
>> { "smmuv3_pmcg", "smmuv3_pmcg" },
>> + { "imx8_ddr", "imx8_ddr" },
>> { "L3PMC", "amd_l3" },
>> {}
> Yes, events can work after adding this code, however, metrics still can't work, it seems that metricgroup fails to parse the metric expression. You may change something from metricgroup.c causing this issue.
That code should be effectively the same.
What does perf list show for the metrics now?
>
>>> root@imx8mmevk:~# ./perf stat -a -I 1000 -M imx8mm_ddr0_read.all event
Can you run with -v option and share the result?
>>> syntax error: ''
>>> \___ parser error
>>>
>>> Usage: perf stat [<options>] [<command>]
>>>
>>> -M, --metrics <metric/metric group list>
>>> monitor specified metrics or metric groups
>>> (separated by ,)
>>>
>>> However, it can work on branch:
>> private-topic-perf-5.6-pmu-events-upstream-v2. What changes have you made
>> compared to last?
>>> Could you help do below change? Since some Socs may have two ddr
>> controller(ddr0/ddr1) with the same event code.
>>
>> The perf tool can handle that. So just run perf with -v option, and it will show
>> event count breakdown per PMU, like this:
>>
>> root@ubuntu:/# ./perf stat -v -e smmuv3_pmcg.l1_tlb sleep 1 Using CPUID
>> 0x00000000480fd010 Using SYSID HIP08
>> -> smmuv3_pmcg_200100020/event=0x8a/
>> -> smmuv3_pmcg_200140020/event=0x8a/
>> -> smmuv3_pmcg_100020/event=0x8a/
>> -> smmuv3_pmcg_140020/event=0x8a/
>> -> smmuv3_pmcg_200148020/event=0x8a/
>> -> smmuv3_pmcg_148020/event=0x8a/
>> smmuv3_pmcg.l1_tlb: 0 1001221690 1001221690
>> smmuv3_pmcg.l1_tlb: 0 1001220090 1001220090
>> smmuv3_pmcg.l1_tlb: 101 1001219660 1001219660
>> smmuv3_pmcg.l1_tlb: 0 1001219010 1001219010
>> smmuv3_pmcg.l1_tlb: 0 1001218360 1001218360
>> smmuv3_pmcg.l1_tlb: 134 1001217850 1001217850
>>
>> Here smmuv3_pmcg_200100020, smmuv3_pmcg_200140020, etc are all
>> instances of the same PMU, like your DDRC.
>>
>> And if you want to run just for a single PMU, try like:
>>
>> ./perf stat -e smmuv3_pmcg_200148020/smmuv3_pmcg.l1_tlb/
> Thank you for your hint, it is really useful.
>
> Then please help update the ddrc.json and metric.json:
ok, fine
> ddrc.json:
> [
> {
> "BriefDescription": "ddr cycles event",
> "EventCode": "0x00",
> "EventName": "imx8_ddr.cycles",
note: if you have just "cycles" here, instead of "imx8_ddr.cycles", then
the HW PMU event will not show in perf list and you only get the alias
under “imx8_ddr” group. This can be good if your PMU has so many events
and you don't want to show them all. For hisilicon PMU, we have over 600
HW PMU events.
However, as I see, a downside is that many PMUs have "cycles" events,
and if you just use "cycles" as perf event, then it may just use the
incorrect PMU by accident. I need to check this more.
thanks,
John
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-04-08 10:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20200222104621.2258-1-qiangqing.zhang@nxp.com>
[not found] ` <6dbeabcf-c15a-0bbd-cef4-b25d0133854f@huawei.com>
[not found] ` <DB7PR04MB4618D2E1892120EB659B8695E6EC0@DB7PR04MB4618.eurprd04.prod.outlook.com>
[not found] ` <2f81eb7a-a6e4-1cc6-cd0a-ca3d749bd552@huawei.com>
[not found] ` <DB7PR04MB4618C0A8DD9BAB2A529CDCECE6EA0@DB7PR04MB4618.eurprd04.prod.outlook.com>
[not found] ` <a2cc0772-4f5d-aba3-1f5c-7d4eef7a3f72@huawei.com>
[not found] ` <DB7PR04MB461803AD15E47AA880F0915DE6EA0@DB7PR04MB4618.eurprd04.prod.outlook.com>
[not found] ` <55836919-41b5-0834-f7a7-1a2a34535677@huawei.com>
2020-03-30 11:03 ` [PATCH 0/6] perf/imx_ddr: Add namespace for i.MX8 DDR Perf John Garry
2020-04-07 11:46 ` Joakim Zhang
2020-04-07 14:59 ` John Garry
2020-04-08 5:04 ` Joakim Zhang
2020-04-08 10:25 ` John Garry [this message]
2020-04-08 11:41 ` Joakim Zhang
2020-04-15 9:28 ` John Garry
2020-04-16 7:15 ` Joakim Zhang
2020-04-16 16:10 ` John Garry
2020-04-17 5:49 ` Joakim Zhang
2020-04-17 8:14 ` John Garry
2020-04-17 8:29 ` Joakim Zhang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ca2db002-975a-ffe0-2dfc-c85f4e6205bb@huawei.com \
--to=john.garry@huawei.com \
--cc=acme@kernel.org \
--cc=frank.li@nxp.com \
--cc=jolsa@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=mark.rutland@arm.com \
--cc=qiangqing.zhang@nxp.com \
--cc=will@kernel.org \
--cc=zhangshaokun@hisilicon.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).