Skip to main content

Crate ktrace_rs

Crate ktrace_rs 

Source

Macros§

begin_scope
Creates a delegate to capture the given arguments at the beginning of a scope when the given category is enabled. The returned value should be used to construct a ktrace::Scope to track the lifetime of the scope and emit the complete trace event. The complete event is associated with the current thread.
begin_scope_cond
Similar to begin_scope!, but checks the given runtime_condition, in addition to the given category, to determine whether to emit the event.
complete
Writes a duration complete event associated with the current thread when the given category is enabled.
counter
Writes a counter event associated with the current thread when the given category is enabled.
cpu_begin_scope
Similar to begin_scope!, but associates the event with the current CPU instead of the current thread.
cpu_complete
Similar to complete!, but associates the event with the current CPU instead of the current thread.
cpu_duration_begin
Similar to duration_begin!, but associates the event with the current CPU instead of the current thread.
cpu_duration_end
Similar to duration_end!, but associates the event with the current CPU instead of the current thread.
cpu_instant
Similar to instant!, but associates the event with the current CPU instead of the current thread.
declare_interned_category
Statically declares a new InternedCategory.
duration_begin
Writes a duration begin event associated with the current thread when the given category is enabled.
duration_end
Writes a duration end event associated with the current thread when the given category is enabled.
flow_begin
Writes a flow begin event associated with the current thread when the given category is enabled.
flow_end
Writes a flow end event associated with the current thread when the given category is enabled.
flow_step
Writes a flow step event associated with the current thread when the given category is enabled.
instant
Writes an instant event associated with the current thread when the given category is enabled.
kernel_object
Writes a kernel object record when the given trace category is enabled.
kernel_object_always
Writes a kernel object record unconditionally. Useful for generating the initial set of object info records before tracing is enabled.
resolve_category
Resolves a category parameter to a reference to an InternedCategory. If a string literal is provided, it is declared as an external category.
resolve_string
Resolves a string parameter to a reference to an InternedString. If a string literal is provided, it is statically interned at compile-time.

Structs§

Argument
DroppedRecordStats
This struct keeps track of the duration, number, and size of trace records dropped when the buffer is full. These statistics are emitted to the trace buffer as a duration as soon as space is available to do so, at which point the values are reset to 0, or false in the case of has_dropped.
InstantBootTicks
InternedString
A binary-stable, transparent representation of fxt::InternedString.
KTrace
A pure Rust implementation of KTrace.
KTraceBuffer
A Rust implementation of percpu_writer::Buffer that wraps a static reference to an existing spsc_buffer::Buffer and tracks dropped trace records.
KTraceReservation
KTraceReservation encapsulates a pending write to the buffer.
KTraceScope
KTraceState

Enums§

ArgValue
The value of a trace argument.
Context
EventType

Statics§

DROP_STATS_REF
META_CAT
NUM_BYTES_REF
NUM_RECORDS_REF

Functions§

rust_ktrace_init
Initializes the global KTrace instance with the given number of CPU buffers.
rust_ktrace_init_cpu_buffer
Initializes the KTraceBuffer for a specific CPU using a pointer to the C++ SpscBuffer.
timer_current_boot_ticks
Returns the current boot time in ticks.