From: Jiri Olsa <jolsa@redhat.com>
To: John Garry <john.garry@huawei.com>
Cc: Joakim Zhang <qiangqing.zhang@nxp.com>,
"peterz@infradead.org" <peterz@infradead.org>,
"mingo@redhat.com" <mingo@redhat.com>,
"acme@kernel.org" <acme@kernel.org>,
"mark.rutland@arm.com" <mark.rutland@arm.com>,
"alexander.shishkin@linux.intel.com"
<alexander.shishkin@linux.intel.com>,
"namhyung@kernel.org" <namhyung@kernel.org>,
"irogers@google.com" <irogers@google.com>,
"kjain@linux.ibm.com" <kjain@linux.ibm.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linuxarm@openeuler.org" <linuxarm@openeuler.org>
Subject: Re: [PATCH] perf metricgroup: Fix system PMU metrics
Date: Wed, 20 Jan 2021 13:56:22 +0100 [thread overview]
Message-ID: <20210120125622.GE1760208@krava> (raw)
In-Reply-To: <4a876638-3c92-4a49-1925-0ff20c5d42b7@huawei.com>
On Tue, Jan 19, 2021 at 05:33:13PM +0000, John Garry wrote:
SNIP
> Please try this:
>
> From 2380f1ef0250e6818b3dbc7bff4a868810875e2a Mon Sep 17 00:00:00 2001
> From: John Garry <john.garry@huawei.com>
> Date: Tue, 19 Jan 2021 17:29:54 +0000
> Subject: [PATCH] perf metricgroup: Fix metric support for duration_time
>
> For a metric using duration_time, the strcmp() check when finding identical
> events in metric_events[] is broken, as it does not consider that the
> event pmu_name is NULL - it would be for duration_time.
>
> As such, add a NULL check here for event pmu_name.
>
> Signed-off-by: John Garry <john.garry@huawei.com>
>
> diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c
> index ee94d3e8dd65..277adff8017f 100644
> --- a/tools/perf/util/metricgroup.c
> +++ b/tools/perf/util/metricgroup.c
> @@ -280,6 +280,8 @@ static struct evsel *find_evsel_group(struct evlist
> *perf_evlist,
> */
> if (!has_constraint &&
> ev->leader != metric_events[i]->leader &&
> + ev->leader->pmu_name &&
> + metric_events[i]->leader->pmu_name &&
> !strcmp(ev->leader->pmu_name,
> metric_events[i]->leader->pmu_name))
> break;
> --
> 2.26.2
>
>
>
that's fixing the issue for me, this was crashing:
# perf stat -a -I 1000 -M L1D_Cache_Fill_BW,L2_Cache_Fill_BW
could you please send it formaly, so it can be merged?
I can't reproduce the original patch issue and I need
to check the code in more depth
thanks,
jirka
next prev parent reply other threads:[~2021-01-20 14:47 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-19 10:04 [PATCH] perf metricgroup: Fix system PMU metrics John Garry
2021-01-19 10:56 ` Joakim Zhang
2021-01-19 11:04 ` John Garry
2021-01-19 11:13 ` Joakim Zhang
2021-01-19 12:02 ` John Garry
2021-01-19 15:47 ` John Garry
2021-01-19 17:33 ` John Garry
2021-01-20 5:15 ` Joakim Zhang
2021-01-20 9:15 ` John Garry
2021-01-20 10:19 ` Joakim Zhang
2021-01-21 20:31 ` Arnaldo Carvalho de Melo
2021-01-21 21:40 ` John Garry
2021-01-20 12:56 ` Jiri Olsa [this message]
2021-01-20 13:07 ` John Garry
2021-02-05 9:56 ` John Garry
2021-01-20 21:42 ` Jiri Olsa
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=20210120125622.GE1760208@krava \
--to=jolsa@redhat.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=john.garry@huawei.com \
--cc=kjain@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@openeuler.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=qiangqing.zhang@nxp.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