mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Garry <john.garry@huawei.com>
To: Jiri Olsa <jolsa@redhat.com>, "will@kernel.org" <will@kernel.org>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>
Cc: "mathieu.poirier@linaro.org" <mathieu.poirier@linaro.org>,
	"leo.yan@linaro.org" <leo.yan@linaro.org>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"acme@kernel.org" <acme@kernel.org>,
	"alexander.shishkin@linux.intel.com" 
	<alexander.shishkin@linux.intel.com>,
	"namhyung@kernel.org" <namhyung@kernel.org>,
	"irogers@google.com" <irogers@google.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Linuxarm <linuxarm@huawei.com>,
	Zhangshaokun <zhangshaokun@hisilicon.com>,
	"qiangqing.zhang@nxp.com" <qiangqing.zhang@nxp.com>,
	"kjain@linux.ibm.com" <kjain@linux.ibm.com>
Subject: Re: [PATCH 1/5] perf metricgroup: Support printing metrics for arm64
Date: Mon, 8 Mar 2021 16:34:48 +0000	[thread overview]
Message-ID: <e6e9195b-b968-603f-0002-9f9cb6e95d44@huawei.com> (raw)
In-Reply-To: <YEPZNssS200w3Axy@krava>

On 06/03/2021 19:34, Jiri Olsa wrote:
> On Fri, Mar 05, 2021 at 11:06:58AM +0000, John Garry wrote:
>> Hi Jirka,
>>
>>>> -	struct pmu_events_map *map = perf_pmu__find_map(NULL);
>>>> +	struct pmu_events_map *map = find_cpumap();
>>> so this is just for arm at the moment right?
>>>
>> Yes - but to be more accurate, arm64.
>>
>> At the moment, from the archs which use pmu-events, only arm64 and nds32
>> have versions of get_cpuid_str() which require a non-NULL pmu argument.
>>
>> But then apparently nds32 only supports a single CPU, so this issue of
>> heterogeneous CPUs should not be a concern there:)
>>
>>> could we rather make this arch specific code, so we don't need
>>> to do the scanning on archs where this is not needed?
>>>
>>> like marking perf_pmu__find_map as __weak and add arm specific
>>> version?
>> Well I was thinking that this code should not be in metricgroup.c anyway.
>>
>> So there is code which is common in current perf_pmu__find_map() for all
>> archs.
>>
>> I could factor that out into a common function, below. Just a bit worried
>> about perf_pmu__find_map() and perf_pmu__find_pmu_map() being confused.
> right, so perf_pmu__find_map does not take perf_pmu as argument
> anymore, so the prefix does not fit, how about pmu_events_map__find ?

I think it could be ok.

But now I am slightly concerned that we don't put anything like this in 
arch/arm64, based on this earlier discussion on close topic:

https://lore.kernel.org/lkml/20190719075450.xcm4i4a5sfaxlfap@willie-the-truck/

Hi Will, Mark,

Do you have any objection to add arm64 specific code here?

So what I had originally in this patch was to iterate PMUs  in common 
code and find the CPU PMU and use that to match CPU metrics, as long as 
it's not a heterogeneous system.

Now the suggestion was to move that into arch specific code, as it's not 
needed for all archs.

Thanks,
John

  reply	other threads:[~2021-03-08 16:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-03 15:22 [PATCH 0/5] perf arm64 metricgroup support John Garry
2021-03-03 15:22 ` [PATCH 1/5] perf metricgroup: Support printing metrics for arm64 John Garry
2021-03-04 20:05   ` Jiri Olsa
2021-03-05 11:06     ` John Garry
2021-03-06 19:34       ` Jiri Olsa
2021-03-08 16:34         ` John Garry [this message]
2021-03-11  8:47         ` John Garry
2021-03-03 15:22 ` [PATCH 2/5] perf metricgroup: Support adding " John Garry
2021-03-03 15:22 ` [PATCH 3/5] perf vendor events arm64: Add Hisi hip08 L1 metrics John Garry
2021-03-03 15:22 ` [PATCH 4/5] perf vendor events arm64: Add Hisi hip08 L2 metrics John Garry
2021-03-03 15:22 ` [PATCH 5/5] perf vendor events arm64: Add Hisi hip08 L3 metrics John Garry

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=e6e9195b-b968-603f-0002-9f9cb6e95d44@huawei.com \
    --to=john.garry@huawei.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=kjain@linux.ibm.com \
    --cc=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.poirier@linaro.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --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

all inboxes | Powered by JetHome®