提交 e665c82a 编写于 作者: A Adrian Hunter 提交者: Arnaldo Carvalho de Melo

perf intel-pt: Use evlist__add_dummy_on_all_cpus() for switch tracking

Use evlist__add_dummy_on_all_cpus() for switch tracking in preparation for
allowing system-wide events on all CPUs while the user requested events are
on only user requested CPUs.
Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
Acked-by: NIan Rogers <irogers@google.com>
Acked-by: NNamhyung Kim <namhyung@kernel.org>
Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Leo Yan <leo.yan@linaro.org>
Link: https://lore.kernel.org/r/20220524075436.29144-8-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 921e3be5
...@@ -811,18 +811,11 @@ static int intel_pt_recording_options(struct auxtrace_record *itr, ...@@ -811,18 +811,11 @@ static int intel_pt_recording_options(struct auxtrace_record *itr,
if (!cpu_wide && perf_can_record_cpu_wide()) { if (!cpu_wide && perf_can_record_cpu_wide()) {
struct evsel *switch_evsel; struct evsel *switch_evsel;
err = parse_events(evlist, "dummy:u", NULL); switch_evsel = evlist__add_dummy_on_all_cpus(evlist);
if (err) if (!switch_evsel)
return err; return -ENOMEM;
switch_evsel = evlist__last(evlist);
switch_evsel->core.attr.freq = 0;
switch_evsel->core.attr.sample_period = 1;
switch_evsel->core.attr.context_switch = 1; switch_evsel->core.attr.context_switch = 1;
switch_evsel->core.system_wide = true;
switch_evsel->no_aux_samples = true;
switch_evsel->immediate = true; switch_evsel->immediate = true;
evsel__set_sample_bit(switch_evsel, TID); evsel__set_sample_bit(switch_evsel, TID);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册