Expand description
This crate provides a simple API for reading Ftrace files.
Examples
use riftrace::{self, Tracer, TracingStat};
// Change current tracer from nop to function_graph
riftrace::set_current_tracer(Tracer::FunctionGraph).unwrap();
// Turn tracing on
riftrace::set_tracing_on(TracingStat::On).unwrap();
// Limit the trace to only "net*"
riftrace::set_ftrace_filter("net*", false).unwrap();
// Print out the output of the trace in a human readable format
println!("{}", riftrace::trace().unwrap());
Enums
Functions
- Returns the different types of tracers that have been compiled into the kernel.
- Get the current tracer that is configured.
- Returns a boolean whether writing to the trace ring buffer is enabled.
- Set the current tracer.
- Limit the trace to only
filter
ed functions. - Any function that is added here will not be traced.
- Have the function tracer only trace the threads whose PID are in the
pids
. - Function passed to this function will cause the function graph tracer to only trace these functions and the functions that they call.
- Enable or disable writing to the trace ring buffer.
- Returns the output of the trace in a human readable format
mark
will be written into the ftrace buffer.