Debugfs
RAM-based Linux file system
debugfs is a special file system available in the Linux kernel since version 2.6.10-rc3. It was written by Greg Kroah-Hartman.
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.
01Use
To compile a Linux kernel with the debugfs facility, the CONFIG_DEBUG_FS option must be set to yes. It is typically mounted at /sys/kernel/debug with a command such as:
mount -t debugfs none /sys/kernel/debugIt can be manipulated using several calls from the C header file linux/debugfs.h, which include:
- debugfs_create_file , for creating a file in the debug filesystem.
- debugfs_create_dir , for creating a directory inside the debug filesystem.
- debugfs_create_symlink , for creating a symbolic link inside the debug filesystem.
- debugfs_remove , for removing a debugfs entry from the debug filesystem.
Sources and credits
This article is adapted from the Wikipedia article “Debugfs”, written by its contributors and licensed under CC BY-SA 4.0. Fathomly has changed the layout, removed citation markers, navigation and maintenance notices, and adjusted punctuation. This adapted version is shared under the same license. For references, see the original article.
Fathomly is not affiliated with or endorsed by the Wikimedia Foundation. Spotted a problem? Tell us.