linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf tools: Update OpenCSD to v1.0.0
@ 2021-01-08 14:27 James Clark
  2021-01-08 18:09 ` Mike Leach
  2021-01-11 16:56 ` Mathieu Poirier
  0 siblings, 2 replies; 4+ messages in thread
From: James Clark @ 2021-01-08 14:27 UTC (permalink / raw)
  To: linux-arm-kernel, linux-kernel, linux-perf-users, coresight
  Cc: James Clark, John Garry, Will Deacon, Mathieu Poirier, Leo Yan,
	Suzuki K Poulose, Mike Leach, Al Grant, Peter Zijlstra,
	Ingo Molnar, Arnaldo Carvalho de Melo, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim

Replace the OCSD_INSTR switch statement with an if to
fix compilation error about unhandled values and avoid
this issue again in the future.

Add new OCSD_GEN_TRC_ELEM_SYNC_MARKER and
OCSD_GEN_TRC_ELEM_MEMTRANS enum values to fix unhandled
value compilation error. Currently they are ignored.

Increase the minimum version number to v1.0.0 now
that new enum values are used that are only present
in this version.

Signed-off-by: James Clark <james.clark@arm.com>
Cc: John Garry <john.garry@huawei.com>
Cc: Will Deacon <will@kernel.org>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Leo Yan <leo.yan@linaro.org>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Al Grant <al.grant@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
---
 tools/build/feature/test-libopencsd.c           |  4 ++--
 tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 15 ++++-----------
 2 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/tools/build/feature/test-libopencsd.c b/tools/build/feature/test-libopencsd.c
index 1547bc2c0950..52c790b0317b 100644
--- a/tools/build/feature/test-libopencsd.c
+++ b/tools/build/feature/test-libopencsd.c
@@ -4,9 +4,9 @@
 /*
  * Check OpenCSD library version is sufficient to provide required features
  */
-#define OCSD_MIN_VER ((0 << 16) | (14 << 8) | (0))
+#define OCSD_MIN_VER ((1 << 16) | (0 << 8) | (0))
 #if !defined(OCSD_VER_NUM) || (OCSD_VER_NUM < OCSD_MIN_VER)
-#error "OpenCSD >= 0.14.0 is required"
+#error "OpenCSD >= 1.0.0 is required"
 #endif
 
 int main(void)
diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
index cd007cc9c283..3f4bc4050477 100644
--- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
+++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
@@ -419,19 +419,10 @@ cs_etm_decoder__buffer_range(struct cs_etm_queue *etmq,
 	packet->last_instr_subtype = elem->last_i_subtype;
 	packet->last_instr_cond = elem->last_instr_cond;
 
-	switch (elem->last_i_type) {
-	case OCSD_INSTR_BR:
-	case OCSD_INSTR_BR_INDIRECT:
+	if (elem->last_i_type == OCSD_INSTR_BR || elem->last_i_type == OCSD_INSTR_BR_INDIRECT)
 		packet->last_instr_taken_branch = elem->last_instr_exec;
-		break;
-	case OCSD_INSTR_ISB:
-	case OCSD_INSTR_DSB_DMB:
-	case OCSD_INSTR_WFI_WFE:
-	case OCSD_INSTR_OTHER:
-	default:
+	else
 		packet->last_instr_taken_branch = false;
-		break;
-	}
 
 	packet->last_instr_size = elem->last_instr_sz;
 
@@ -572,6 +563,8 @@ static ocsd_datapath_resp_t cs_etm_decoder__gen_trace_elem_printer(
 	case OCSD_GEN_TRC_ELEM_EVENT:
 	case OCSD_GEN_TRC_ELEM_SWTRACE:
 	case OCSD_GEN_TRC_ELEM_CUSTOM:
+	case OCSD_GEN_TRC_ELEM_SYNC_MARKER:
+	case OCSD_GEN_TRC_ELEM_MEMTRANS:
 	default:
 		break;
 	}
-- 
2.28.0


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

* Re: [PATCH] perf tools: Update OpenCSD to v1.0.0
  2021-01-08 14:27 [PATCH] perf tools: Update OpenCSD to v1.0.0 James Clark
@ 2021-01-08 18:09 ` Mike Leach
  2021-01-11 16:56 ` Mathieu Poirier
  1 sibling, 0 replies; 4+ messages in thread
From: Mike Leach @ 2021-01-08 18:09 UTC (permalink / raw)
  To: James Clark
  Cc: linux-arm-kernel, Linux Kernel Mailing List, linux-perf-users,
	Coresight ML, John Garry, Will Deacon, Mathieu Poirier, Leo Yan,
	Suzuki K Poulose, Al Grant, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Mark Rutland, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim

Hi James,

I have tested this with OpenCSD v1.0.0 + Linux 5.11-rc2.

Reviewed-by: Mike Leach <mike.leach@linaro.org>
Tested-by: Mike Leach <mike.leach@linaro.org>

On Fri, 8 Jan 2021 at 14:28, James Clark <james.clark@arm.com> wrote:
>
> Replace the OCSD_INSTR switch statement with an if to
> fix compilation error about unhandled values and avoid
> this issue again in the future.
>
> Add new OCSD_GEN_TRC_ELEM_SYNC_MARKER and
> OCSD_GEN_TRC_ELEM_MEMTRANS enum values to fix unhandled
> value compilation error. Currently they are ignored.
>
> Increase the minimum version number to v1.0.0 now
> that new enum values are used that are only present
> in this version.
>
> Signed-off-by: James Clark <james.clark@arm.com>
> Cc: John Garry <john.garry@huawei.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> Cc: Leo Yan <leo.yan@linaro.org>
> Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
> Cc: Mike Leach <mike.leach@linaro.org>
> Cc: Al Grant <al.grant@arm.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> Cc: Jiri Olsa <jolsa@redhat.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> ---
>  tools/build/feature/test-libopencsd.c           |  4 ++--
>  tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 15 ++++-----------
>  2 files changed, 6 insertions(+), 13 deletions(-)
>
> diff --git a/tools/build/feature/test-libopencsd.c b/tools/build/feature/test-libopencsd.c
> index 1547bc2c0950..52c790b0317b 100644
> --- a/tools/build/feature/test-libopencsd.c
> +++ b/tools/build/feature/test-libopencsd.c
> @@ -4,9 +4,9 @@
>  /*
>   * Check OpenCSD library version is sufficient to provide required features
>   */
> -#define OCSD_MIN_VER ((0 << 16) | (14 << 8) | (0))
> +#define OCSD_MIN_VER ((1 << 16) | (0 << 8) | (0))
>  #if !defined(OCSD_VER_NUM) || (OCSD_VER_NUM < OCSD_MIN_VER)
> -#error "OpenCSD >= 0.14.0 is required"
> +#error "OpenCSD >= 1.0.0 is required"
>  #endif
>
>  int main(void)
> diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
> index cd007cc9c283..3f4bc4050477 100644
> --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
> +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
> @@ -419,19 +419,10 @@ cs_etm_decoder__buffer_range(struct cs_etm_queue *etmq,
>         packet->last_instr_subtype = elem->last_i_subtype;
>         packet->last_instr_cond = elem->last_instr_cond;
>
> -       switch (elem->last_i_type) {
> -       case OCSD_INSTR_BR:
> -       case OCSD_INSTR_BR_INDIRECT:
> +       if (elem->last_i_type == OCSD_INSTR_BR || elem->last_i_type == OCSD_INSTR_BR_INDIRECT)
>                 packet->last_instr_taken_branch = elem->last_instr_exec;
> -               break;
> -       case OCSD_INSTR_ISB:
> -       case OCSD_INSTR_DSB_DMB:
> -       case OCSD_INSTR_WFI_WFE:
> -       case OCSD_INSTR_OTHER:
> -       default:
> +       else
>                 packet->last_instr_taken_branch = false;
> -               break;
> -       }
>
>         packet->last_instr_size = elem->last_instr_sz;
>
> @@ -572,6 +563,8 @@ static ocsd_datapath_resp_t cs_etm_decoder__gen_trace_elem_printer(
>         case OCSD_GEN_TRC_ELEM_EVENT:
>         case OCSD_GEN_TRC_ELEM_SWTRACE:
>         case OCSD_GEN_TRC_ELEM_CUSTOM:
> +       case OCSD_GEN_TRC_ELEM_SYNC_MARKER:
> +       case OCSD_GEN_TRC_ELEM_MEMTRANS:
>         default:
>                 break;
>         }
> --
> 2.28.0
>


--
Mike Leach
Principal Engineer, ARM Ltd.
Manchester Design Centre. UK

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

* Re: [PATCH] perf tools: Update OpenCSD to v1.0.0
  2021-01-08 14:27 [PATCH] perf tools: Update OpenCSD to v1.0.0 James Clark
  2021-01-08 18:09 ` Mike Leach
@ 2021-01-11 16:56 ` Mathieu Poirier
  2021-01-15 19:13   ` Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 4+ messages in thread
From: Mathieu Poirier @ 2021-01-11 16:56 UTC (permalink / raw)
  To: James Clark, acme
  Cc: linux-arm-kernel, linux-kernel, linux-perf-users, coresight,
	John Garry, Will Deacon, Leo Yan, Suzuki K Poulose, Mike Leach,
	Al Grant, Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim

On Fri, Jan 08, 2021 at 04:27:52PM +0200, James Clark wrote:
> Replace the OCSD_INSTR switch statement with an if to
> fix compilation error about unhandled values and avoid
> this issue again in the future.
> 
> Add new OCSD_GEN_TRC_ELEM_SYNC_MARKER and
> OCSD_GEN_TRC_ELEM_MEMTRANS enum values to fix unhandled
> value compilation error. Currently they are ignored.
> 
> Increase the minimum version number to v1.0.0 now
> that new enum values are used that are only present
> in this version.
> 
> Signed-off-by: James Clark <james.clark@arm.com>
> Cc: John Garry <john.garry@huawei.com>
> Cc: Will Deacon <will@kernel.org>
> Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> Cc: Leo Yan <leo.yan@linaro.org>
> Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
> Cc: Mike Leach <mike.leach@linaro.org>
> Cc: Al Grant <al.grant@arm.com>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> Cc: Jiri Olsa <jolsa@redhat.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> ---
>  tools/build/feature/test-libopencsd.c           |  4 ++--
>  tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 15 ++++-----------
>  2 files changed, 6 insertions(+), 13 deletions(-)
> 
> diff --git a/tools/build/feature/test-libopencsd.c b/tools/build/feature/test-libopencsd.c
> index 1547bc2c0950..52c790b0317b 100644
> --- a/tools/build/feature/test-libopencsd.c
> +++ b/tools/build/feature/test-libopencsd.c
> @@ -4,9 +4,9 @@
>  /*
>   * Check OpenCSD library version is sufficient to provide required features
>   */
> -#define OCSD_MIN_VER ((0 << 16) | (14 << 8) | (0))
> +#define OCSD_MIN_VER ((1 << 16) | (0 << 8) | (0))
>  #if !defined(OCSD_VER_NUM) || (OCSD_VER_NUM < OCSD_MIN_VER)
> -#error "OpenCSD >= 0.14.0 is required"
> +#error "OpenCSD >= 1.0.0 is required"
>  #endif
>  
>  int main(void)
> diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
> index cd007cc9c283..3f4bc4050477 100644
> --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
> +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
> @@ -419,19 +419,10 @@ cs_etm_decoder__buffer_range(struct cs_etm_queue *etmq,
>  	packet->last_instr_subtype = elem->last_i_subtype;
>  	packet->last_instr_cond = elem->last_instr_cond;
>  
> -	switch (elem->last_i_type) {
> -	case OCSD_INSTR_BR:
> -	case OCSD_INSTR_BR_INDIRECT:
> +	if (elem->last_i_type == OCSD_INSTR_BR || elem->last_i_type == OCSD_INSTR_BR_INDIRECT)
>  		packet->last_instr_taken_branch = elem->last_instr_exec;
> -		break;
> -	case OCSD_INSTR_ISB:
> -	case OCSD_INSTR_DSB_DMB:
> -	case OCSD_INSTR_WFI_WFE:
> -	case OCSD_INSTR_OTHER:
> -	default:
> +	else
>  		packet->last_instr_taken_branch = false;
> -		break;
> -	}
>  
>  	packet->last_instr_size = elem->last_instr_sz;
>  
> @@ -572,6 +563,8 @@ static ocsd_datapath_resp_t cs_etm_decoder__gen_trace_elem_printer(
>  	case OCSD_GEN_TRC_ELEM_EVENT:
>  	case OCSD_GEN_TRC_ELEM_SWTRACE:
>  	case OCSD_GEN_TRC_ELEM_CUSTOM:
> +	case OCSD_GEN_TRC_ELEM_SYNC_MARKER:
> +	case OCSD_GEN_TRC_ELEM_MEMTRANS:
>  	default:
>  		break;

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

Arnaldo please consider.

Thanks,
Mathieu

>  	}
> -- 
> 2.28.0
> 

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

* Re: [PATCH] perf tools: Update OpenCSD to v1.0.0
  2021-01-11 16:56 ` Mathieu Poirier
@ 2021-01-15 19:13   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2021-01-15 19:13 UTC (permalink / raw)
  To: Mathieu Poirier
  Cc: James Clark, linux-arm-kernel, linux-kernel, linux-perf-users,
	coresight, John Garry, Will Deacon, Leo Yan, Suzuki K Poulose,
	Mike Leach, Al Grant, Peter Zijlstra, Ingo Molnar, Mark Rutland,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim

Em Mon, Jan 11, 2021 at 09:56:04AM -0700, Mathieu Poirier escreveu:
> On Fri, Jan 08, 2021 at 04:27:52PM +0200, James Clark wrote:
> > Replace the OCSD_INSTR switch statement with an if to
> > fix compilation error about unhandled values and avoid
> > this issue again in the future.
> > 
> > Add new OCSD_GEN_TRC_ELEM_SYNC_MARKER and
> > OCSD_GEN_TRC_ELEM_MEMTRANS enum values to fix unhandled
> > value compilation error. Currently they are ignored.
> > 
> > Increase the minimum version number to v1.0.0 now
> > that new enum values are used that are only present
> > in this version.
> > 
> > Signed-off-by: James Clark <james.clark@arm.com>
> > Cc: John Garry <john.garry@huawei.com>
> > Cc: Will Deacon <will@kernel.org>
> > Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> > Cc: Leo Yan <leo.yan@linaro.org>
> > Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
> > Cc: Mike Leach <mike.leach@linaro.org>
> > Cc: Al Grant <al.grant@arm.com>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Cc: Ingo Molnar <mingo@redhat.com>
> > Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
> > Cc: Mark Rutland <mark.rutland@arm.com>
> > Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> > Cc: Jiri Olsa <jolsa@redhat.com>
> > Cc: Namhyung Kim <namhyung@kernel.org>
> > ---
> >  tools/build/feature/test-libopencsd.c           |  4 ++--
> >  tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 15 ++++-----------
> >  2 files changed, 6 insertions(+), 13 deletions(-)
> > 
> > diff --git a/tools/build/feature/test-libopencsd.c b/tools/build/feature/test-libopencsd.c
> > index 1547bc2c0950..52c790b0317b 100644
> > --- a/tools/build/feature/test-libopencsd.c
> > +++ b/tools/build/feature/test-libopencsd.c
> > @@ -4,9 +4,9 @@
> >  /*
> >   * Check OpenCSD library version is sufficient to provide required features
> >   */
> > -#define OCSD_MIN_VER ((0 << 16) | (14 << 8) | (0))
> > +#define OCSD_MIN_VER ((1 << 16) | (0 << 8) | (0))
> >  #if !defined(OCSD_VER_NUM) || (OCSD_VER_NUM < OCSD_MIN_VER)
> > -#error "OpenCSD >= 0.14.0 is required"
> > +#error "OpenCSD >= 1.0.0 is required"
> >  #endif
> >  
> >  int main(void)
> > diff --git a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
> > index cd007cc9c283..3f4bc4050477 100644
> > --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
> > +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
> > @@ -419,19 +419,10 @@ cs_etm_decoder__buffer_range(struct cs_etm_queue *etmq,
> >  	packet->last_instr_subtype = elem->last_i_subtype;
> >  	packet->last_instr_cond = elem->last_instr_cond;
> >  
> > -	switch (elem->last_i_type) {
> > -	case OCSD_INSTR_BR:
> > -	case OCSD_INSTR_BR_INDIRECT:
> > +	if (elem->last_i_type == OCSD_INSTR_BR || elem->last_i_type == OCSD_INSTR_BR_INDIRECT)
> >  		packet->last_instr_taken_branch = elem->last_instr_exec;
> > -		break;
> > -	case OCSD_INSTR_ISB:
> > -	case OCSD_INSTR_DSB_DMB:
> > -	case OCSD_INSTR_WFI_WFE:
> > -	case OCSD_INSTR_OTHER:
> > -	default:
> > +	else
> >  		packet->last_instr_taken_branch = false;
> > -		break;
> > -	}
> >  
> >  	packet->last_instr_size = elem->last_instr_sz;
> >  
> > @@ -572,6 +563,8 @@ static ocsd_datapath_resp_t cs_etm_decoder__gen_trace_elem_printer(
> >  	case OCSD_GEN_TRC_ELEM_EVENT:
> >  	case OCSD_GEN_TRC_ELEM_SWTRACE:
> >  	case OCSD_GEN_TRC_ELEM_CUSTOM:
> > +	case OCSD_GEN_TRC_ELEM_SYNC_MARKER:
> > +	case OCSD_GEN_TRC_ELEM_MEMTRANS:
> >  	default:
> >  		break;
> 
> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> 
> Arnaldo please consider.

Thanks, applied.

- Arnaldo


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

end of thread, other threads:[~2021-01-15 19:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-08 14:27 [PATCH] perf tools: Update OpenCSD to v1.0.0 James Clark
2021-01-08 18:09 ` Mike Leach
2021-01-11 16:56 ` Mathieu Poirier
2021-01-15 19:13   ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).