History

perf cs-etm: Use new OpenCSD consistency checks

Previously when the incorrect binary was used for decode, Perf would silently continue to generate incorrect samples. With OpenCSD 1.5.4 we can enable consistency checks that do a best effort to detect a mismatch in the image. When one is detected a warning is printed and sample generation stops until the trace resynchronizes with a good part of the image.

James Clark committed 2 years ago

Commit ba5ae781 parent 5afd0321 file · +6 −1Browse files

Unified · Split

tools/perf/util/cs-etm-decoder/cs-etm-decoder.c+6−1
@@ -685,9 +685,14 @@ cs_etm_decoder__create_etm_decoder(struct cs_etm_decoder_params *d_params, · 684 unmodified lines
685685 }
686686
687687 if (d_params->operation == CS_ETM_OPERATION_DECODE) {
688+ int decode_flags = OCSD_CREATE_FLG_FULL_DECODER;
689+#ifdef OCSD_OPFLG_N_UNCOND_DIR_BR_CHK
690+ decode_flags |= OCSD_OPFLG_N_UNCOND_DIR_BR_CHK | OCSD_OPFLG_CHK_RANGE_CONTINUE |
691+ ETM4_OPFLG_PKTDEC_AA64_OPCODE_CHK;
692+#endif
688693 if (ocsd_dt_create_decoder(decoder->dcd_tree,
689694 decoder->decoder_name,
690− OCSD_CREATE_FLG_FULL_DECODER,
695+ decode_flags,
691696 trace_config, &csid))
692697 return -1;
693698