Solves issues with requiring precise placement of physical markers prior to their corresponding regular virtual address entry (ifetch entries being inserted between the marker and memref by raw2trace; delayed branches needing to carry their marker; page-spanning extra markers needing to land in the right place) by switching to a scheme where markers come in pairs with a physical and a virtual. Such a pair has flexibility on where it can appear in the trace so long as it is prior to the regular entry with that virtual address. This eliminates all work and complexity for raw2trace to move the markers around.
Solves issues with capacity where the tracer runs out of pre-allocated space inside the main buffer for marker-heavy output by switching to use a separately-allocated-and-emitted "v2p" buffer for the physical,virtual pairs. This is made possible by the flexible location. Two complexities of this scheme are solved: the buffer is page-aligned and heap-allocated for buffer handoff; the initial thread header is added to the v2p buffer and skipped in the regular buffer to avoid the pairs appearing before the top-level metadata.
Refactors header insertion and buffer output into separate functions out of the large memtrace() function.
Multi-output was tested on SPEC2K6 gzip which hits the 1-page limit 4 times during its run with a scaled-down test input set workload.
The view tool, invariant checker, release notes, and regression test are updated. The invariant checker now also checks that the physical and virtual pair member share their bottom bits. are identical.
Includes a significant fix for physical offline tracing: Elision and address displacement optimizations are disabled for physical addresses as the final address is required at tracing time.
Issue: #4014