ftrace: tracing linux function calls

Posted 三叁

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ftrace: tracing linux function calls相关的知识,希望对你有一定的参考价值。

First confirm that you have root privilege.

Second check the config of kernel that you have the configs on:

CONFIG_FTRACE=y
CONFIG_FUNCTION_GRAPH_TRACER=y
CONFIG_EVENT_TRACING=y
CONFIG_FUNCTION_TRACER
CONFIG_STACK_TRACER
CONFIG_DYNAMIC_FTRACE

Last you confirm you have your debugfs/tracefs mounted, by: 

mount -t debugfs nodev /sys/kernel/debug/

Then go into the sys entry tracing and you will find the friendly README.

List some triggers: 

options/funcgraph-irqs, tracing_on, max_graph_depth, set_graph_function, set_ftrace_filter, set_ftrace_pid, current_tracer.

stack_trace can probe runtime kernel address of functions.

以上是关于ftrace: tracing linux function calls的主要内容,如果未能解决你的问题,请参考以下文章

ftrace利器之trace-cmd和kernelshark

ftrace

Linux 追踪技术 ftrace 简介

ftrace:跟踪你的内核函数! | Linux 中国

Linux Ftrace介绍与原理

如何在 ftrace 中打印 trace_printk 的完整跟踪文件?