package tracing
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=41b85b4f6972cc6ec4c98a9d65b32a840005ad212bcf49dfa732250b43392ad1
doc/tracing.tracing_zero/Tracing_zero/Writer/Expert/index.html
Module Writer.Expert
Source
See docs in Writer_intf
for what this is for
Interns a string directly to the specified slot (whereas set_temp_string_slot
may shift the index since certain indices are reserved for internal use). Will raise when setting a slot that is not a temp string slot or when setting slot 1 to any string other than "process".
Useful for preserving the string ID usage of parsed traces in a way that can lead to exact byte equality after a round trip through parsing and writing.
Immediately ask the destination for a new buffer even if the current one isn't full. This is intended for use by the probe infrastructure when a destination for the global writer is initialized.
Finish all pending writes to underlying buffer and notify the Destination
This is currently only intended for use by tests.
For use with precompute_header_and_size
val precompute_header :
event_type:Event_type.t ->
extra_words:int ->
arg_types:Arg_types.t ->
thread:Thread_id.t ->
category:String_id.t ->
name:String_id.t ->
header
Pre-compose an event header word, for use with write_from_header_with_tsc
Write an event using a pre-composed header, and using less safety checking than the normal event writing functions, intended for low-overhead probe instrumentation. Also uses the rdtsc
counter for the ticks field, meaning this Writer
must have been created with a calibrated ticks_per_second
field to have correct timing.
The pre-composition itself saves about 3ns per event. The omission of unnecessary checks saves additional time. Overall in benchmarks this is about 2x faster than using the usual write_*
functions, saving about 6ns per event.
The only caller-visible check omission should be that it doesn't check the corectness of arguments, which can result in invalid trace files if the arguments written don't match the header. Users of this function must use Write_arg_unchecked
because it doesn't set the necessary state for checking.
Same as write_from_header_with_tsc
but but returns ticks. See Tracing.Writer.write_duration_instant
.
Unchecked writing of the result of write_from_header_and_get_tsc
after the arguments.
Unchecked versions of the Write_arg
functions that can result in invalid traces.