Hello,
I've successfully written a program that generates trace via sysFS, passes it to the decoder, and uses a callback function to utilize it afterward. When testing it by tracing a small test program over and over again I noticed that occasionally I get a CSD_ERR_BAD_DECODE_PKT-error message. In the few instances I was able to reproduce it the produced OCSD_GEN_TRC_ELEM_INSTR_RANGE packets were always correct and the error always occurred at the end in combination with an I_INCOMPLETE_EOT packet. Therefore, and because the error is very rare, I could just disable the error logger and my program would work, but if possible I would like to avoid that. Does anyone have an idea where the error might come from, whether I am doing something wrong, or where I could look for the cause?
I've saved the binary trace data and decoded it using trc_pkt lister, and the output is almost the same, but the broken trace has a few additional lines and is missing one OCSD_GEN_TRC_ELEM_EO_TRACE-element:
[equal trace data]
+ Idx:364; ID:10; [0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 ]; I_ASYNC : Alignment Synchronisation. + Idx:377; ID:10; [0x01 0x01 0x00 ]; I_TRACE_INFO : Trace Info.; INFO=0x0 { CC.0 } + Idx:380; ID:10; [0x9d 0x70 0x6a 0x0d 0x10 0x00 0x80 0xff 0xff ]; I_ADDR_L_64IS0 : Address, Long, 64 bit, IS0.; Addr=0xFFFF8000100DD5C0;
[equal trace only having varying Idx]
+ Idx:506; ID:10; [0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 ]; I_ASYNC : Alignment Synchronisation. + Idx:519; ID:10; [0x01 0x01 0x00 ]; I_TRACE_INFO : Trace Info.; INFO=0x0 { CC.0 } + Idx:522; ID:10; [0x9d 0x60 0x57 0xd1 0x10 ]; I_INCOMPLETE_EOT : Incomplete packet at end of trace.[I_ADDR_L_64IS0] + DCD_ETMV4_0016 : 0x0019 (OCSD_ERR_BAD_DECODE_PKT) [Reserved or unknown packet in decoder.]; TrcIdx=522; CS ID=10; Unknown packet type.Idx:522; ID:10; OCSD_GEN_TRC_ELEM_EO_TRACE( [end-of-trace])
- Idx:471; ID:10; OCSD_GEN_TRC_ELEM_EO_TRACE( [end-of-trace])
[Equal EOT trace: ] ID:10 END OF TRACE DATA Idx:0; ID:12; OCSD_GEN_TRC_ELEM_EO_TRACE( [end-of-trace]) ID:12 END OF TRACE DATA Idx:0; ID:14; OCSD_GEN_TRC_ELEM_EO_TRACE( [end-of-trace]) ID:14 END OF TRACE DATA Idx:0; ID:16; OCSD_GEN_TRC_ELEM_EO_TRACE( [end-of-trace]) ID:16 END OF TRACE DATA Idx:0; ID:17; OCSD_GEN_TRC_ELEM_EO_TRACE( [end-of-trace]) ID:17 END OF TRACE DATA Idx:0; ID:18; OCSD_GEN_TRC_ELEM_EO_TRACE( [end-of-trace]) ID:18 END OF TRACE DATA Idx:0; ID:1a; OCSD_GEN_TRC_ELEM_EO_TRACE( [end-of-trace]) ID:1a END OF TRACE DATA Idx:0; ID:1c; OCSD_GEN_TRC_ELEM_EO_TRACE( [end-of-trace]) ID:1c END OF TRACE DATA Trace Packet Lister : Trace buffer done, processed 5xx bytes.
I've attached the full decoded traces as well. I don't know if it matters, but my trace very often contains a 0x0e Exceptions (apparently syscalls) but not in this run.
Any insight on this would be appreciated.
Thanks and regards,
Dominik