#[repr(C)]pub struct PerfettoTracingSession { /* private fields */ }
Expand description
The native C++ class that is safe to be passed across the C++/Rust
boundary via a unique_ptr
.
Implementations§
Source§impl PerfettoTracingSession
impl PerfettoTracingSession
Sourcepub fn flush(
self: Pin<&mut Self>,
timeout_ms: u32,
ctx: Box<FlushCtx>,
done: fn(ctx: Box<FlushCtx>, success: bool),
)
pub fn flush( self: Pin<&mut Self>, timeout_ms: u32, ctx: Box<FlushCtx>, done: fn(ctx: Box<FlushCtx>, success: bool), )
Flush buffered traces.
The passed-in callback is called with true
on success; false
indicates that some data source didn’t ack before the
timeout, or because something else went wrong (e.g. tracing
system wasn’t initialized).
Source§impl PerfettoTracingSession
impl PerfettoTracingSession
Sourcepub fn poll_traces(
self: Pin<&mut Self>,
ctx: Box<PollTracesCtx>,
done: fn(ctx: Box<PollTracesCtx>, data: &[u8], has_more: bool),
)
pub fn poll_traces( self: Pin<&mut Self>, ctx: Box<PollTracesCtx>, done: fn(ctx: Box<PollTracesCtx>, data: &[u8], has_more: bool), )
Poll for new traces, and call the provided done
callback with new
trace records.
Polling will only return data if an output_fd
was not specified
when creating the session.
If there are no more records, the callback will be called with an
empty slice and has_more == true
as a special case to signal EOF.
The data in the callback buffer is guaranteed to consist of complete trace records; in other words, there will not be any partial records that cross buffer boundaries.