Linux kernel 为什么不启用Debugfs条目?

Linux kernel 为什么不启用Debugfs条目?,linux-kernel,kernel,linux-device-driver,Linux Kernel,Kernel,Linux Device Driver,我有一个模块在/sys/kernel/debug/example中标记debugfs条目。 但是我在sysfs/kernel/example目录中没有看到这些文件 我看到了这个函数,它在后期的initcall中调用了debugfs条目创建。 延迟初始化调用(示例调试初始化); 这个延迟的初始化调用会影响条目的创建吗?听起来好像您还没有挂载debugfs。通过以下方式实现: mount -t debugfs none /sys/kernel/debug 有关使用debugfs的更多信息,请阅读内

我有一个模块在/sys/kernel/debug/example中标记debugfs条目。 但是我在sysfs/kernel/example目录中没有看到这些文件

我看到了这个函数,它在后期的initcall中调用了debugfs条目创建。 延迟初始化调用(示例调试初始化);
这个延迟的初始化调用会影响条目的创建吗?

听起来好像您还没有挂载debugfs。通过以下方式实现:

mount -t debugfs none /sys/kernel/debug

有关使用debugfs的更多信息,请阅读内核文档。

此外,还必须启用:

CONFIG_DEBUG_FS=y
在构建时进行配置,否则装载将失败

下面是一个简单的例子: