ftrace: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(new page) |
(add category) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 10: | Line 10: | ||
echo 0 > tracing_on |
echo 0 > tracing_on |
||
echo function_graph > current_tracer |
echo function_graph > current_tracer |
||
echo set_graph_function > set_graph_function |
|||
echo $func > set_graph_function |
echo $func > set_graph_function |
||
echo 1 > tracing_on |
echo 1 > tracing_on |
||
echo > trace |
|||
# do thing here |
# do thing here |
||
echo 0 > tracing_on |
echo 0 > tracing_on |
||
echo nop > current_tracer |
|||
# save trace |
# save trace |
||
cp trace /tmp/trace.txt |
cp trace /tmp/trace.txt |
||
</source> |
</source> |
||
[[Category:Linux kernel]] |
Latest revision as of 14:37, 7 October 2022
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