Linux:perf top,找不到内核符号

Ubuntu 15.04,编译并安装了Linux-Next内核2015-06-04.

然后启动此内核,然后运行perf top,但它表示找不到符号.

如何在perf中手动加载内核符号?

root@ubuntu-server:/boot# uname -r
4.1.0-rc6.060402222+

root@ubuntu-server:/proc# ls kall*
kallsyms

root@ubuntu-server:/boot# ls | grep 4.1.0-rc6.060402222
config-4.1.0-rc6.060402222+
initrd.img-4.1.0-rc6.060402222+
System.map-4.1.0-rc6.060402222+
vmlinuz-4.1.0-rc6.060402222+

root@ubuntu-server:/# perf top
No kallsyms or vmlinux with build-id 438e4365574d514672888bcfdd6292dbcf71f38f was found
[kernel.kallsyms] with build id 438e4365574d514672888bcfdd6292dbcf71f38f not found, continuing without symbols
Warning:
A vmlinux file was not found.
Kernel samples will not be resolved.
^C

root@ubuntu-server:/proc# perf top -k /boot/vmlinuz-4.1.0-rc6.060402222+
Warning:
The /boot/vmlinuz-4.1.0-rc6.060402222+ file can't be used: Success
Kernel samples will not be resolved.
^C

在Linux-next文件夹中,.config文件启用了内核调试:

CONFIG_DEBUG_KERNEL=y

解决方法:

我安装了perf,并运行“perf top”,得到以下消息:

Warning:

A vmlinux file was not found.

Kernel samples will not be resolved.

安装“libelf-dev”后,我再次编译了perf并进行安装.
最后,我运行“perf top”并获得正确的结果.

在安装perf期间,系统会提供一些提示.例如:

config/Makefile:276: No libelf found, disables ‘probe’ tool, please install elfutils-libelf-devel/libelf-dev

config/Makefile:327: No libunwind found, disabling post unwind support. Please install libunwind-dev[el] >= 1.1

config/Makefile:350: No libaudit.h found, disables ‘trace’ tool, please install audit-libs-devel or libaudit-dev

config/Makefile:364: slang not found, disables TUI support. Please install slang-devel or libslang-dev

根据这些提示,也许你可以解决你的问题.

上一篇:java – Android-从字符串中删除URL百分比符号


下一篇:linux – 加载我自己的内核模块时的未知符号