Skip to content

Commit

Permalink
perf intel-pt: Track sideband system-wide when needed
Browse files Browse the repository at this point in the history
User space tasks can migrate between CPUs, so when tracing selected CPUs,
sideband for all CPUs is still needed. This is in preparation for allowing
system-wide events on all CPUs while the user requested events are on only
user requested CPUs.

Signed-off-by: Adrian Hunter <[email protected]>
Acked-by: Ian Rogers <[email protected]>
Acked-by: Namhyung Kim <[email protected]>
Cc: Alexey Bayduraev <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Leo Yan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
ahunter6 authored and acmel committed May 26, 2022
1 parent e665c82 commit 7d189ca
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tools/perf/arch/x86/util/intel-pt.c
Original file line number Diff line number Diff line change
Expand Up @@ -864,20 +864,22 @@ static int intel_pt_recording_options(struct auxtrace_record *itr,

/* Add dummy event to keep tracking */
if (opts->full_auxtrace) {
bool need_system_wide_tracking;
struct evsel *tracking_evsel;

err = parse_events(evlist, "dummy:u", NULL);
if (err)
return err;
/*
* User space tasks can migrate between CPUs, so when tracing
* selected CPUs, sideband for all CPUs is still needed.
*/
need_system_wide_tracking = evlist->core.has_user_cpus &&
!intel_pt_evsel->core.attr.exclude_user;

tracking_evsel = evlist__last(evlist);
tracking_evsel = evlist__add_aux_dummy(evlist, need_system_wide_tracking);
if (!tracking_evsel)
return -ENOMEM;

evlist__set_tracking_event(evlist, tracking_evsel);

tracking_evsel->core.attr.freq = 0;
tracking_evsel->core.attr.sample_period = 1;

tracking_evsel->no_aux_samples = true;
if (need_immediate)
tracking_evsel->immediate = true;

Expand Down

0 comments on commit 7d189ca

Please sign in to comment.