Re: [PATCH v1 2/3] perf arm-spe: Correct sample flags for dummy event
From: James Clark
Date: Wed May 12 2021 - 11:39:58 EST
On 12/05/2021 17:39, James Clark wrote:
>
>
> On 29/04/2021 18:00, Leo Yan wrote:
>> The dummy event is mainly used for mmap, the TIME sample is only needed
[...]
>> - tracking_evsel->core.attr.freq = 0;
>> - tracking_evsel->core.attr.sample_period = 1;
>> - evsel__set_sample_bit(tracking_evsel, TIME);
>> - evsel__set_sample_bit(tracking_evsel, CPU);
>> - evsel__reset_sample_bit(tracking_evsel, BRANCH_STACK);
>> + if (opts->full_auxtrace) {
>> + struct evsel *tracking_evsel;
>
> Hi Leo,
>
> I know the "if (opts->full_auxtrace)" pattern is copied from other auxtrace
> files, but I don't think it does anything because there is this at the top
> of the function:
>
> if (!opts->full_auxtrace)
> return 0;
>
> The same applies for other usages of "full_auxtrace" in the same function.
> They are all always true. I'm also not sure if it's ever defined what
> full_auxtrace means.
>
> James
Apart from this issue above, I've tested the full patchset with various combinations
of --per-thread, -a and --timestamp and don't see any issues like missing command names
or decode issues. (Apart from -a where Command is reported as '-1', but this issue is
present before and after this patchset so is unrelated.)
I think it makes sense to unify the behaviour to make it more like Coresight and others
so this is a good change.
Reviewed-by: James Clark <james.clark@xxxxxxx>
Tested-by: James Clark <james.clark@xxxxxxx>
>
>> +
>> + err = parse_events(evlist, "dummy:u", NULL);
>> + if (err)
>> + return err;
>> +
>> + tracking_evsel = evlist__last(evlist);
>> + evlist__set_tracking_event(evlist, tracking_evsel);
>> +
>> + tracking_evsel->core.attr.freq = 0;
>> + tracking_evsel->core.attr.sample_period = 1;
>> +
>> + /* In per-cpu case, always need the time of mmap events etc */
>> + if (!perf_cpu_map__empty(cpus))
>> + evsel__set_sample_bit(tracking_evsel, TIME);
>> + }
>>
>> return 0;
>> }
>>