From c7ac8a066afc7bad2b462081eaf0255270e73b09 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Sun, 16 May 2010 20:18:32 -0300 Subject: [PATCH] The proc filesystem. Still needs to talk about seq_file. --- 05debug/debug | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/05debug/debug b/05debug/debug index 0bd8f03..17552ee 100644 --- a/05debug/debug +++ b/05debug/debug @@ -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 -- 2.20.1