lkml.org 
[lkml]   [2020]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/9] perf intel-pt: Consolidate thread-stack use condition
Date
The components of the condition do not change, so consolidate them in one
variable.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
tools/perf/util/intel-pt.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index 865e79ccf55b..afc42a6e4e00 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -68,6 +68,7 @@ struct intel_pt {
bool est_tsc;
bool sync_switch;
bool mispred_all;
+ bool use_thread_stack;
int have_sched_switch;
u32 pmu_type;
u64 kernel_start;
@@ -2028,8 +2029,7 @@ static int intel_pt_sample(struct intel_pt_queue *ptq)
if (!(state->type & INTEL_PT_BRANCH))
return 0;

- if (pt->synth_opts.callchain || pt->synth_opts.add_callchain ||
- pt->synth_opts.thread_stack)
+ if (pt->use_thread_stack)
thread_stack__event(ptq->thread, ptq->cpu, ptq->flags, state->from_ip,
state->to_ip, ptq->insn_len,
state->trace_nr, true, 0, 0);
@@ -3440,6 +3440,10 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
goto err_delete_thread;
}

+ pt->use_thread_stack = pt->synth_opts.callchain ||
+ pt->synth_opts.add_callchain ||
+ pt->synth_opts.thread_stack;
+
err = intel_pt_synth_events(pt, session);
if (err)
goto err_delete_thread;
--
2.17.1
\
 
 \ /
  Last update: 2020-04-29 17:09    [W:0.306 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site