mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Leach <mike.leach@arm.com>
To: Leo Yan <leo.yan@arm.com>
Cc: linux-perf-users@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org,
	linux-kernel@vger.kernel.org, acme@kernel.org,
	suzuki.poulose@arm.com, peterz@infradead.org, mingo@redhat.com,
	will@kernel.org, mark.rutland@arm.com,
	alexander.shishkin@linux.intel.com, jolsa@redhat.com,
	namhyung@kernel.org, nd@arm.com
Subject: Re: [PATCH 1/2] perf: tools: cs-etm: Fix print issue for Coresight debug in ETE/TRBE trace
Date: Tue, 17 Mar 2026 15:09:24 +0000	[thread overview]
Message-ID: <17f18a05-c53a-4faa-8b3a-2540fbfe1e3d@arm.com> (raw)
In-Reply-To: <20260313144239.GM4153946@e132581.arm.com>


Hi Leo,

On 3/13/26 14:42, Leo Yan wrote:
> On Fri, Mar 13, 2026 at 01:21:28PM +0000, Mike Leach wrote:
>> Building perf with CORESIGHT=1 and the optional CSTRACE_RAW=1 enables
>> additional debug printing of raw trace data when using command:-
>> perf report --dump.
>>
>> This raw trace prints the CoreSight formatted trace frames, which may be
>> used to investigate suspected issues with trace quality / corruption /
>> decode.
>>
>> These frames are not present in ETE + TRBE trace.
>> This fix removes the unnecessary call to print these frames.
>>
>> Due to an addtional fault with the OpenCSD library, this call when ETE/TRBE
>> are being decoded will cause a segfault in perf. This fix also prevents
>> that problem for perf using older (<= 1.8.0 version) OpenCSD libraries.
> 
> Thanks for patches!
> 
>> Fixes: 68ffe3902898 ("perf tools: Add decoder mechanic to support dumping trace data")
>>
> 
> Redundant empty line.

OK

> 
>> Reported-by: Leo Yan <leo.yan@arm.com>
>> Signed-off-by: Mike Leach <mike.leach@arm.com>
>> ---
>>   tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 3 ++-
>>   1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> 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 3050fe212666..f7e89693cf16 100644
>> --- a/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
>> +++ b/tools/perf/util/cs-etm-decoder/cs-etm-decoder.c
>> @@ -739,7 +739,8 @@ cs_etm_decoder__new(int decoders, struct cs_etm_decoder_params *d_params,
>>   		goto err_free_decoder;
>>   
>>   	/* init raw frame logging if required */
>> -	cs_etm_decoder__init_raw_frame_logging(d_params, decoder);
>> +	if (format == OCSD_TRC_SRC_FRAME_FORMATTED)
>> +		cs_etm_decoder__init_raw_frame_logging(d_params, decoder);
> 
> Could we improve a bit to add checking in
> cs_etm_decoder__init_raw_frame_logging(), something like:
> 
>   cs_etm_decoder__init_raw_frame_logging(struct cs_etm_decoder_params *d_params,
>                                         struct cs_etm_decoder *decoder)
>   {
> +       /* No formatted trace frames */
> +       if (!d_params->formatted)
> +               return;
> 
> Sorry I should have mentioned this early.
> 

Looking at cs_etm_decoder__init_raw_frame_logging(), this function is 
called once, after cs_etm_decoder__init_def_logger_printing(), and 
unnecessarily repeats a bunch of init calls that are done in that 
function. The one call needed to set up the extra logging could be 
folded into cs_etm_decoder__init_def_logger_printing() with the cond 
compile and d_params checks, removing init_raw_frame_logging() completely

I'll spin up a v2 with this simplification.

Regards

Mike

>>   
>>   	for (i = 0; i < decoders; i++) {
>>   		ret = cs_etm_decoder__create_etm_decoder(d_params,
>> -- 
>> 2.43.0
>>


  reply	other threads:[~2026-03-17 15:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-13 13:21 [PATCH 0/2] perf: tools: cs-etm: Fixes for CoreSight debug dump Mike Leach
2026-03-13 13:21 ` [PATCH 1/2] perf: tools: cs-etm: Fix print issue for Coresight debug in ETE/TRBE trace Mike Leach
2026-03-13 14:42   ` Leo Yan
2026-03-17 15:09     ` Mike Leach [this message]
2026-03-13 13:21 ` [PATCH 2/2] perf: tools: cs-etm: Enhance raw Coresight trace debug display Mike Leach
2026-03-13 14:45   ` Leo Yan
2026-03-18 12:56     ` Arnaldo Carvalho de Melo
2026-03-18 18:45       ` Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17f18a05-c53a-4faa-8b3a-2540fbfe1e3d@arm.com \
    --to=mike.leach@arm.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=coresight@lists.linaro.org \
    --cc=jolsa@redhat.com \
    --cc=leo.yan@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=nd@arm.com \
    --cc=peterz@infradead.org \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®