perf coresight: Remove superfluous check before use
PATCH 2/2 perf coresight: Remove superfluous check before use
cs_etm_evsel is guaranteed to be set at this point in the function.
Signed-off-by Kim Phillips <[email protected]>
--- tools/perf/arch/arm/util/cs-etm.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-)
tools/perf/arch/arm/util/cs-etm.c +12 -13
@@ -202,19 +202,18 @@ static int cs_etm_recording_options(struct auxtrace_record *itr,pr_debug2 ("%s snapshot size: %zu\n" ,CORESIGHT_ETM_PMU_NAME , opts->auxtrace_snapshot_size); -if (cs_etm_evsel) { -/* -* To obtain the auxtrace buffer file descriptor, the auxtrace -* event must come first. -*/ -perf_evlist__to_front (evlist, cs_etm_evsel); -/* -* In the case of per-cpu mmaps, we need the CPU on the -* AUX event. -*/ -if (!cpu_map__empty (cpus)) -perf_evsel__set_sample_bit (cs_etm_evsel,CPU ); - } +/* +* To obtain the auxtrace buffer file descriptor, the auxtrace +* event must come first. +*/ +perf_evlist__to_front (evlist, cs_etm_evsel); + +/* +* In the case of per-cpu mmaps, we need the CPU on the +* AUX event. +*/ +if (!cpu_map__empty (cpus)) +perf_evsel__set_sample_bit (cs_etm_evsel,CPU );/* Add dummy event to keep tracking */ if (opts->full_auxtrace) {
Signature · 1 line
2.11.0
Quoted 30 lines · Kim Phillips
cs_etm_evselis guaranteed to be set at this point in the function.Signed-off-by Kim Phillips <[email protected]>--- tools/perf/arch/arm/util/cs-etm.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-)tools/perf/arch/arm/util/cs-etm.c +2
-13@@ -202,19 +202,18 @@ static int cs_etm_recording_options(struct auxtrace_record *itr,pr_debug2 ("%s snapshot size: %zu\n" ,CORESIGHT_ETM_PMU_NAME , opts->auxtrace_snapshot_size); -if (cs_etm_evsel) { -/* -* To obtain the auxtrace buffer file descriptor, the auxtrace -* event must come first. -*/ -perf_evlist__to_front (evlist, cs_etm_evsel); -/* -* In the case of per-cpu mmaps, we need the CPU on the -* AUX event. -*/ -if (!cpu_map__empty (cpus)) -perf_evsel__set_sample_bit (cs_etm_evsel,CPU ); - } +/* +* To obtain the auxtrace buffer file descriptor, the auxtrace
tools/perf/arch/arm/util/cs-etm.c static int cs_etm_recording_options(struct auxtrace_record *itr, · line 216
Quoted 10 lines
tools/perf/arch/arm/util/cs-etm.c +10
-0+* event must come first. +*/ +perf_evlist__to_front (evlist, cs_etm_evsel); + +/* +* In the case of per-cpu mmaps, we need the CPU on the +* AUX event. +*/ +if (!cpu_map__empty (cpus)) +perf_evsel__set_sample_bit (cs_etm_evsel,CPU );
Acked-by Mathieu Poirier <[email protected]>
Quoted 6 lines
tools/perf/arch/arm/util/cs-etm.c +0
-0/* Add dummy event to keep tracking */ if (opts->full_auxtrace) {Signature · 1 line
2.11.0
Em Fri, Jun 16, 2017 at 08:31:25AM -0600, Mathieu Poirier escreveu:
Quoted 5 lines · Kim Phillips
Quoted 2 lines
cs_etm_evselis guaranteed to be set at this point in the function.Acked-by Mathieu Poirier <[email protected]>
Thanks, applied.
- Arnaldo
tip-bot for Kim Phillips
merge botperf coresight: Remove superfluous check before use
Commit-ID: 0c788d4726c916544490c17cdbfd1ae2a6347fa8 Gitweb: http://git.kernel.org/tip/0c788d4726c916544490c17cdbfd1ae2a6347fa8 Author: Kim Phillips <[email protected]> AuthorDate: Thu, 15 Jun 2017 12:55:21 -0500 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Mon, 19 Jun 2017 15:27:08 -0300
perf coresight: Remove superfluous check before use
The cs_etm_evsel variable is guaranteed to be set at this point in cs_etm_recording_options().
Signed-off-by Kim Phillips <[email protected]>
Acked-by Mathieu Poirier <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Peter Zijlstra <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- tools/perf/arch/arm/util/cs-etm.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-)
tools/perf/arch/arm/util/cs-etm.c +12 -13
@@ -203,19 +203,18 @@ static int cs_etm_recording_options(struct auxtrace_record *itr,pr_debug2 ("%s snapshot size: %zu\n" ,CORESIGHT_ETM_PMU_NAME , opts->auxtrace_snapshot_size); -if (cs_etm_evsel) { -/* -* To obtain the auxtrace buffer file descriptor, the auxtrace -* event must come first. -*/ -perf_evlist__to_front (evlist, cs_etm_evsel); -/* -* In the case of per-cpu mmaps, we need the CPU on the -* AUX event. -*/ -if (!cpu_map__empty (cpus)) -perf_evsel__set_sample_bit (cs_etm_evsel,CPU ); - } +/* +* To obtain the auxtrace buffer file descriptor, the auxtrace +* event must come first. +*/ +perf_evlist__to_front (evlist, cs_etm_evsel); + +/* +* In the case of per-cpu mmaps, we need the CPU on the +* AUX event. +*/ +if (!cpu_map__empty (cpus)) +perf_evsel__set_sample_bit (cs_etm_evsel,CPU );/* Add dummy event to keep tracking */ if (opts->full_auxtrace) {