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§
- get_
available_ tracers - Returns the different types of tracers that have been compiled into the kernel.
- get_
current_ tracer - Get the current tracer that is configured.
- is_
tracing_ on - Returns a boolean whether writing to the trace ring buffer is enabled.
- set_
current_ tracer - Set the current tracer.
- set_
ftrace_ filter - Limit the trace to only
filtered functions. - set_
ftrace_ notrace - Any function that is added here will not be traced.
- set_
ftrace_ pid - Have the function tracer only trace the threads whose PID are
in the
pids. - set_
graph_ function - Function passed to this function will cause the function graph tracer to only trace these functions and the functions that they call.
- set_
tracing_ on - Enable or disable writing to the trace ring buffer.
- trace
- Returns the output of the trace in a human readable format
- trace_
marker markwill be written into the ftrace buffer.