From: Gaurav Singh <gaurav1086@gmail.com>
To: gaurav1086@gmail.com, Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
Ian Rogers <irogers@google.com>,
linux-kernel@vger.kernel.org (open list:PERFORMANCE EVENTS
SUBSYSTEM)
Subject: [PATCH] [perf] intel_pt_recording_options: Remove redundant intel_pt_evsel null check
Date: Tue, 23 Jun 2020 19:48:50 -0400 [thread overview]
Message-ID: <20200623234905.18608-1-gaurav1086@gmail.com> (raw)
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>
---
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) {
--
2.17.1
next reply other threads:[~2020-06-23 23:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-23 23:48 Gaurav Singh [this message]
2020-06-24 12:42 ` [PATCH] [perf] intel_pt_recording_options: Remove redundant intel_pt_evsel null check Jiri Olsa
2020-06-24 16:05 ` Adrian Hunter
2020-06-24 16:04 ` Adrian Hunter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200623234905.18608-1-gaurav1086@gmail.com \
--to=gaurav1086@gmail.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.poirier@linaro.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox