This crate provides a library for high-performance event tracing which is used by
the Rust compiler's unstable
-Z self-profile feature.
The output of a tracing session will be three files:
.eventsfile which contains all of the traced events.
.string_datafile which contains all the strings referenced by events.
.string_indexfile which maps
StringIdvalues to offsets into the
The main entry point for writing event trace files is the
To record an event, call the
Profiler::record_instant_event() method, passing a few arguments:
StringIdwhich assigns an arbitrary category to the event
StringIdwhich specifies the name of the event
u32id of the thread which is recording this event
Alternatively, events can also be recorded via the
Profiler::start_recording_interval_event() method. This
method records a "start" event and returns a
TimingGuard object that will automatically record
the corresponding "end" event when it is dropped.
To create a
StringId, call one of the string allocation methods:
All binary files generated by measureme have a simple file header that consists of a 4 byte file magic string and a 4 byte little-endian version number.
This module contains functionality specific to to the measureme integration with rustc
A string table implementation with a tree-like encoding.
When dropped, this
The max instant timestamp we can represent with the 48 bits available.
The max interval timestamp we can represent with the 48 bits available.
The highest value is reserved for the