ftrace

From vegard.wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Trace a single system call

This generates a function graph trace of a specific function and its callees:

# function to trace
func=ksys_mount

cd /sys/kernel/debug/tracing/
echo 0 > tracing_on
echo function_graph > current_tracer
echo $func > set_graph_function
echo 1 > tracing_on
echo > trace

# do thing here

echo 0 > tracing_on
echo nop > current_tracer

# save trace
cp trace /tmp/trace.txt