ftrace

From vegard.wiki
Revision as of 14:08, 7 October 2022 by Vegard (talk | contribs) (new page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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 set_graph_function > set_graph_function
echo $func > set_graph_function
echo 1 > tracing_on

# do thing here

echo 0 > tracing_on

# save trace
cp trace /tmp/trace.txt