An append-only, thread-safe trace buffer that can be snapshotted and rolled back.
All state mutations are guarded by lock, ensuring atomicity across threads.
Permanently discards all buffered trace entries.
Returns true if tracing is enabled, false otherwise.
Enables or disables tracing.
Returns a snapshot of the current buffer and clears it.
Records a trace entry when tracing is enabled.