All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] perf coresight: Remove superfluous check before use
@ 2017-06-15 17:55 ` Kim Phillips
  0 siblings, 0 replies; 7+ messages in thread
From: Kim Phillips @ 2017-06-15 17:55 UTC (permalink / raw)
  To: linux-arm-kernel

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] perf coresight: Remove superfluous check before use
@ 2017-06-15 17:55 ` Kim Phillips
  0 siblings, 0 replies; 7+ messages in thread
From: Kim Phillips @ 2017-06-15 17:55 UTC (permalink / raw)
  To: Mathieu Poirier, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin
  Cc: linux-arm-kernel, linux-kernel

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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] perf coresight: Remove superfluous check before use
  2017-06-15 17:55 ` Kim Phillips
@ 2017-06-16 14:31   ` Mathieu Poirier
  -1 siblings, 0 replies; 7+ messages in thread
From: Mathieu Poirier @ 2017-06-16 14:31 UTC (permalink / raw)
  To: linux-arm-kernel

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
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] perf coresight: Remove superfluous check before use
@ 2017-06-16 14:31   ` Mathieu Poirier
  0 siblings, 0 replies; 7+ messages in thread
From: Mathieu Poirier @ 2017-06-16 14:31 UTC (permalink / raw)
  To: Kim Phillips
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Alexander Shishkin, linux-arm-kernel, linux-kernel

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
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/2] perf coresight: Remove superfluous check before use
  2017-06-16 14:31   ` Mathieu Poirier
@ 2017-06-16 16:13     ` Arnaldo Carvalho de Melo
  -1 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-06-16 16:13 UTC (permalink / raw)
  To: linux-arm-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] perf coresight: Remove superfluous check before use
@ 2017-06-16 16:13     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2017-06-16 16:13 UTC (permalink / raw)
  To: Mathieu Poirier
  Cc: Kim Phillips, Peter Zijlstra, Ingo Molnar, Alexander Shishkin,
	linux-arm-kernel, linux-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [tip:perf/core] perf coresight: Remove superfluous check before use
  2017-06-15 17:55 ` Kim Phillips
  (?)
  (?)
@ 2017-06-20  9:01 ` tip-bot for Kim Phillips
  -1 siblings, 0 replies; 7+ messages in thread
From: tip-bot for Kim Phillips @ 2017-06-20  9:01 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: kim.phillips, mathieu.poirier, tglx, hpa, mingo, linux-kernel,
	peterz, alexander.shishkin, acme

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) {

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-06-20  9:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-15 17:55 [PATCH 2/2] perf coresight: Remove superfluous check before use Kim Phillips
2017-06-15 17:55 ` Kim Phillips
2017-06-16 14:31 ` Mathieu Poirier
2017-06-16 14:31   ` Mathieu Poirier
2017-06-16 16:13   ` Arnaldo Carvalho de Melo
2017-06-16 16:13     ` Arnaldo Carvalho de Melo
2017-06-20  9:01 ` [tip:perf/core] " tip-bot for Kim Phillips

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.