]> sourceware.org Git - systemtap.git/commitdiff
Use function.call and function.return in all thread_indent() examples.
authorMark Wielaard <mjw@redhat.com>
Sun, 25 Dec 2011 19:56:53 +0000 (20:56 +0100)
committerMark Wielaard <mjw@redhat.com>
Sun, 25 Dec 2011 20:12:29 +0000 (21:12 +0100)
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.

doc/SystemTap_Beginners_Guide/en-US/Scripts.xml
doc/tutorial.tex
doc/tutorial/socket-trace.stp

index 06e117e6b0b42e9e4c54fed0d911aa332f85d4c2..682e60e820e7c637270bf204c691ef57d39b6da6 100644 (file)
@@ -955,7 +955,7 @@ hald(2360) open</screen>
                                         </para>
 
 <example id="thread_indent"><title>thread_indent.stp</title>
-<programlisting>probe kernel.function("*@net/socket.c")
+<programlisting>probe kernel.function("*@net/socket.c").call
 {
   printf ("%s -> %s\n", thread_indent(1), probefunc())
 }
index e948ade1fc6e9c3a202274ec9739e03c674e6d57..10654d75f7eeef77c7388e6612f14f516bd3fddc 100644 (file)
@@ -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}
index 53b69ecc602731e51619d506521a23e26f3cc9f3..a34a33a8cea66c90ea5ae2c6b9b961b01944ec7b 100644 (file)
@@ -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 {
This page took 0.033844 seconds and 5 git commands to generate.