检查Linux内核调试选项
我如何知道我的 linux 风格中提供的标准内核是否已选择 DEBUG KERNEL ENABLED 标志?
我认为应该启用 DEBUG 选项才能使用 kprobe、systemtap 等工具?
How can I know if the standard kernel provided in my linux flavour has got DEBUG KERNEL ENABLED flags selected or not ??
I think DEBUG option should be enabled inorder to use tools like kprobe, systemtap ??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
假设内核具有“通过 proc 提供配置”,您可以通过查看 /proc/config.gz 检查正在运行的内核的配置
Assuming the kernel has the "provide config via proc" you can check the configuration of the running kernel by looking at /proc/config.gz
要了解内核的配置方式,请检查
/boot/
目录。根据您的发行版的工作方式,可能会有一个 config-* 文件,其中显示用于构建内核的内核配置选项。查找调试设置(例如CONFIG_DEBUG_KERNEL
)。To find out how your kernel was configured, check in the
/boot/
directory. Depending on how your distro does things, there might be aconfig-*
file, which shows the kernel configuration options that were used to build the kernel. Look for the debug settings (egCONFIG_DEBUG_KERNEL
).如果是 RHEL / CentOS / Fedora:
内核配置位于 kernel-devel 包内。
Red Hat 用于构建发行版内核的特定配置存储在 /usr/src/kernels/version/.config 中。
If it's RHEL / CentOS / Fedora:
Kernel configuration is inside the kernel-devel package.
The specific configuration used by Red Hat to build your distro's kernel is stored in /usr/src/kernels/version/.config.
在 RHEL 5 中,您还可以通过以下方式检查通过内核安装到服务器中的所有驱动程序:
注意,您可以通过以下方式获取完整路径:
另外
lsmod | more 也应该这样做。希望这会有所帮助。
In RHEL 5 you can also check all the drivers that are installed into server via the kernel by:
Note, you can get the full path by:
Also
lsmod | more
should do as well. Hope this will help.标准内核可能不会在启用这些标志的情况下进行编译,因为这会增加内核的大小。对于大多数用户来说,开销将是一个缺点。
您始终可以选择重新编译自己的自定义版本的内核,在这种情况下,您可以选择自己的一组选项。
您可以使用 lsmod 命令列出编译到内核中的模块。
The standard kernel would probably NOT have been compiled with those flags enabled, since this would increase the size of the kernel. The overhead would be a disadvantage to most users.
You always have the option of recompiling your own custom version of the kernel, in which case you may select your own set of options.
You can list the modules compiled into the kernel with the
lsmod
command.