Optional, single-threaded Iprof timeline recording and a portable binary trace format.
Existing Iprof reports are unchanged. Import Iprof separately in manual or plugin mode.
Attaches to Iprof before opening zones; only one recorder can be attached. Record frames with
Iprof.update(true). Stop at a closed-zone boundary, then save and free the captured trace.
Writes JIPT v1: eight-byte magic, little-endian u64 name/frame counts, length-prefixed UTF-8
names, then frames (duration, span count) and spans (zone, parent+1, start, end). Times are ns.
Refuses invalid trees and files over 64 MiB. The caller owns the trace.
Loads a bounded JIPT v1 file, validating lengths, indices, containment and sibling order.
Returns an empty trace on failure. The successful result owns its storage: use free_trace.
trace, ok := load_trace("work.jipt");
if ok {
assert(trace.frames.count > 0);
free_trace(*trace);
}