From: "Liang, Kan" <kan.liang@linux.intel.com>
To: Ian Rogers <irogers@google.com>
Cc: Caleb Biggers <caleb.biggers@intel.com>,
Perry Taylor <perry.taylor@intel.com>,
Kshipra Bopardikar <kshipra.bopardikar@intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
Ravi Bangoria <ravi.bangoria@amd.com>,
Andi Kleen <ak@linux.intel.com>, Haowen Bai <baihaowen@meizu.com>,
Riccardo Mancini <rickyman7@gmail.com>,
Kim Phillips <kim.phillips@amd.com>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Shunsuke Nakamura <nakamura.shun@fujitsu.com>,
Florian Fischer <florian.fischer@muhq.space>,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
Stephane Eranian <eranian@google.com>,
Zhengjun Xing <zhengjun.xing@linux.intel.com>
Subject: Re: [PATCH 1/2] perf evlist: Keep topdown counters in weak group
Date: Thu, 5 May 2022 15:43:56 -0400 [thread overview]
Message-ID: <83417b72-4872-072a-2328-a88d2bb90858@linux.intel.com> (raw)
In-Reply-To: <CAP-5=fW9Cp3ShO=tTQddDWXz+nrSip99HrNW7Wv5_Qsy1UT7bw@mail.gmail.com>
On 5/5/2022 2:31 PM, Ian Rogers wrote:
>>> So I think fixing all of these should be a follow up. I am working to
>>> get access to an Alderlake system, could we land this first?
>>>
>> I think we can use pmu_name to replace the "cpu" to fix the issue for
>> the hybrid platform. For a hybrid platform, the pmu_name is either
>> cpu_atom or cpu_core.
>>
>> Besides, the topdown events may have a PMU prefix, e.g.,
>> cpu_core/topdown-be-bound/. The strcasecmp may not work well for this case.
>>
>> How about the below patch?
>> If it's OK for you, could you please merge it into your V2 patch set?
>> I can do the test on a ADL system.
>>
>> diff --git a/tools/perf/arch/x86/util/evsel.c
>> b/tools/perf/arch/x86/util/evsel.c
>> index 40b171de2086..551ae2bab70e 100644
>> --- a/tools/perf/arch/x86/util/evsel.c
>> +++ b/tools/perf/arch/x86/util/evsel.c
>> @@ -33,11 +33,12 @@ void arch_evsel__fixup_new_cycles(struct
>> perf_event_attr *attr)
>>
>> bool arch_evsel__must_be_in_group(const struct evsel *evsel)
>> {
>> - if ((evsel->pmu_name && strcmp(evsel->pmu_name, "cpu")) ||
>> - !pmu_have_event("cpu", "slots"))
>> + const char *pmu_name = evsel->pmu_name ? evsel->pmu_name : "cpu";
>> +
>> + if (!pmu_have_event(pmu_name, "slots"))
>> return false;
> Hmm. The idea with this test is to see if the architecture supports
> topdown events before going further. There's a similar test in all the
> arch_evlist functions. I think with cpu_core this needs to become:
>
The case is a little bit different here. For the arch_evlist functions,
the input is the evlist, not the specific evsel. So we have to check all
the possible PMU names which are "cpu" and "cpu_core". Then we decide
whether going further.
The input of the evsel__must_be_in_group() is the evsel. The PMU name is
stored in the evsel->pmu_name. I don't think we need to check all the
possible PMU names. Using evsel->pmu_name should be good enough.
> if (!pmu_have_event("cpu", "slots") && !pmu_have_event("cpu_core", "slots") )
>
> But we should add a helper function for this. It is odd to have this
> change supporting Alderlake but the existing evlist work not. Perhaps
> we should just wait until Zhengjun's patches land.
Yes, a helper function is good for the arch_evlist functions. But I
don't think this patch needs the helper function. Zhengjun's patches are
to fix the other topdown issues on ADL. There is no dependency between
this patch and zhengjun's patches.
Thanks,
Kan
next prev parent reply other threads:[~2022-05-05 19:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-05 4:38 [PATCH 1/2] perf evlist: Keep topdown counters in weak group Ian Rogers
2022-05-05 4:38 ` [PATCH 2/2] perf test: Add basic stat and topdown group test Ian Rogers
2022-05-05 12:12 ` Liang, Kan
2022-05-05 15:22 ` Ian Rogers
2022-05-05 18:19 ` Liang, Kan
2022-05-05 18:35 ` Ian Rogers
2022-05-05 20:27 ` Liang, Kan
2022-05-05 11:56 ` [PATCH 1/2] perf evlist: Keep topdown counters in weak group Liang, Kan
2022-05-05 15:18 ` Ian Rogers
2022-05-05 18:15 ` Liang, Kan
2022-05-05 18:31 ` Ian Rogers
2022-05-05 19:43 ` Liang, Kan [this message]
2022-05-09 17:28 ` Ian Rogers
2022-05-09 21:01 ` Liang, Kan
2022-05-10 16:58 ` Ian Rogers
2022-05-10 19:24 ` Liang, Kan
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=83417b72-4872-072a-2328-a88d2bb90858@linux.intel.com \
--to=kan.liang@linux.intel.com \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=baihaowen@meizu.com \
--cc=caleb.biggers@intel.com \
--cc=eranian@google.com \
--cc=florian.fischer@muhq.space \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kim.phillips@amd.com \
--cc=kshipra.bopardikar@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=maddy@linux.ibm.com \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=nakamura.shun@fujitsu.com \
--cc=namhyung@kernel.org \
--cc=perry.taylor@intel.com \
--cc=peterz@infradead.org \
--cc=ravi.bangoria@amd.com \
--cc=rickyman7@gmail.com \
--cc=zhengjun.xing@linux.intel.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).