lkml.org 
[lkml]   [2020]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] [perf] intel_pt_recording_options: Remove redundant intel_pt_evsel null check
From
Date
On 24/06/20 2:48 am, Gaurav Singh wrote:
> intel_pt_evsel cannot be NULL here since its already being
> dereferenced above. Remove this redundant check.
>
> Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
> tools/perf/arch/x86/util/intel-pt.c | 24 +++++++++++-------------
> 1 file changed, 11 insertions(+), 13 deletions(-)
>
> diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c
> index 839ef52c1ac2..8cc87fd2dc6f 100644
> --- a/tools/perf/arch/x86/util/intel-pt.c
> +++ b/tools/perf/arch/x86/util/intel-pt.c
> @@ -836,19 +836,17 @@ static int intel_pt_recording_options(struct auxtrace_record *itr,
> }
> }
>
> - if (intel_pt_evsel) {
> - /*
> - * To obtain the auxtrace buffer file descriptor, the auxtrace
> - * event must come first.
> - */
> - perf_evlist__to_front(evlist, intel_pt_evsel);
> - /*
> - * In the case of per-cpu mmaps, we need the CPU on the
> - * AUX event.
> - */
> - if (!perf_cpu_map__empty(cpus))
> - evsel__set_sample_bit(intel_pt_evsel, CPU);
> - }
> + /*
> + * To obtain the auxtrace buffer file descriptor, the auxtrace
> + * event must come first.
> + */
> + perf_evlist__to_front(evlist, intel_pt_evsel);
> + /*
> + * In the case of per-cpu mmaps, we need the CPU on the
> + * AUX event.
> + */
> + if (!perf_cpu_map__empty(cpus))
> + evsel__set_sample_bit(intel_pt_evsel, CPU);
>
> /* Add dummy event to keep tracking */
> if (opts->full_auxtrace) {
>

\
 
 \ /
  Last update: 2020-06-24 18:07    [W:0.064 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site