Re: [PATCH v1 2/3] perf arm-spe: Correct sample flags for dummy event
From: James Clark <hidden>
Date: 2021-05-12 15:40:12
Also in:
linux-perf-users, lkml
On 12/05/2021 17:39, James Clark wrote:
On 29/04/2021 18:00, Leo Yan wrote:quoted
The dummy event is mainly used for mmap, the TIME sample is only needed
[...]
quoted
- 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 <redacted> Tested-by: James Clark <redacted>
quoted
+ + 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; }
_______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel