Linux kernel 笔记 (33)——“debugfs“简介

以下摘自维基百科

debugfs is a simple to use RAM-based file system specially designed for debugging purposes. It exists as a simple way for kernel developers to make information available to user space. Unlike /proc, which is only meant for information about a process, or sysfs, which has strict one-value-per-file rules, debugfs has no rules at all. Developers can put any information they want there.

debugfs是一个用于调试目的,简单的,基于内存的文件系统。kernel的信息可以输出到debugfs中,这样方便user space程序查看和使用。

为了使用debugfs功能,编译kernel时需要把CONFIG_DEBUG_FS置成yes

典型的挂载debugfs文件系统命令:

mount -t debugfs none /sys/kernel/debug

由于没有具体设备,所以设备的位置使用了none(参考这个帖子