检查Linux内核调试选项

发布于 2024-08-12 03:39:02 字数 130 浏览 4 评论 0原文

我如何知道我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

不语却知心 2024-08-19 03:39:02

假设内核具有“通过 proc 提供配置”,您可以通过查看 /proc/config.gz 检查正在运行的内核的配置

gunzip -c /proc/config.gz | less

Assuming the kernel has the "provide config via proc" you can check the configuration of the running kernel by looking at /proc/config.gz

gunzip -c /proc/config.gz | less
℡寂寞咖啡 2024-08-19 03:39:02

要了解内核的配置方式,请检查 /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 a config-* file, which shows the kernel configuration options that were used to build the kernel. Look for the debug settings (eg CONFIG_DEBUG_KERNEL).

反差帅 2024-08-19 03:39:02

如果是 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.

幻梦 2024-08-19 03:39:02

在 RHEL 5 中,您还可以通过以下方式检查通过内核安装到服务器中的所有驱动程序:

gunzip -c  /boot/symvers-2.6.18-274.3.1.el5.gz | less

注意,您可以通过以下方式获取完整路径:

rpm -ql kernel | grep -i symver*

另外 lsmod | more 也应该这样做。希望这会有所帮助。

In RHEL 5 you can also check all the drivers that are installed into server via the kernel by:

gunzip -c  /boot/symvers-2.6.18-274.3.1.el5.gz | less

Note, you can get the full path by:

rpm -ql kernel | grep -i symver*

Also lsmod | more should do as well. Hope this will help.

享受孤独 2024-08-19 03:39:02

标准内核可能不会在启用这些标志的情况下进行编译,因为这会增加内核的大小。对于大多数用户来说,开销将是一个缺点。

您始终可以选择重新编译自己的自定义版本的内核,在这种情况下,您可以选择自己的一组选项

您可以使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文