From: "Falcon, Thomas" <thomas.falcon@intel.com>
To: "ravi.bangoria@amd.com" <ravi.bangoria@amd.com>,
"kan.liang@linux.intel.com" <kan.liang@linux.intel.com>
Cc: "irogers@google.com" <irogers@google.com>,
"alexander.shishkin@linux.intel.com"
<alexander.shishkin@linux.intel.com>,
"peterz@infradead.org" <peterz@infradead.org>,
"mark.rutland@arm.com" <mark.rutland@arm.com>,
"linux-perf-users@vger.kernel.org"
<linux-perf-users@vger.kernel.org>,
"mingo@redhat.com" <mingo@redhat.com>,
"acme@kernel.org" <acme@kernel.org>,
"namhyung@kernel.org" <namhyung@kernel.org>,
"jolsa@kernel.org" <jolsa@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Hunter, Adrian" <adrian.hunter@intel.com>
Subject: Re: [PATCH] perf script: Fix output type for dynamically allocated core PMU's
Date: Fri, 13 Dec 2024 19:53:10 +0000 [thread overview]
Message-ID: <c7e865010699fc10c1e16b2720c31feb6beb5357.camel@intel.com> (raw)
In-Reply-To: <66df2821-80a4-4ec2-b326-d0edda8fcde2@linux.intel.com>
On Fri, 2024-12-13 at 13:34 -0500, Liang, Kan wrote:
>
>
> On 2024-12-13 2:07 a.m., Ravi Bangoria wrote:
> > Hi Thomas,
> >
> > > @@ -386,6 +386,8 @@ static int evsel_script__fprintf(struct
> > > evsel_script *es, FILE *fp)
> > >
> > > static inline int output_type(unsigned int type)
> > > {
> > > + struct perf_pmu *pmu;
> > > +
> > > switch (type) {
> > > case PERF_TYPE_SYNTH:
> > > return OUTPUT_TYPE_SYNTH;
> > > @@ -394,6 +396,10 @@ static inline int output_type(unsigned int
> > > type)
> > > return type;
> > > }
> > >
> > > + pmu = perf_pmus__find_by_type(type);
> > > + if (pmu && pmu->is_core)
> > > + return PERF_TYPE_RAW;
> >
> > Minor nit ...
> >
> > output_type() seems to be getting called a lot. For ex, for a
> > perf.data
> > with 4530 samples, output_type() was called 181246 times when I ran
> > "perf script". IIUC, this pmu lookup is unnecessary for homogeneous
> > platforms? If so, can we make it conditional?
> >
>
> Agreed. I think the search should only be applied for the
> perf_pmus__num_core_pmus() > 1 case.
>
> We should just need to search the core_pmus when comparing the type.
>
Thanks, will send v2 soon.
Tom
> Thanks,
> Kan
>
prev parent reply other threads:[~2024-12-13 19:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-13 0:36 [PATCH] perf script: Fix output type for dynamically allocated core PMU's Thomas Falcon
2024-12-13 7:07 ` Ravi Bangoria
2024-12-13 18:34 ` Liang, Kan
2024-12-13 19:53 ` Falcon, Thomas [this message]
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=c7e865010699fc10c1e16b2720c31feb6beb5357.camel@intel.com \
--to=thomas.falcon@intel.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=ravi.bangoria@amd.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