linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Garry <john.garry@huawei.com>
To: Joakim Zhang <qiangqing.zhang@nxp.com>, irogers@google.com
Cc: "mark.rutland@arm.com" <mark.rutland@arm.com>,
	Zhangshaokun <zhangshaokun@hisilicon.com>,
	"will@kernel.org" <will@kernel.org>,
	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>, Jiri Olsa <jolsa@redhat.com>,
	"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: Thu, 16 Apr 2020 17:10:20 +0100	[thread overview]
Message-ID: <8341b035-2fac-52dd-45d1-2bf6f5ea4ba4@huawei.com> (raw)
In-Reply-To: <DB8PR04MB67957F63165ACC0483F6AE39E6D80@DB8PR04MB6795.eurprd04.prod.outlook.com>

+ Ian (please check the patch at the bottom, thanks)

On 16/04/2020 08:15, Joakim Zhang wrote:
>> ?
>>
>> If that doesn't work, then I'll try this myself.
> Hi John,
> 
> It still cannot work with this code change.
> 

So I got a SMMUv3 PMCG test metric working here:

https://github.com/hisilicon/kernel-dev/commits/private-topic-perf-5.7-sys-pmu-events-v1-debug

as follows:

john@ubuntu:~/perf list metric

List of pre-defined events (to be used in -e):

Metrics:

   smmuv3_pmcg.fake
        [SMMUv3 PMCG fake metric]

john@ubuntu:~/sudo ./perf stat -a -M smmuv3_pmcg.fake sleep 1

  Performance counter stats for 'system wide':

    531510      smmuv3_pmcg.transaction  (49.90%)
124914193      smmuv3_pmcg.cycles       (49.90%)
    531331      smmuv3_pmcg.transaction  (50.29%)
124879887      smmuv3_pmcg.cycles       (50.29%)
    531269      smmuv3_pmcg.transaction  (50.45%)
124867388      smmuv3_pmcg.cycles       (50.45%)
    531372      smmuv3_pmcg.transaction  (50.45%)
124896723      smmuv3_pmcg.cycles       (50.45%)
    531431      smmuv3_pmcg.transaction  (50.12%)
124901700      smmuv3_pmcg.cycles       (50.12%)
    531574      smmuv3_pmcg.transaction  (49.72%)
124924231      smmuv3_pmcg.cycles       (49.72%)
    531598      smmuv3_pmcg.transaction  (49.56%)
124916914      smmuv3_pmcg.cycles       (49.56%)
    531440      smmuv3_pmcg.transaction  (49.56%)
124902473      smmuv3_pmcg.cycles       (49.56%)

        1.001167246 seconds time elapsed

So you can compare this to yours.

I did have to fix what looks like a bug in mainline on that branch:

--->8-----

perf parse-events: Fix comparison of evsel and leader pmu name

Since we now strdup() the pmu name for the event selector, use strcmp()
instead of pointer equality for comparison.

Fixes: d4953f7 ("perf parse-events: Fix 3 use after frees found with 
clang ASANutil/parse-events.c")
Signed-off-by: John Garry <john.garry@huawei.com>
---
tools/perf/util/parse-events.c
@@ -1629,7 +1629,7 @@ parse_events__set_leader_for_uncore_aliase(char 
*name, struct list_head *list,
		 * event. That can be used to distinguish the leader from
		 * other members, even they have the same event name.
		 */
		if ((leader != evsel) && (leader->pmu_name == evsel->pmu_name)) {
		if ((leader != evsel) && !strcmp(leader->pmu_name, evsel->pmu_name)) {
			is_leader = false;
			continue;
		}


---8<

Without it, I would get a spew of these:

assertion failed at util/parse-events.c:1637

@Ian, does this change look right? I am not intimately familiar with 
that code.

Thanks,
John

  reply	other threads:[~2020-04-16 16:10 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
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 [this message]
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=8341b035-2fac-52dd-45d1-2bf6f5ea4ba4@huawei.com \
    --to=john.garry@huawei.com \
    --cc=acme@kernel.org \
    --cc=irogers@google.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).