[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240527105842.GB33806@debian-dev>
Date: Mon, 27 May 2024 18:58:42 +0800
From: Leo Yan <leo.yan@...ux.dev>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Ian Rogers <irogers@...gle.com>, Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Adrian Hunter <adrian.hunter@...el.com>,
Kan Liang <kan.liang@...ux.intel.com>,
James Clark <james.clark@....com>,
Dominique Martinet <asmadeus@...ewreck.org>,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] perf evlist: Force adding default events only to core
PMUs
On Sat, May 25, 2024 at 02:14:26PM -0700, Linus Torvalds wrote:
> On Sat, 25 May 2024 at 09:43, Linus Torvalds
> <torvalds@...ux-foundation.org> wrote:
> >
> > This makes 'perf record' work for me again.
>
> Oh, wait, no it doesn't.
>
> It makes just the plain "perf record" without any arguments work,
> which was what I was testing because I was lazy.
>
> So now
>
> $ perf record sleep 1
>
> works fine. But
>
> $ perf record -e cycles:pp sleep 1
>
> is still completely broken (with or without ":p" and ":pp").
Seems to me that this patch fails to check if a PMU is a core-attached
PMU that can support common hardware events. Therefore, we should
consider adding the following check.
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 30f958069076..bc1822c2f3e3 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -1594,6 +1594,9 @@ int parse_events_multi_pmu_add(struct parse_events_state *parse_state,
while ((pmu = perf_pmus__scan(pmu)) != NULL) {
bool auto_merge_stats;
+ if (hw_config != PERF_COUNT_HW_MAX && !pmu->is_core)
+ continue;
+
if (parse_events__filter_pmu(parse_state, pmu))
continue;
To be clear, I only compiled this change but I have no chance to test
it. @Ian, could you confirm this?
Thanks,
Leo
> So no. That still needs to be fixed, or the whole "prefer sysfs/JSON
> by default" needs to be reverted.
Powered by blists - more mailing lists