How to make a linux kernel function available to ftrace function_graph tracer?

[亡魂溺海] 提交于 2019-11-29 01:42:45

The problem is that those functions are annotated with __init and __devinit, which are black listed by ftrace function tracer.

Why? Because as module init functions (or kernel init functions) they are loaded during initialization and removed when the initialization is complete. Every function that ftrace traces is kept in a special compact table. Currently, there's no way to tell ftrace that those functions have been removed (freed) and that ftrace should remove them from its table. If we were to just ignore that, then when function tracing is enabled, ftrace will try to modify locations that no longer exist and can cause all sorts of issues (remember the e1000e bug?).

If you really want to trace them, then remove those annotations. Then they should appear in the list of functions to trace.

http://lwn.net/Articles/370423/

http://www.mjmwired.net/kernel/Documentation/trace/ftrace.txt

these links might help. first is thing i found by googling. second is ftrace documentation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!