From: Mark Wielaard Date: Sun, 25 Dec 2011 19:56:53 +0000 (+0100) Subject: Use function.call and function.return in all thread_indent() examples. X-Git-Tag: release-1.7~59 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=2e96e9163d84fe9772def0318216a6d6da1332a2;p=systemtap.git Use function.call and function.return in all thread_indent() examples. If the .call modifier isn't used the function probes will match both .call and .inline, but .return doesn't match any inlined functions leading to unbalanced thread_indent output. --- diff --git a/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml b/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml index 06e117e6b..682e60e82 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Scripts.xml @@ -955,7 +955,7 @@ hald(2360) open thread_indent.stp -probe kernel.function("*@net/socket.c") +probe kernel.function("*@net/socket.c").call { printf ("%s -> %s\n", thread_indent(1), probefunc()) } diff --git a/doc/tutorial.tex b/doc/tutorial.tex index e948ade1f..10654d75f 100644 --- a/doc/tutorial.tex +++ b/doc/tutorial.tex @@ -272,7 +272,7 @@ interrupt it with \verb+^C+ when you want the tracing to stop. \begin{boxedminipage}{4.5in} \begin{verbatim} # cat socket-trace.stp -probe kernel.function("*@net/socket.c") { +probe kernel.function("*@net/socket.c").call { printf ("%s -> %s\n", thread_indent(1), probefunc()) } probe kernel.function("*@net/socket.c").return { @@ -317,6 +317,16 @@ probe kernel.function("*@net/socket.c").return { probe handler as in Figure~\ref{fig:socket-trace}. Print parameters using \verb+$$parms+ and \verb+$$return+. Interpret the results. +\item Change figure~\ref{fig:socket-trace} by removing the \verb+.call+ + modifier from the first probe. Note how function entry and function + return now don't match anymore. This is because now the first probe + will match both normal function entry and inlined functions. Try + putting the \verb+.call+ modifier back and add another probe just for + \verb+probe kernel.function("*@net/socket.c").return+ + What \verb+printf+ statement can you come up with in the probe handler + to show the inlined function entries nicely in between the \verb+.call+ + and \verb+.return+ thread indented output? + \end{enumerate} \section{Analysis} diff --git a/doc/tutorial/socket-trace.stp b/doc/tutorial/socket-trace.stp index 53b69ecc6..a34a33a8c 100644 --- a/doc/tutorial/socket-trace.stp +++ b/doc/tutorial/socket-trace.stp @@ -1,4 +1,4 @@ -probe kernel.function("*@net/socket.c") { +probe kernel.function("*@net/socket.c").call { printf ("%s -> %s\n", thread_indent(1), probefunc()) } probe kernel.function("*@net/socket.c").return {