aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/intel-pt.c
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2016-06-23 09:40:57 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-06-23 16:02:59 -0400
commit50f736372d5ea0ce97ede698f957c9b141aa569e (patch)
treef12cd5756fdc9364c2cd0bd603167c37fb0f284b /tools/perf/util/intel-pt.c
parent055cd33d93ac310ce68e8b1ebcf88f829426adf5 (diff)
perf auxtrace: Add option to feed branches to the thread stack
In preparation for using the thread stack to print an indent representing the stack depth in perf script, add an option to tell decoders to feed branches to the thread stack. Add support for that option to Intel PT and Intel BTS. The advantage of using the decoder to feed the thread stack is that it happens before branch filtering and so can be used with different itrace options (e.g. it still works when only showing calls, even though the thread stack needs to see calls and returns). Also it does not conflict with using the thread stack to get callchains. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/1466689258-28493-3-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/intel-pt.c')
-rw-r--r--tools/perf/util/intel-pt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index dc243b19197b..551ff6f640be 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -1234,7 +1234,7 @@ static int intel_pt_sample(struct intel_pt_queue *ptq)
1234 if (!(state->type & INTEL_PT_BRANCH)) 1234 if (!(state->type & INTEL_PT_BRANCH))
1235 return 0; 1235 return 0;
1236 1236
1237 if (pt->synth_opts.callchain) 1237 if (pt->synth_opts.callchain || pt->synth_opts.thread_stack)
1238 thread_stack__event(ptq->thread, ptq->flags, state->from_ip, 1238 thread_stack__event(ptq->thread, ptq->flags, state->from_ip,
1239 state->to_ip, ptq->insn_len, 1239 state->to_ip, ptq->insn_len,
1240 state->trace_nr); 1240 state->trace_nr);
@@ -2137,6 +2137,9 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
2137 pt->synth_opts.branches = false; 2137 pt->synth_opts.branches = false;
2138 pt->synth_opts.callchain = true; 2138 pt->synth_opts.callchain = true;
2139 } 2139 }
2140 if (session->itrace_synth_opts)
2141 pt->synth_opts.thread_stack =
2142 session->itrace_synth_opts->thread_stack;
2140 } 2143 }
2141 2144
2142 if (pt->synth_opts.log) 2145 if (pt->synth_opts.log)