{{Short description|RAM-based Linux file system}} {{for|the ext file system debugger|e2fsprogs}} {{Lowercase title}} '''debugfs''' is a special file system available in the Linux kernel since version 2.6.10-rc3.<ref name="intro">[http://kerneltrap.org/node/4394 Linux: DebugFS] {{Webarchive|url=https://web.archive.org/web/20100201234857/http://kerneltrap.org/node/4394 |date=2010-02-01 }}, by Jeremy, December 11, 2004, KernelTrap. (Announcement of debugfs by Greg KH.)</ref> It was written by Greg Kroah-Hartman.<ref name="creator">{{cite web |url=https://lwn.net/Articles/115405/ |title=Debugfs |date=2004-12-13 |publisher=LWN.net}}</ref>

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.<ref name='intro-2'>[http://www.mjmwired.net/kernel/Documentation/filesystems/debugfs.txt Linux Kernel Documentation :: filesystems : debugfs.txt] documentation from the source code (Based on kernel version 2.6.35.4. Page generated on 2010-09-02 21:39 EST.)</ref> Unlike {{Mono|/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.<ref name='rules'>[https://lwn.net/Articles/334546/ An updated guide to debugfs], By Jonathan Corbet, May 25, 2009, LWN</ref>

== Use == To compile a Linux kernel with the debugfs facility, the {{Mono|CONFIG_DEBUG_FS}} option must be set to yes. It is typically mounted at {{Mono|/sys/kernel/debug}} with a command such as:<ref>[https://web.archive.org/web/20160105144119/http://people.ee.ethz.ch/~arkeller/linux/kernel_user_space_howto.html#ss2.5 2.5 Debugfs] A guide to using debugfs, Ariane Keller, Version 0.8, July 2008, Kernel Space - User Space Interfaces</ref>

<syntaxhighlight lang="bash"> mount -t debugfs none /sys/kernel/debug </syntaxhighlight>

It can be manipulated using several calls from the C header file {{Mono|linux/debugfs.h}}, which include: * {{Mono|debugfs_create_file}}{{snd}} for creating a file in the debug filesystem. * {{Mono|debugfs_create_dir}}{{snd}} for creating a directory inside the debug filesystem. * {{Mono|debugfs_create_symlink}}{{snd}} for creating a symbolic link inside the debug filesystem. * {{Mono|debugfs_remove}}{{snd}} for removing a debugfs entry from the debug filesystem.

== References == {{reflist}}

== External links == * [https://lwn.net/Articles/334546/ An updated guide to debugfs] at LWN

{{Linux}} {{Linux kernel}}

Category:Linux kernel Category:Linux kernel features