# 内核模块调试ftrace

https://lwn.net/Articles/365835/

printk常用，但效率差，ftrace机制是一个性能更高的追踪机制。

## 使用 trace_printk()

For example you can add something like this to the kernel or module:

trace_printk("read foo %d out of bar %p\n", bar->foo, bar);


Then by looking at the trace file, you can see your output.

[tracing]# cat trace
# tracer: nop
#