linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf: cs-etm: Update decoder code for OpenCSD version 1.4
@ 2023-01-20 15:37 Mike Leach
  2023-01-20 15:47 ` James Clark
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Leach @ 2023-01-20 15:37 UTC (permalink / raw)
  To: linux-perf-users
  Cc: acme, linux-arm-kernel, coresight, leo.yan, mathieu.poirier,
	suzuki.poulose, linux-kernel, peterz, mingo, mark.rutland,
	alexander.shishkin, jolsa, namhyung, Mike Leach

OpenCSD version 1.4 is released with support for FEAT_ITE.
This adds a new packet type, with associated output element ID in
the packet type enum - OCSD_GEN_TRC_ELEM_INSTRUMENTATION.

As we just ignore this packet in perf, add to the switch statement
to avoid the "enum not handled in switch error", but conditionally
so as not to break the perf build for older OpenCSD installations.

Signed-off-by: Mike Leach <mike.leach@linaro.org>
---
 tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 3 +++
 1 file changed, 3 insertions(+)

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 fa3aa9c0fb2e..48e7121880a9 100644
--- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
+++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
@@ -604,6 +604,9 @@ static ocsd_datapath_resp_t cs_etm_decoder__gen_trace_elem_printer(
 	case OCSD_GEN_TRC_ELEM_CUSTOM:
 	case OCSD_GEN_TRC_ELEM_SYNC_MARKER:
 	case OCSD_GEN_TRC_ELEM_MEMTRANS:
+#if (OCSD_VER_NUM >= 0x010400)
+	case OCSD_GEN_TRC_ELEM_INSTRUMENTATION:
+#endif
 	default:
 		break;
 	}
-- 
2.17.1


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

* Re: [PATCH] perf: cs-etm: Update decoder code for OpenCSD version 1.4
  2023-01-20 15:37 [PATCH] perf: cs-etm: Update decoder code for OpenCSD version 1.4 Mike Leach
@ 2023-01-20 15:47 ` James Clark
  2023-01-24 21:50   ` Ian Rogers
  0 siblings, 1 reply; 5+ messages in thread
From: James Clark @ 2023-01-20 15:47 UTC (permalink / raw)
  To: Mike Leach, linux-perf-users
  Cc: acme, linux-arm-kernel, coresight, mathieu.poirier, linux-kernel,
	peterz, mingo, mark.rutland, alexander.shishkin, jolsa, namhyung



On 20/01/2023 15:37, Mike Leach wrote:
> OpenCSD version 1.4 is released with support for FEAT_ITE.
> This adds a new packet type, with associated output element ID in
> the packet type enum - OCSD_GEN_TRC_ELEM_INSTRUMENTATION.
> 
> As we just ignore this packet in perf, add to the switch statement
> to avoid the "enum not handled in switch error", but conditionally
> so as not to break the perf build for older OpenCSD installations.
> 
> Signed-off-by: Mike Leach <mike.leach@linaro.org>
> ---
>  tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> 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 fa3aa9c0fb2e..48e7121880a9 100644
> --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
> +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
> @@ -604,6 +604,9 @@ static ocsd_datapath_resp_t cs_etm_decoder__gen_trace_elem_printer(
>  	case OCSD_GEN_TRC_ELEM_CUSTOM:
>  	case OCSD_GEN_TRC_ELEM_SYNC_MARKER:
>  	case OCSD_GEN_TRC_ELEM_MEMTRANS:
> +#if (OCSD_VER_NUM >= 0x010400)
> +	case OCSD_GEN_TRC_ELEM_INSTRUMENTATION:
> +#endif
>  	default:
>  		break;
>  	}

Checked the build with both old and new versions of OpenCSD and it's ok:

Reviewed-by: James Clark <james.clark@arm.com>

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

* Re: [PATCH] perf: cs-etm: Update decoder code for OpenCSD version 1.4
  2023-01-20 15:47 ` James Clark
