Crate riftrace

Crate riftrace 

Source
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§

Tracer
TracingStat

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
mark will be written into the ftrace buffer.

Type Aliases§

RifError
RifResult