lkml.org 
[lkml]   [2021]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v1 2/3] perf arm-spe: Correct sample flags for dummy event
From
Date


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@arm.com>
Tested-by: James Clark <james.clark@arm.com>

>
>> +
>> + 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;
>> }
>>

\
 
 \ /
  Last update: 2021-05-12 18:02    [W:0.094 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site