Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp699437ybt; Wed, 24 Jun 2020 09:06:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwM28BYilxruKcKcH0rmGdgdwL/jCvT369DiQqM+V9qPwIlY0oTVCIfltwFhOGoYR64UZNy X-Received: by 2002:a17:907:369:: with SMTP id rs9mr25287330ejb.187.1593014771099; Wed, 24 Jun 2020 09:06:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593014771; cv=none; d=google.com; s=arc-20160816; b=OXM1lO4JQAbAJD3DFoU+Sc0jN3FuiorJHCVcEXBQGbmszcn/AHiP5m4uXBQ7RKfzsc x5prWkSsfU0Gd075f26UYNELvp9f9OcL9ixZthWKjknEBvGtQrAozEfVJpuDLBBUdjve 96XEIqYRyCbWJN4D4V/4a4gsSXtS8YYoRbhapjAeyFymKbgg6km3Hn6qxcmlA8fiVMHS AkeLEx0e4BS2/J36+Y6Qam2z/quTiEJwLlHGbYLpsM8hSdwYocYlhHfOyiKG7wIiTnCV pth/Bx3W8iuIgzOweeP40YiZnw8j2Z5fB1+qkzRmxXf54wea9RBLNMPKWktocxxRlDn9 NCOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:to:subject:ironport-sdr :ironport-sdr; bh=WtPoJXsQNzHtjju9OMMI8STdou1v98BBEVIKt5I1BgI=; b=bisvmqbgySummCXd/mRDo7fWqx9F7Wxdm5vR/QAyg3d72ZV3APDCHGXBL/eB7JtA8Y J2pA8SxcgB0aleSwqQyeJ9d1vnx2Y36A4rbmqAVWPgcwGb1P90wh33bf2dgMBL7pVdIT FVURSvk+fR8SjJfyXIxBSh0/covghrz0eMidCniGS3W6Ah1gc8d0FTB8oRqX70dsEvYv n8knvu0sATeM3Foo+6VGCddsWjmvKwZ7wpvkQA2qoz+Z4RrVVR+eD5rAQjqE/kWKT3nH EbQk0+gBnpDocZOGZxP4dilMWbKGKgdgvTe9c6TKBRZx7NC/h91fiPHga4rRswGbP3GL Y3ZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gj24si4797507ejb.139.2020.06.24.09.05.47; Wed, 24 Jun 2020 09:06:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404682AbgFXQF3 (ORCPT + 99 others); Wed, 24 Jun 2020 12:05:29 -0400 Received: from mga18.intel.com ([134.134.136.126]:2419 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404503AbgFXQF3 (ORCPT ); Wed, 24 Jun 2020 12:05:29 -0400 IronPort-SDR: s0yWpK82lRo4MREWLCwZtXvulRO5AVKiPrWY74zFV8jnx/ixDJ4CP22Coz1dPKQyRQcuzZsR35 aP23A1KppFqw== X-IronPort-AV: E=McAfee;i="6000,8403,9662"; a="131956387" X-IronPort-AV: E=Sophos;i="5.75,275,1589266800"; d="scan'208";a="131956387" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2020 09:05:28 -0700 IronPort-SDR: Xaxzl8waK90AozKfIeCdD7dRFk0jFr33uE8BYTqVtLyeJ48U1IjcznpR4D+PWsHO8KGGer7JJj K6F1+dwW8c/Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,275,1589266800"; d="scan'208";a="385208447" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.73]) ([10.237.72.73]) by fmsmga001.fm.intel.com with ESMTP; 24 Jun 2020 09:05:25 -0700 Subject: Re: [PATCH] [perf] intel_pt_recording_options: Remove redundant intel_pt_evsel null check To: Gaurav Singh , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Mathieu Poirier , Ian Rogers , "open list:PERFORMANCE EVENTS SUBSYSTEM" References: <20200623234905.18608-1-gaurav1086@gmail.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <39a03e45-472c-c7ef-76f8-e36a714d62bf@intel.com> Date: Wed, 24 Jun 2020 19:04:50 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <20200623234905.18608-1-gaurav1086@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Acked-by: Adrian Hunter > --- > 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) { >