如何提供给ftrace function_graph追踪Linux内核的功能? [英] How to make a linux kernel function available to ftrace function_graph tracer?

查看:1385
本文介绍了如何提供给ftrace function_graph追踪Linux内核的功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在与ftrace内核引导过程 function_graph 来跟踪一个函数来了解它,但它不具备的 available_filter_functions

I want to trace a function during kernel boot process with ftrace function_graph to understand what it does, but it is not available in available_filter_functions.

我试图用导出EXPORT_SYMBOL(),猜测,这将使它可用,但事实并非如此。

I tried to export it with EXPORT_SYMBOL(), guessing that it will made it available but this is not the case.

你有一个解决方案?

有关信息,功能我想跟踪的<一个href="http://androidxref.com/kernel_3.4/xref/drivers/staging/android/persistent_ram.c#438"><$c$c>persistent_ram_init_ringbuffer和<一href="http://androidxref.com/kernel_3.4/xref/drivers/staging/android/persistent_ram.c#443"><$c$c>persistent_ram_early_init在Android的内核3.4。

For information, functions I want to trace are persistent_ram_init_ringbuffer and persistent_ram_early_init in Android kernel 3.4.

我通读文件,但没有发现任何关于这个和grep没有帮助更多...

I read through the documentation but found nothing on this and grep did not helped more...

感谢

推荐答案

现在的问题是,这些功能都标注有__init和__devinit,这是由黑功能ftrace跟踪器上市。

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

为什么呢?因为作为模块初始化函数(或内核初始化函数)它们在初始化期间被加载并且当初始化完成移除。该ftrace痕迹每个函数被保持在一个特殊的紧凑表。目前,有没有办法告诉ftrace,这些功能已被删除(释放),以及ftrace应该从表中删除它们。如果我们忽略这一点,那么,当功能启用跟踪,ftrace会尝试修改已不存在的位置,并可能导致各种问题(还记得的e1000e错误?)。

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.

这篇关于如何提供给ftrace function_graph追踪Linux内核的功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