Adds a new drmemtrace mechanism to set a frozen timestamp for all future entries, to avoid huge time gaps when -max_global_trace_refs is reached but existing thread buffers and exits are not emitted until much later when the app exits.
Adding a small regression test seems difficult without flakiness as this involved real-time gaps. Tested manually:
Pre-fix we see a 2s gap before the thread exit:
$ ninja && ctest -V -R max-global
$ bin64/drrun -t drcachesim -simulator_type view -indir suite/tests/tool.drcacheoff.max-global*.dir 2>&1 | grep timestamp
T3427537 <marker: timestamp 13271354817417504>
T3427537 <marker: timestamp 13271354817418955>
T3427537 <marker: timestamp 13271354817624561>
T3427537 <marker: timestamp 13271354817657186>
T3427537 <marker: timestamp 13271354817659466>
T3427537 <marker: timestamp 13271354817664998>
T3427537 <marker: timestamp 13271354817667972>
T3427537 <marker: timestamp 13271354817701187>
T3427537 <marker: timestamp 13271354819175717>
After adding a frozen timestamp:
$ bin64/drrun -t drcachesim -simulator_type view -indir suite/tests/tool.drcacheoff.max-global*.dir 2>&1 | grep timestamp
T3429223 <marker: timestamp 13271355614195474>
T3429223 <marker: timestamp 13271355614196983>
T3429223 <marker: timestamp 13271355614399149>
T3429223 <marker: timestamp 13271355614432167>
T3429223 <marker: timestamp 13271355614434675>
T3429223 <marker: timestamp 13271355614438892>
T3429223 <marker: timestamp 13271355614441260>
T3429223 <marker: timestamp 13271355614474587>
T3429223 <marker: timestamp 13271355614475843>
Fixes #5021 (closed)