The proc filesystem.
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Sun, 16 May 2010 23:18:32 +0000 (20:18 -0300)
committerThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Sun, 16 May 2010 23:18:32 +0000 (20:18 -0300)
Still needs to talk about seq_file.

05debug/debug

index 0bd8f03..17552ee 100644 (file)
@@ -89,3 +89,32 @@ allowing the user to configure it.
 * Depends on DEBUG\\_FS
 * Documented in the Kconfig help at lib/Kconfig.debug
 * Also documented at Documentation/dynamic-debug-howto.txt
+
+# Proc filesystem
+
+The proc filesystem has a use of its own, allowing user space to get
+information about processes and other system configuration as well as to
+change those configuration items.
+
+However, it may be used for debugging too. In fact, developers usually
+request information from /proc/, when trying to find a solution for a
+reported bug.
+
+# Creating a proc file
+
+* include linux/proc\\_fs.h
+* struct proc\\_dir\\_entry
+       - proc\\_fops
+       - data
+* create\\_proc\\_entry(name, mode, parent) is racy
+* Use NULL parent to create a file in the proc root
+* proc\\_create(name, mode, parent, fops) is not racy
+* proc\\_create\\_data(name, mode, parent, fops, data)
+
+# Removing a proc file and creating directories
+
+* remove\\_proc\\_entry(name, parent)
+* proc\\_mkdir(name, parent)
+* proc\\_mkdir\\_mode(name, mode, parent)
+
+# seq\\_file