From: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
To: Ian Rogers <irogers@google.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>
Cc: Kajol Jain <kjain@linux.ibm.com>,
Adrian Hunter <adrian.hunter@intel.com>,
linux-perf-users <linux-perf-users@vger.kernel.org>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
James Clark <james.clark@arm.com>, Jiri Olsa <jolsa@kernel.org>,
Disha Goel <disgoel@linux.vnet.ibm.com>,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] perf vendor events: Update datasource event name to fix duplicate events
Date: Tue, 5 Dec 2023 12:46:17 +0530 [thread overview]
Message-ID: <2400D325-80A3-4BA0-9467-03F452A72911@linux.vnet.ibm.com> (raw)
In-Reply-To: <CAP-5=fXWm_ZZjQ-36eTJTuWQsQwwCEXer22Oid7X-PSe8=WY1Q@mail.gmail.com>
> On 05-Dec-2023, at 2:43 AM, Ian Rogers <irogers@google.com> wrote:
>
> On Mon, Dec 4, 2023 at 12:22 PM Arnaldo Carvalho de Melo
> <acme@kernel.org> wrote:
>>
>> Em Mon, Dec 04, 2023 at 05:20:46PM -0300, Arnaldo Carvalho de Melo escreveu:
>>> Em Mon, Dec 04, 2023 at 12:12:54PM -0800, Ian Rogers escreveu:
>>>> On Thu, Nov 23, 2023 at 8:01 AM Athira Rajeev
>>>> <atrajeev@linux.vnet.ibm.com> wrote:
>>>>>
>>>>> Running "perf list" on powerpc fails with segfault
>>>>> as below:
>>>>>
>>>>> ./perf list
>>>>> Segmentation fault (core dumped)
>>>>>
>>>>> This happens because of duplicate events in the json list.
>>>>> The powerpc Json event list contains some event with same
>>>>> event name, but different event code. They are:
>>>>> - PM_INST_FROM_L3MISS (Present in datasource and frontend)
>>>>> - PM_MRK_DATA_FROM_L2MISS (Present in datasource and marked)
>>>>> - PM_MRK_INST_FROM_L3MISS (Present in datasource and marked)
>>>>> - PM_MRK_DATA_FROM_L3MISS (Present in datasource and marked)
>>>>>
>>>>> pmu_events_table__num_events uses the value from
>>>>> table_pmu->num_entries which includes duplicate events as
>>>>> well. This causes issue during "perf list" and results in
>>>>> segmentation fault.
>>>>>
>>>>> Since both event codes are valid, append _DSRC to the Data
>>>>> Source events (datasource.json), so that they would have a
>>>>> unique name. Also add PM_DATA_FROM_L2MISS_DSRC and
>>>>> PM_DATA_FROM_L3MISS_DSRC events. With the fix, perf list
>>>>> works as expected.
>>>>>
>>>>> Fixes: fc1435807533 ("perf vendor events power10: Update JSON/events")
>>>>> Signed-off-by: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
>>>>
>>>> Given duplicate events creates broken pmu-events.c we should capture
>>>> that as an exception in jevents.py. That way a JEVENTS_ARCH=all build
>>>> will fail if any vendor/architecture would break in this way. We
>>>> should also add JEVENTS_ARCH=all to tools/perf/tests/make. Athira, do
>>>> you want to look at doing this?
>>>
>>> Should I go ahead and remove this patch till this is sorted out?
>>
>> I'll keep it, its already in tmp.perf-tools-next, we can go from there
>> and improve this with follow up patches,
Thanks Arnaldo for pulling the fix patch.
>
> Agreed. I could look to do the follow up but likely won't have a
> chance for a while. If others could help out it would be great. I'd
> like to have the jevents and json be robust enough that we don't trip
> over problems like this and the somewhat similar AmpereOne issue.
Yes Ian.
I will look at adding this with follow up patches and including this as part of tools/perf/tests/make
Thanks
Athira
>
> Thanks,
> Ian
>
>> - Arnaldo
prev parent reply other threads:[~2023-12-05 7:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20231123160110.94090-1-atrajeev@linux.vnet.ibm.com>
[not found] ` <CAP-5=fWtLHCyZh_6hBkCg16ekOXfwSGAVT9xvgKcUsMcu=Ou9w@mail.gmail.com>
2023-12-05 7:14 ` Athira Rajeev
[not found] ` <ZW40nstmGUeV9Fie@kernel.org>
[not found] ` <ZW406O38z3DmVwOX@kernel.org>
[not found] ` <CAP-5=fXWm_ZZjQ-36eTJTuWQsQwwCEXer22Oid7X-PSe8=WY1Q@mail.gmail.com>
2023-12-05 7:16 ` Athira Rajeev [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=2400D325-80A3-4BA0-9467-03F452A72911@linux.vnet.ibm.com \
--to=atrajeev@linux.vnet.ibm.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=disgoel@linux.vnet.ibm.com \
--cc=irogers@google.com \
--cc=james.clark@arm.com \
--cc=jolsa@kernel.org \
--cc=kjain@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=namhyung@kernel.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
all inboxes | Powered by JetHome®