首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >vtune准备——开启linux内核调试信息

vtune准备——开启linux内核调试信息

作者头像
mingjie
发布2022-05-12 10:42:06
发布2022-05-12 10:42:06
1.7K0
举报

解决报错:cannot locate debugging information for file

内核需要三部分调试信息

1 打开内核module解析

检查/proc/sys/kernel/kptr_restrict

代码语言:javascript
复制
# cat /proc/sys/kernel/kptr_restrict
0
  • If the kptr_restrict value is 0, kernel addresses are provided without limitations (recommended).
  • If the kptr_restict value is 1, addresses are provided if the current user has a CAP_SYSLOG capability.
  • If the kptr_restrict value is 2, the kernel addresses are hidden regardless of privileges the current user has.

2 安装内核debug信息

查看包名

代码语言:javascript
复制
echo "kernel-debuginfo-common-x86_64-`uname -r`.rpm"
echo "kernel-debuginfo-`uname -r`.rpm"

下载debuginfo

代码语言:javascript
复制
wget http://debuginfo.centos.org/7/x86_64/kernel-debuginfo-common-x86_64-`uname -r`.rpm
wget http://debuginfo.centos.org/7/x86_64/kernel-debuginfo-`uname -r`.rpm

安装

代码语言:javascript
复制
yum install kernel-debuginfo-common-x86_64-3.10.0-693.2.2.el7.x86_64.rpm
yum install kernel-debuginfo-3.10.0-693.2.2.el7.x86_64.rpm

3 编译内核

重新编译内核,top-level Makefile增加:

代码语言:javascript
复制
CFLAGS_KERNEL := -g
CFLAGS := -g

make clean; make to create the vmlinux kernel file with debug information

(可选)4 内核源码

uname -r后找对应版本

https://vault.centos.org/7.4.1708/os/Source/SPackages/

参考

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2021-03-23,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 1 打开内核module解析
  • 2 安装内核debug信息
  • 3 编译内核
  • (可选)4 内核源码
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档