From: Thadeu Lima de Souza Cascardo Date: Sun, 16 May 2010 23:18:32 +0000 (-0300) Subject: The proc filesystem. X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fkernel%2Fslides%2F.git;a=commitdiff_plain;h=c7ac8a066afc7bad2b462081eaf0255270e73b09 The proc filesystem. Still needs to talk about seq_file. --- 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