From f3e3c3e3863523382df6b7d07b57b16ef43546db Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 15 Sep 2009 12:46:22 -0700 Subject: Fix some probe examples in the language reference * doc/langref.tex (section{Components of a SystemTap script}): Use .call/.return for the example of tracing function entry/exit. Also mention "-l" for listing probeable functions. (subsection{Embedded C functions}): Close the examples with '%}'. --- doc/langref.tex | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'doc/langref.tex') diff --git a/doc/langref.tex b/doc/langref.tex index aa583c2e..e460defd 100644 --- a/doc/langref.tex +++ b/doc/langref.tex @@ -327,18 +327,17 @@ two probes. \begin{vindent} \begin{verbatim} -probe kernel.function("sys_mkdir") { log ("enter") } +probe kernel.function("sys_mkdir").call { log ("enter") } probe kernel.function("sys_mkdir").return { log ("exit") } \end{verbatim} \end{vindent} -To list the probe-able functions in the kernel, use the last-pass option -to the translator. The output needs to be filtered because each inlined function -instance is listed separately. The following statement is an example. +To list the probe-able functions in the kernel, use the listing option +(\texttt{\textbf{-l}}). For example: \begin{vindent} \begin{verbatim} -# stap -p2 -e 'probe kernel.function("*") {}' | sort | uniq +# stap -l 'kernel.function("*")' | sort \end{verbatim} \end{vindent} @@ -601,11 +600,11 @@ are examples. \begin{verbatim} function add_one (val) %{ THIS->__retvalue = THIS->val + 1; -} +%} function add_one_str (val) %{ strlcpy (THIS->__retvalue, THIS->val, MAXSTRINGLEN); strlcat (THIS->__retvalue, "one", MAXSTRINGLEN); -} +%} \end{verbatim} \end{vindent} The function argument and return value types must be inferred by the translator -- cgit