Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1666950 > unrolled thread

[PATCH 2/2] perf coresight: Remove superfluous check before use

Started byKim Phillips <kim.phillips@arm.com>
First post2017-06-15 20:00 +0200
Last post2017-06-20 11:10 +0200
Articles 4 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 2/2] perf coresight: Remove superfluous check before use Kim Phillips <kim.phillips@arm.com> - 2017-06-15 20:00 +0200
    Re: [PATCH 2/2] perf coresight: Remove superfluous check before use Mathieu Poirier <mathieu.poirier@linaro.org> - 2017-06-16 16:40 +0200
      Re: [PATCH 2/2] perf coresight: Remove superfluous check before use Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-06-16 18:20 +0200
    [tip:perf/core] perf coresight: Remove superfluous check before use tip-bot for Kim Phillips <tipbot@zytor.com> - 2017-06-20 11:10 +0200

#1666950 — [PATCH 2/2] perf coresight: Remove superfluous check before use

FromKim Phillips <kim.phillips@arm.com>
Date2017-06-15 20:00 +0200
Subject[PATCH 2/2] perf coresight: Remove superfluous check before use
Message-ID<tSHdM-5vC-29@gated-at.bofh.it>
cs_etm_evsel is guaranteed to be set at this point in the function.

Signed-off-by: Kim Phillips <kim.phillips@arm.com>
---
 tools/perf/arch/arm/util/cs-etm.c | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
index 29361d9b635a..8e1e9469caf2 100644
--- a/tools/perf/arch/arm/util/cs-etm.c
+++ b/tools/perf/arch/arm/util/cs-etm.c
@@ -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) {
-- 
2.11.0

[toc] | [next] | [standalone]


#1667805

FromMathieu Poirier <mathieu.poirier@linaro.org>
Date2017-06-16 16:40 +0200
Message-ID<tT0zL-1hl-3@gated-at.bofh.it>
In reply to#1666950
On Thu, Jun 15, 2017 at 12:55:21PM -0500, Kim Phillips wrote:
> cs_etm_evsel is guaranteed to be set at this point in the function.
> 
> Signed-off-by: Kim Phillips <kim.phillips@arm.com>
> ---
>  tools/perf/arch/arm/util/cs-etm.c | 25 ++++++++++++-------------
>  1 file changed, 12 insertions(+), 13 deletions(-)
> 
> diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
> index 29361d9b635a..8e1e9469caf2 100644
> --- a/tools/perf/arch/arm/util/cs-etm.c
> +++ b/tools/perf/arch/arm/util/cs-etm.c
> @@ -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);

Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org>

>  
>  	/* Add dummy event to keep tracking */
>  	if (opts->full_auxtrace) {
> -- 
> 2.11.0
> 

[toc] | [prev] | [next] | [standalone]


#1667872

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2017-06-16 18:20 +0200
Message-ID<tT28y-2qw-21@gated-at.bofh.it>
In reply to#1667805
Em Fri, Jun 16, 2017 at 08:31:25AM -0600, Mathieu Poirier escreveu:
> On Thu, Jun 15, 2017 at 12:55:21PM -0500, Kim Phillips wrote:
> > cs_etm_evsel is guaranteed to be set at this point in the function.
> > 
> 
> Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org>

Thanks, applied.

- Arnaldo

[toc] | [prev] | [next] | [standalone]


#1670463 — [tip:perf/core] perf coresight: Remove superfluous check before use

Fromtip-bot for Kim Phillips <tipbot@zytor.com>
Date2017-06-20 11:10 +0200
Subject[tip:perf/core] perf coresight: Remove superfluous check before use
Message-ID<tUnkC-6DB-13@gated-at.bofh.it>
In reply to#1666950
Commit-ID:  0c788d4726c916544490c17cdbfd1ae2a6347fa8
Gitweb:     http://git.kernel.org/tip/0c788d4726c916544490c17cdbfd1ae2a6347fa8
Author:     Kim Phillips <kim.phillips@arm.com>
AuthorDate: Thu, 15 Jun 2017 12:55:21 -0500
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
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 <kim.phillips@arm.com>
Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: linux-arm-kernel@lists.infradead.org
Link: http://lkml.kernel.org/r/20170615125521.80cc128dc856bc1f2e61b730@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/arch/arm/util/cs-etm.c | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c
index 02a649b..7ce3d1a 100644
--- a/tools/perf/arch/arm/util/cs-etm.c
+++ b/tools/perf/arch/arm/util/cs-etm.c
@@ -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) {

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web