Skip to content

Commit 75bcb87

Browse files
ahunter6acmel
authored andcommitted
perf intel-pt: Fix recording PEBS-via-PT with registers
When recording PEBS-via-PT, the kernel will not accept the intel_pt event with register sampling e.g. # perf record --kcore -c 10000 -e '{intel_pt/branch=0/,branch-loads/aux-output/ppp}' -I -- ls -l Error: intel_pt/branch=0/: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat' Fix by suppressing register sampling on the intel_pt evsel. Committer notes: Adrian informed that this is only available from Tremont onwards, so on older processors the error continues the same as before. Fixes: 9e64cef ("perf intel-pt: Process options for PEBS event synthesis") Signed-off-by: Adrian Hunter <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Luwei Kang <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent d61cbb8 commit 75bcb87

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tools/perf/arch/x86/util/intel-pt.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,7 @@ static int intel_pt_recording_options(struct auxtrace_record *itr,
641641
}
642642
evsel->core.attr.freq = 0;
643643
evsel->core.attr.sample_period = 1;
644+
evsel->no_aux_samples = true;
644645
intel_pt_evsel = evsel;
645646
opts->full_auxtrace = true;
646647
}

tools/perf/util/evsel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,12 +1014,12 @@ void evsel__config(struct evsel *evsel, struct record_opts *opts,
10141014
if (callchain && callchain->enabled && !evsel->no_aux_samples)
10151015
evsel__config_callchain(evsel, opts, callchain);
10161016

1017-
if (opts->sample_intr_regs) {
1017+
if (opts->sample_intr_regs && !evsel->no_aux_samples) {
10181018
attr->sample_regs_intr = opts->sample_intr_regs;
10191019
evsel__set_sample_bit(evsel, REGS_INTR);
10201020
}
10211021

1022-
if (opts->sample_user_regs) {
1022+
if (opts->sample_user_regs && !evsel->no_aux_samples) {
10231023
attr->sample_regs_user |= opts->sample_user_regs;
10241024
evsel__set_sample_bit(evsel, REGS_USER);
10251025
}

0 commit comments

Comments
 (0)