Adding dynamic tracepoint through perf in Linux for function that is not listed

£可爱£侵袭症+ 提交于 2019-12-04 20:18:43

There is no such trace point. So apparently you cannot trace it the easy way. It seems that this function was inlined by compiler (keep in mind that function also could be omitted for some optimization reasons). That's why there is no its symbol in /proc/kallsyms.

You can choose the most suitable function for you to trace. E.g. in my Debian with 4.9 kernel I can trace unmap_page_range(), which eventually "calls" the function you need. Perhaps it logically will meet your goal.

Another way is a little bit hacking. You can do something like objdump -dS memory.o | vim - (you should have binaries) and investigate where is the code you needed. Given that the chain zap_pud_range()->zap_pmd_range()->zap_pte_range() is probably inlined, you will have to investigate aforementioned unmap_page_range(). Perhaps you'll finally gain some code address for kprobes.

If you want to explicitly trace zap_pte_range() e.g. through jprobes (about args) or kretprobes (about return value), you can try to specify noinline-attribute for needed function(s), recompile Linux kernel and trace it as you want.

Guess I have no more useful ways for you.

More info: Related post, Jprobes example, Ftrace: trace your kernel functions!, Post about ftrace and systemtap, man nm

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