From 6b6786d6ecee4619c2761482ba62fd63bc8df18e Mon Sep 17 00:00:00 2001
From: Robb Romans <robb@linux.vnet.ibm.com>
Date: Wed, 16 Sep 2009 15:10:04 -0500
Subject: Add PROCFS information to Language Reference

Signed-off-by: Robb Romans <robb@linux.vnet.ibm.com>
Signed-off-by: Josh Stone <jistone@redhat.com>
---
 doc/langref.tex | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

(limited to 'doc/langref.tex')

diff --git a/doc/langref.tex b/doc/langref.tex
index 9a56e5f2..2bc9281d 100644
--- a/doc/langref.tex
+++ b/doc/langref.tex
@@ -910,6 +910,48 @@ function, use \textbf{.statement} probes. Do not use wildcards in
 to not register. Also, run statement probes in guru mode only.
 
 
+\subsection{PROCFS probes}
+\index{PROCFS probes}
+
+These probe points allow procfs pseudo-files in
+\texttt{/proc/systemtap/\textit{MODNAME}} to be created, read and
+written.  Specify the name of the systemtap module as
+\texttt{\textit{MODNAME}}.  There are four probe point variants
+supported by the translator:
+\begin{vindent}
+\begin{verbatim}
+procfs("PATH").read
+procfs("PATH").write
+procfs.read
+procfs.write
+\end{verbatim}
+\end{vindent}
+
+\texttt{PATH} is the file name to be created, relative to
+\texttt{/proc/systemtap/MODNAME}.  If no \texttt{PATH} is specified
+(as in the last two variants in the previous list), \texttt{PATH}
+defaults to "command".
+
+When a user reads \texttt{/proc/systemtap/MODNAME/PATH}, the
+corresponding procfs read probe is triggered.  Assign the string data
+to be read to a variable named \texttt{\$value}, as follows:
+\begin{vindent}
+\begin{verbatim}
+procfs("PATH").read { $value = "100\n" }
+\end{verbatim}
+\end{vindent}
+
+When a user writes into \texttt{/proc/systemtap/MODNAME/PATH}, the
+corresponding procfs write probe is triggered.  The data the user
+wrote is available in the string variable named \texttt{\$value}, as
+follows:
+\begin{vindent}
+\begin{verbatim}
+procfs("PATH").write { printf("User wrote: %s", $value) }
+\end{verbatim}
+\end{vindent}
+
+
 \subsection{Marker probes}
 \index{marker probes}
 This family of probe points connects to static probe markers inserted
-- 
cgit 

