加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

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

发布时间:2020-12-13 23:19:29 所属栏目:Linux 来源:网络整理
导读:Ubuntu 15.04,编译并安装了 Linux-Next内核2015-06-04. 然后启动此内核,然后运行perf top,但它表示找不到符号. 如何在perf中手动加载内核符号? root@ubuntu-server:/boot# uname -r4.1.0-rc6.060402222+root@ubuntu-server:/proc# ls kall*kallsymsroot@ubu
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

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读