drmemtrace -max_global_trace_refs fails to flush threads when the max is hit
The -max_global_trace_refs feature in drcachesim's drmemtrace fails to flush thread buffers when the max is hit. Since execution continues, what happens is that much later when the app exits we then have thread exits and unflushed data in thread buffers emitted into the trace with timestamps from that much later time, producing a confusing time gap in the trace.
For our use case, what we really want is to detach when the max is hit, but we need #2644 for that. Barring that, we could put in a synchall when the max is hit and go and flush and exit all the thread buffers: if we add logic for accessing another thread's buffer. Another choice is to record the timestamp when the max is hit and use that when the app finally exits.
If we implement -detach_after_tracing: would we make -max_global_trace_refs an alias of it (with compatibility breakage notes), or go and fix it in addition??