Translate Kernel Call Trace
General setup --->
[*] Configure standard kernel features (for small systems) --->
--- Configure standard kernel features (for small systems)
[*] Load all symbols for debugging/ksymoops
[*] Include all symbols in kallsyms
[ ] Do an extra kallsyms pass (NEW)
our configure
[*] Load all symbols for debugging/ksymoops
[ ] Include all symbols in kallsyms
[*] Do an extra kallsyms pass
Off course, be sure you have CONFIG_DEBUG_KERNEL (Kernel Hacking->Kernel Debugging) also enabled.
http://forum.kernelnewbies.org/read.php?7,2102
使用这些方法中的任意一个来获得内核例程 的地址:
- 从 System.map 文件直接得到地址。
例如,要得到 do_fork 的地址,可以在命令行执行$grep do_fork /usr/src/linux/System.map
。 - 使用
nm
命令。
$nm vmlinuz |grep do_fork
- 从 /proc/kallsyms 文件获得地址。
$cat /proc/kallsyms |grep do_fork
- 使用
kallsyms_lookup_name()
例程。
这个例程是在 kernel/kallsyms.c 文件中定义的,要使用它,必须启用CONFIG_KALLSYMS
编译内核。kallsyms_lookup_name()
接受一个字符串格式内核例程名, 返回那个内核例程的地址。例如:kallsyms_lookup_name("do_fork");
kprobe : collecting debug and performance information
http://forum.kernelnewbies.org/read.php?7,1658
Linux 下的一个全新的性能测量和调式诊断工具 Systemtap
http://www.ibm.com/developerworks/cn/linux/l-cn-systemtap3/index.html