From: James Clark <james.clark@linaro.org>
To: Ian Rogers <irogers@google.com>,
Namhyung Kim <namhyung@kernel.org>,
Lucas Stach <l.stach@pengutronix.de>, Leo Yan <leo.yan@linux.dev>,
James Clark <james.clark@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>, Jiri Olsa <jolsa@kernel.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
patchwork-lst@pengutronix.de, linux-perf-users@vger.kernel.org,
kernel@pengutronix.de, Kan Liang <kan.liang@linux.intel.com>
Subject: Re: [PATCH] perf jevents: return potentially empty metrics table
Date: Mon, 15 Jul 2024 16:12:21 +0100 [thread overview]
Message-ID: <b3a4282a-91b6-49a0-83d1-470cc4873dc1@linaro.org> (raw)
In-Reply-To: <CAP-5=fWxuPW1WGSOV-wqYXJ-4kiwefujprnGn3YfVzO+62-i-Q@mail.gmail.com>
On 12/07/2024 10:54 pm, Ian Rogers wrote:
> On Wed, Jul 3, 2024 at 3:33 PM Namhyung Kim <namhyung@kernel.org> wrote:
>>
>> Hello,
>>
>> On Mon, Jul 01, 2024 at 07:19:55PM +0200, Lucas Stach wrote:
>>> Hi,
>>>
>>> has this patch fallen through the cracks? It fixes a functional
>>> regression where the DDR controller metrics are completely unavailable
>>> on all i.MX8M* systems and thus would be nice if someone could have a
>>> look.
>>>
>>> Regards,
>>> Lucas
>>>
>>> Am Freitag, dem 31.05.2024 um 21:44 +0200 schrieb Lucas Stach:
>>>> Don't return NULL when a empty (num_pmus = 0) metrics table is encountered,
>>>> as this causes many of the users to bail out, which will skip matching any
>>>> potentially existing sys metrics later on. Instead return the empty table
>>>> which will be handled properly by the iterators and allows matching to
>>>> continue.
>>>>
>>>> This fixes metrics reporting on systems where only the sys, but not the
>>>> core PMUs have metrics defined.
>>>>
>>>> Fixes: f20c15d13f01 ("perf pmu-events: Remember the perf_events_map for a PMU")
>>>> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
>>
>> Looks ok to me. Ian?
>
> Sorry I missed this, I expect to see patches on LKML and so my email
> filters placed this elsewhere.
>
> The change doesn't make sense. A search is requested with a PMU and
> you return success (the table) when there is no PMU match. If this
> behavior were expected then NULL should be passed as a PMU - this is
> the behavior in util/pmu.c and ARM is the only architecture to pass a
> PMU. The ARM pmu_metrics_table__find also specifically breaks
> heterogeneous (BIG.little) systems and this change won't impact/fix
> that. Perhaps there is some context I lack.
>
> Thanks,
> Ian
>
Yes it looks like the fix should possibly be higher up in the arm64
pmu_metrics_table__find().
Which set of JSON files are you seeing the issue with exactly Lucas? I
see that there are multiple versions of i.MX8M metrics.
James
>> Thanks,
>> Namhyung
>>
>>
>>>> ---
>>>> tools/perf/pmu-events/jevents.py | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/tools/perf/pmu-events/jevents.py b/tools/perf/pmu-events/jevents.py
>>>> index e42efc16723e..0a1ed9ee1429 100755
>>>> --- a/tools/perf/pmu-events/jevents.py
>>>> +++ b/tools/perf/pmu-events/jevents.py
>>>> @@ -1081,7 +1081,7 @@ const struct pmu_metrics_table *perf_pmu__find_metrics_table(struct perf_pmu *pm
>>>> if (!map)
>>>> return NULL;
>>>>
>>>> - if (!pmu)
>>>> + if (!pmu || !map->metric_table.num_pmus)
>>>> return &map->metric_table;
>>>>
>>>> for (size_t i = 0; i < map->metric_table.num_pmus; i++) {
>>>
>
next prev parent reply other threads:[~2024-07-15 15:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-31 19:44 [PATCH] perf jevents: return potentially empty metrics table Lucas Stach
2024-07-01 17:19 ` Lucas Stach
2024-07-03 22:33 ` Namhyung Kim
2024-07-12 21:54 ` Ian Rogers
2024-07-15 15:12 ` James Clark [this message]
2024-07-15 15:54 ` Lucas Stach
2024-07-15 21:43 ` Ian Rogers
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=b3a4282a-91b6-49a0-83d1-470cc4873dc1@linaro.org \
--to=james.clark@linaro.org \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=james.clark@arm.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=kernel@pengutronix.de \
--cc=l.stach@pengutronix.de \
--cc=leo.yan@linux.dev \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=patchwork-lst@pengutronix.de \
--cc=peterz@infradead.org \
/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).