Skip to content

Commit e01f0ef

Browse files
ahunter6acmel
authored andcommitted
perf intel-pt: Add callchain to synthesized PEBS sample
Like other synthesized events, if there is also an Intel PT branch trace, then a call stack can also be synthesized. Add that. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/20190610072803.10456-12-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 975846e commit e01f0ef

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎tools/perf/util/intel-pt.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,6 +1730,14 @@ static int intel_pt_synth_pebs_sample(struct intel_pt_queue *ptq)
17301730
sample.time = tsc_to_perf_time(timestamp, &pt->tc);
17311731
}
17321732

1733+
if (sample_type & PERF_SAMPLE_CALLCHAIN &&
1734+
pt->synth_opts.callchain) {
1735+
thread_stack__sample(ptq->thread, ptq->cpu, ptq->chain,
1736+
pt->synth_opts.callchain_sz, sample.ip,
1737+
pt->kernel_start);
1738+
sample.callchain = ptq->chain;
1739+
}
1740+
17331741
if (sample_type & PERF_SAMPLE_REGS_INTR &&
17341742
items->mask[INTEL_PT_GP_REGS_POS]) {
17351743
u64 regs[sizeof(sample.intr_regs.mask)];

0 commit comments

Comments
 (0)