aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2019-06-10 10:28:03 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-06-17 15:57:18 -0300
commite01f0ef509ea7e76929f24a074d241de52c6f82a (patch)
tree040e81ea83363ed3b91b54b04a6447a9b37a5c06 /tools
parent975846eddf907297aa036544545cd839c7c7dd31 (diff)
downloadtip-e01f0ef509ea7e76929f24a074d241de52c6f82a.tar.gz
tip-e01f0ef509ea7e76929f24a074d241de52c6f82a.tar.xz
tip-e01f0ef509ea7e76929f24a074d241de52c6f82a.zip
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/intel-pt.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index bf7647897e8a..550db6e77968 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -1730,6 +1730,14 @@ static int intel_pt_synth_pebs_sample(struct intel_pt_queue *ptq)
sample.time = tsc_to_perf_time(timestamp, &pt->tc);
}
+ if (sample_type & PERF_SAMPLE_CALLCHAIN &&
+ pt->synth_opts.callchain) {
+ thread_stack__sample(ptq->thread, ptq->cpu, ptq->chain,
+ pt->synth_opts.callchain_sz, sample.ip,
+ pt->kernel_start);
+ sample.callchain = ptq->chain;
+ }
+
if (sample_type & PERF_SAMPLE_REGS_INTR &&
items->mask[INTEL_PT_GP_REGS_POS]) {
u64 regs[sizeof(sample.intr_regs.mask)];