perf intel-pt: Consolidate thread-stack use condition
The components of the condition do not change, so consolidate them in one variable. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lore.kernel.org/lkml/20200429150751.12570-3-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
86d67180b9
commit
1ef998ff18
|
@ -69,6 +69,7 @@ struct intel_pt {
|
||||||
bool est_tsc;
|
bool est_tsc;
|
||||||
bool sync_switch;
|
bool sync_switch;
|
||||||
bool mispred_all;
|
bool mispred_all;
|
||||||
|
bool use_thread_stack;
|
||||||
int have_sched_switch;
|
int have_sched_switch;
|
||||||
u32 pmu_type;
|
u32 pmu_type;
|
||||||
u64 kernel_start;
|
u64 kernel_start;
|
||||||
|
@ -2029,8 +2030,7 @@ static int intel_pt_sample(struct intel_pt_queue *ptq)
|
||||||
if (!(state->type & INTEL_PT_BRANCH))
|
if (!(state->type & INTEL_PT_BRANCH))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (pt->synth_opts.callchain || pt->synth_opts.add_callchain ||
|
if (pt->use_thread_stack)
|
||||||
pt->synth_opts.thread_stack)
|
|
||||||
thread_stack__event(ptq->thread, ptq->cpu, ptq->flags, state->from_ip,
|
thread_stack__event(ptq->thread, ptq->cpu, ptq->flags, state->from_ip,
|
||||||
state->to_ip, ptq->insn_len,
|
state->to_ip, ptq->insn_len,
|
||||||
state->trace_nr, true, 0, 0);
|
state->trace_nr, true, 0, 0);
|
||||||
|
@ -3441,6 +3441,10 @@ int intel_pt_process_auxtrace_info(union perf_event *event,
|
||||||
goto err_delete_thread;
|
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);
|
err = intel_pt_synth_events(pt, session);
|
||||||
if (err)
|
if (err)
|
||||||
goto err_delete_thread;
|
goto err_delete_thread;
|
||||||
|
|
Loading…
Reference in New Issue