drmemtrace incorrectly inserts post-block markers mid-block and even mid-instruction
We're seeing function entry markers inserted too soon. Here the callee entry is at record 184630 but the markers are inserted in the prior block even before the call to the callee, and infact in the middle of the two memrefs for the ldadd:
184622: T481584 ifetch 4 byte(s) @ 0x00000c129a81c194 f8280008 ldadd %x8 (%x0)[8byte] -> %x8 (%x0)[8byte]
184623: T481584 read 8 byte(s) @ 0x0000466b8ba17dd0 by PC 0x00000c129a81c194
184624: T481584 <marker: function #3>
184625: T481584 <marker: function return address 0xc129a81c1a0>
184626: T481584 <marker: function argument 0x2a8>
184627: T481584 write 8 byte(s) @ 0x0000466b8ba17dd0 by PC 0x00000c129a81c194
184628: T481584 ifetch 4 byte(s) @ 0x00000c129a81c198 52805500 movz $0x02a8 lsl $0x00 -> %w0
184629: T481584 ifetch 4 byte(s) @ 0x00000c129a81c19c 94173789 bl $0x0000aaaaf8fe9fc0 -> %x30
184630: T481584 ifetch 4 byte(s) @ 0x0000aaaaf8fe9fc0 aa0003e8 orr %xzr %x0 lsl $0x00 -> %x8
The raw data would be: PC+190; ref-dd0; markers. It is looking like the raw2trace code just too eagerly outputs the markers before all the implicit records for the rest of the block are added.