@ 2023-01-24 21:50   ` Ian Rogers
  2023-01-30 12:05     ` James Clark
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Rogers @ 2023-01-24 21:50 UTC (permalink / raw)
  To: James Clark
  Cc: Mike Leach, linux-perf-users, acme, linux-arm-kernel, coresight,
	mathieu.poirier, linux-kernel, peterz, mingo, mark.rutland,
	alexander.shishkin, jolsa, namhyung

On Fri, Jan 20, 2023 at 7:47 AM James Clark <james.clark@arm.com> wrote:
>
>
>
> On 20/01/2023 15:37, Mike Leach wrote:
> > OpenCSD version 1.4 is released with support for FEAT_ITE.
> > This adds a new packet type, with associated output element ID in
> > the packet type enum - OCSD_GEN_TRC_ELEM_INSTRUMENTATION.
> >
> > As we just ignore this packet in perf, add to the switch statement
> > to avoid the "enum not handled in switch error", but conditionally
> > so as not to break the perf build for older OpenCSD installations.
> >
> > Signed-off-by: Mike Leach <mike.leach@linaro.org>
> > ---
> >  tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > 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 fa3aa9c0fb2e..48e7121880a9 100644
> > --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
> > +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
> > @@ -604,6 +604,9 @@ static ocsd_datapath_resp_t cs_etm_decoder__gen_trace_elem_printer(
> >       case OCSD_GEN_TRC_ELEM_CUSTOM:
> >       case OCSD_GEN_TRC_ELEM_SYNC_MARKER:
> >       case OCSD_GEN_TRC_ELEM_MEMTRANS:
> > +#if (OCSD_VER_NUM >= 0x010400)
> > +     case OCSD_GEN_TRC_ELEM_INSTRUMENTATION:
> > +#endif
> >       default:
> >               break;
> >       }
>
> Checked the build with both old and new versions of OpenCSD and it's ok:
>
> Reviewed-by: James Clark <james.clark@arm.com>

Acked-by: Ian Rogers <irogers@google.com>

Thanks,
Ian

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

* Re: [PATCH] perf: cs-etm: Update decoder code for OpenCSD version 1.4
  2023-01-24 21:50   ` Ian Rogers
@ 2023-01-30 12:05     ` James Clark
  2023-01-30 13:59       ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 5+ messages in thread
From: James Clark @ 2023-01-30 12:05 UTC (permalink / raw)
  To: acme@kernel.org
  Cc: Mike Leach, linux-perf-users, linux-arm-kernel, coresight,
	mathieu.poirier, linux-kernel, peterz, mingo, mark.rutland,
	alexander.shishkin, jolsa, namhyung, Ian Rogers



On 24/01/2023 21:50, Ian Rogers wrote:
> On Fri, Jan 20, 2023 at 7:47 AM James Clark <james.clark@arm.com> wrote:
>>
>>
>>
>> On 20/01/2023 15:37, Mike Leach wrote:
>>> OpenCSD version 1.4 is released with support for FEAT_ITE.
>>> This adds a new packet type, with associated output element ID in
>>> the packet type enum - OCSD_GEN_TRC_ELEM_INSTRUMENTATION.
>>>
>>> As we just ignore this packet in perf, add to the switch statement
>>> to avoid the "enum not handled in switch error", but conditionally
>>> so as not to break the perf build for older OpenCSD installations.
>>>
>>> Signed-off-by: Mike Leach <mike.leach@linaro.org>
>>> ---
>>>  tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 3 +++
>>>  1 file changed, 3 insertions(+)
>>>
>>> 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 fa3aa9c0fb2e..48e7121880a9 100644
>>> --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
>>> +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
>>> @@ -604,6 +604,9 @@ static ocsd_datapath_resp_t cs_etm_decoder__gen_trace_elem_printer(
>>>       case OCSD_GEN_TRC_ELEM_CUSTOM:
>>>       case OCSD_GEN_TRC_ELEM_SYNC_MARKER:
>>>       case OCSD_GEN_TRC_ELEM_MEMTRANS:
>>> +#if (OCSD_VER_NUM >= 0x010400)
>>> +     case OCSD_GEN_TRC_ELEM_INSTRUMENTATION:
>>> +#endif
>>>       default:
>>>               break;
>>>       }
>>
>> Checked the build with both old and new versions of OpenCSD and it's ok:
>>
>> Reviewed-by: James Clark <james.clark@arm.com>
> 
> Acked-by: Ian Rogers <irogers@google.com>
> 
> Thanks,
> Ian

