All functions for this interface can be called from many threads at once. However, from the same thread, there is an ordering. - begin/end pairs must be balanced, per-thread - begin/end pairs can be nested, per-thread - category must come outside of a begin/end pair Set current category for pending begin and instant events, for the current thread. categoryZ must be a zero-terminated slice (zero not counted in length). This is thread-safe and can be called from multiple threads.
Add an instant event to the trace. This is thread-safe and can be called from multiple threads.
This Begin/End Event will be added to the queue. Events can be added from whatever thread. But within the same threads, the begin/end events are nested and must be balanced. nameZ must be be a zero-terminated slice (zero not counted in length).
Return a borrowed array of bytes for saving. Lifetime is tied to lifetime of the interface object. After toBytes is called, no recording function above can be called.