diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2019-08-06 04:46:04 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-08-14 09:59:59 -0400 |
commit | 9e64cefe4335b0f2799956d3f3cca8bb652d950f (patch) | |
tree | 4fa590da8728f10c23d7345463e698efb16eef8f /tools/perf/arch | |
parent | 181ebb5e23a5e480f6d6aa2816a9c4aaa65afa59 (diff) |
perf intel-pt: Process options for PEBS event synthesis
Process synth_opts.other_events and attr.aux_output to set up for
synthesizing PEBs via Intel PT events.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20190806084606.4021-6-alexander.shishkin@linux.intel.com
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
[ Fixed up libbperf clashes, i.e. some places using perf_evsel (now in libperf)
need to use instead 'evsel' (a tools/perf only abstraction) ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/arch')
-rw-r--r-- | tools/perf/arch/x86/util/intel-pt.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c index 218a4e694618..a8e633aa278a 100644 --- a/tools/perf/arch/x86/util/intel-pt.c +++ b/tools/perf/arch/x86/util/intel-pt.c | |||
@@ -548,6 +548,26 @@ static int intel_pt_validate_config(struct perf_pmu *intel_pt_pmu, | |||
548 | evsel->core.attr.config); | 548 | evsel->core.attr.config); |
549 | } | 549 | } |
550 | 550 | ||
551 | /* | ||
552 | * Currently, there is not enough information to disambiguate different PEBS | ||
553 | * events, so only allow one. | ||
554 | */ | ||
555 | static bool intel_pt_too_many_aux_output(struct evlist *evlist) | ||
556 | { | ||
557 | struct evsel *evsel; | ||
558 | int aux_output_cnt = 0; | ||
559 | |||
560 | evlist__for_each_entry(evlist, evsel) | ||
561 | aux_output_cnt += !!evsel->core.attr.aux_output; | ||
562 | |||
563 | if (aux_output_cnt > 1) { | ||
564 | pr_err(INTEL_PT_PMU_NAME " supports at most one event with aux-output\n"); | ||
565 | return true; | ||
566 | } | ||
567 | |||
568 | return false; | ||
569 | } | ||
570 | |||
551 | static int intel_pt_recording_options(struct auxtrace_record *itr, | 571 | static int intel_pt_recording_options(struct auxtrace_record *itr, |
552 | struct evlist *evlist, | 572 | struct evlist *evlist, |
553 | struct record_opts *opts) | 573 | struct record_opts *opts) |
@@ -588,6 +608,9 @@ static int intel_pt_recording_options(struct auxtrace_record *itr, | |||
588 | return -EINVAL; | 608 | return -EINVAL; |
589 | } | 609 | } |
590 | 610 | ||
611 | if (intel_pt_too_many_aux_output(evlist)) | ||
612 | return -EINVAL; | ||
613 | |||
591 | if (!opts->full_auxtrace) | 614 | if (!opts->full_auxtrace) |
592 | return 0; | 615 | return 0; |
593 | 616 | ||