2022-04-13 13:52:03

by Leo Yan

[permalink] [raw]
Subject: Re: [PATCH] perf report: Set PERF_SAMPLE_DATA_SRC bit for Arm SPE event

On Wed, Apr 13, 2022 at 09:15:40AM +0100, German Gomez wrote:

[...]

> > if (sort__mode == SORT_MODE__MEMORY) {
> > + /*
> > + * FIXUP: prior to kernel 5.18, Arm SPE missed to set
> > + * PERF_SAMPLE_DATA_SRC bit in sample type. For backward
> > + * compatibility, set the bit if it's an old perf data file.
> > + */
> > + evlist__for_each_entry(session->evlist, evsel) {
> > + if (strstr(evsel->name, "arm_spe_") &&
>
> This didn't work for me when the file recorded "-e arm_spe//" instead of
> "-e arm_spe_0//". Could you remove the trailing _? With that:

Sure, will change to "arm_spe". Just curious, if there any local
change at your side so we have the different event name?

> Tested-by: German Gomez <[email protected]>

Thanks a lot, German!

Leo


2022-04-13 17:29:23

by German Gomez

[permalink] [raw]
Subject: Re: [PATCH] perf report: Set PERF_SAMPLE_DATA_SRC bit for Arm SPE event


On 13/04/2022 09:49, Leo Yan wrote:
> On Wed, Apr 13, 2022 at 09:15:40AM +0100, German Gomez wrote:
>
> [...]
>
>>> if (sort__mode == SORT_MODE__MEMORY) {
>>> + /*
>>> + * FIXUP: prior to kernel 5.18, Arm SPE missed to set
>>> + * PERF_SAMPLE_DATA_SRC bit in sample type. For backward
>>> + * compatibility, set the bit if it's an old perf data file.
>>> + */
>>> + evlist__for_each_entry(session->evlist, evsel) {
>>> + if (strstr(evsel->name, "arm_spe_") &&
>> This didn't work for me when the file recorded "-e arm_spe//" instead of
>> "-e arm_spe_0//". Could you remove the trailing _? With that:
> Sure, will change to "arm_spe". Just curious, if there any local
> change at your side so we have the different event name?

No local changes. I've always used "arm_spe//" and it always defaults to
"arm_spe_0//". But it's still stored as the former in the data file. I
haven't checked where this default happens though. Isn't it the same for
you?

Thanks,
German
>
>> Tested-by: German Gomez <[email protected]>
> Thanks a lot, German!
>
> Leo

2022-04-13 19:10:28

by Leo Yan

[permalink] [raw]
Subject: Re: [PATCH] perf report: Set PERF_SAMPLE_DATA_SRC bit for Arm SPE event

On Wed, Apr 13, 2022 at 04:49:41PM +0800, Leo Yan wrote:
> On Wed, Apr 13, 2022 at 09:15:40AM +0100, German Gomez wrote:
>
> [...]
>
> > > if (sort__mode == SORT_MODE__MEMORY) {
> > > + /*
> > > + * FIXUP: prior to kernel 5.18, Arm SPE missed to set
> > > + * PERF_SAMPLE_DATA_SRC bit in sample type. For backward
> > > + * compatibility, set the bit if it's an old perf data file.
> > > + */
> > > + evlist__for_each_entry(session->evlist, evsel) {
> > > + if (strstr(evsel->name, "arm_spe_") &&
> >
> > This didn't work for me when the file recorded "-e arm_spe//" instead of
> > "-e arm_spe_0//". Could you remove the trailing _? With that:
>
> Sure, will change to "arm_spe". Just curious, if there any local
> change at your side so we have the different event name?

I think I know the reason now, though the PMU event is 'arm_spe_0',
but we could use '-e arm_spe//' to record, so finally the event name
is 'arm_spe'.

Thanks,
Leo

2022-04-15 03:01:05

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH] perf report: Set PERF_SAMPLE_DATA_SRC bit for Arm SPE event

Em Wed, Apr 13, 2022 at 04:49:41PM +0800, Leo Yan escreveu:
> On Wed, Apr 13, 2022 at 09:15:40AM +0100, German Gomez wrote:
>
> [...]
>
> > > if (sort__mode == SORT_MODE__MEMORY) {
> > > + /*
> > > + * FIXUP: prior to kernel 5.18, Arm SPE missed to set
> > > + * PERF_SAMPLE_DATA_SRC bit in sample type. For backward
> > > + * compatibility, set the bit if it's an old perf data file.
> > > + */
> > > + evlist__for_each_entry(session->evlist, evsel) {
> > > + if (strstr(evsel->name, "arm_spe_") &&
> >
> > This didn't work for me when the file recorded "-e arm_spe//" instead of
> > "-e arm_spe_0//". Could you remove the trailing _? With that:
>
> Sure, will change to "arm_spe". Just curious, if there any local
> change at your side so we have the different event name?

Ok, waiting for v2

> > Tested-by: German Gomez <[email protected]>
>
> Thanks a lot, German!
>
> Leo

--

- Arnaldo