Hi Arnaldo,

Is it ok to merge this change? If anyone is building with the latest
OpenCSD they will get a build error on the unhandled switch case, and we
just got it in our CI too.

I suppose we could disable the warning around this switch, but it's
pretty rare to add new packets so might be best to leave it.

Thanks
James

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

* Re: [PATCH] perf: cs-etm: Update decoder code for OpenCSD version 1.4
  2023-01-30 12:05     ` James Clark
@ 2023-01-30 13:59       ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-01-30 13:59 UTC (permalink / raw)
  To: James Clark
  Cc: Mike Leach, linux-perf-users, linux-arm-kernel, coresight,
	mathieu.poirier, linux-kernel, peterz, mingo, mark.rutland,
	alexander.shishkin, jolsa, namhyung, Ian Rogers

Em Mon, Jan 30, 2023 at 12:05:53PM +0000, James Clark escreveu:
> On 24/01/2023 21:50, Ian Rogers wrote:
> > On Fri, Jan 20, 2023 at 7:47 AM James Clark <james.clark@arm.com> wrote:
> >> On 20/01/2023 15:37, Mike Leach wrote:
> >>> OpenCSD version 1.4 is released with support for FEAT_ITE.
> >>> This adds a new packet type, with associated output element ID in
> >>> the packet type enum - OCSD_GEN_TRC_ELEM_INSTRUMENTATION.
> >>>
> >>> As we just ignore this packet in perf, add to the switch statement
> >>> to avoid the "enum not handled in switch error", but conditionally
> >>> so as not to break the perf build for older OpenCSD installations.
> >>>
> >>> Signed-off-by: Mike Leach <mike.leach@linaro.org>
> >>> ---
> >>>  tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 3 +++
> >>>  1 file changed, 3 insertions(+)
> >>>
> >>> 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 fa3aa9c0fb2e..48e7121880a9 100644
> >>> --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
> >>> +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
> >>> @@ -604,6 +604,9 @@ static ocsd_datapath_resp_t cs_etm_decoder__gen_trace_elem_printer(
> >>>       case OCSD_GEN_TRC_ELEM_CUSTOM:
> >>>       case OCSD_GEN_TRC_ELEM_SYNC_MARKER:
> >>>       case OCSD_GEN_TRC_ELEM_MEMTRANS:
> >>> +#if (OCSD_VER_NUM >= 0x010400)
> >>> +     case OCSD_GEN_TRC_ELEM_INSTRUMENTATION:
> >>> +#endif
> >>>       default:
> >>>               break;
> >>>       }
> >>
> >> Checked the build with both old and new versions of OpenCSD and it's ok:
> >>
> >> Reviewed-by: James Clark <james.clark@arm.com>
> > 
> > Acked-by: Ian Rogers <irogers@google.com>
> > 
> > Thanks,
> > Ian
> 
> Hi Arnaldo,
> 
> Is it ok to merge this change? If anyone is building with the latest
> OpenCSD they will get a build error on the unhandled switch case, and we
> just got it in our CI too.
> 
> I suppose we could disable the warning around this switch, but it's
> pretty rare to add new packets so might be best to leave it.

Thanks, applied.

- Arnaldo

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

end of thread, other threads:[~2023-01-30 14:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-20 15:37 [PATCH] perf: cs-etm: Update decoder code for OpenCSD version 1.4 Mike Leach
2023-01-20 15:47 ` James Clark
2023-01-24 21:50   ` Ian Rogers
2023-01-30 12:05     ` James Clark
2023-01-30 13:59       ` 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).