]> sourceware.org Git - systemtap.git/commitdiff
langref.tex: document various embedded-C pragmas
authorSerguei Makarov <smakarov@redhat.com>
Mon, 10 Sep 2012 16:44:49 +0000 (12:44 -0400)
committerSerguei Makarov <smakarov@redhat.com>
Mon, 10 Sep 2012 16:44:49 +0000 (12:44 -0400)
doc/langref.tex
stap.1

index 38229cc065798de5699a8600f8d7d928e7b4b6a5..7f0962dc91e5bcf847dfa47dfb1236cadfd9c09e 100644 (file)
@@ -734,6 +734,37 @@ embedded-C. Note that all SystemTap functions and probes run with interrupts
 disabled, thus you cannot call functions that might sleep within the embedded
 C.
 
+\subsection{Embedded C pragma comments}
+
+Embedded C blocks may contain various markers to assert optimization
+and safety properties.
+
+\begin{itemize}
+\item \verb+/* pure */+ means that the C code has no side effects and
+  may be elided entirely if its value is not used by script code.
+\item \verb+/* unprivileged */+ means that the C code is so safe that
+  even unprivileged users are permitted to use it. (This is useful, in
+  particular, to define an embedded-C function inside a tapset that
+  may be used by unprivileged code.)
+\item \verb+/* myproc-unprivileged */+ means that the C code is so
+  safe that even unprivileged users are permitted to use it, provided
+  that the target of the current probe is within the user's own
+  process.
+\item \verb+/* guru */+ means that the C code is so unsafe that a
+  systemtap user must specify \verb+-g+ (guru mode) to use this, even
+  if the C code is being exported from a tapset.
+\item \verb+/* unmangled */+, used in an embedded-C function, means
+  that the legacy (pre-1.8) argument access syntax should be made
+  available inside the function. Hence, in addition to
+  \verb+STAP_ARG_foo+ and \verb+STAP_RETVALUE+ one can use
+  \verb+THIS->foo+ and \verb+THIS->__retvalue+ respectively inside the
+  function. This is useful for quickly migrating code written for
+  SystemTap version 1.7 and earlier.
+\item \verb+/* string */+ in embedded-C expressions only, means that
+  the expression has \verb+const char *+ type and should be treated as
+  a string value, instead of the default long numeric.
+\end{itemize}
+
 \section{Probe points\label{sec:Probe-Points}}
 \index{probe points}
 \subsection{General syntax}
diff --git a/stap.1 b/stap.1
index 25653c41ccf2e9e39af3d58f86cf7b2a0f933fa5..bffb1e7fcfb20dd6bc769dd61c9ecc39b1a186d3 100644 (file)
--- a/stap.1
+++ b/stap.1
@@ -1404,7 +1404,9 @@ means that the C code is so unsafe that a systemtap user must specify
 (guru mode) to use this.
 .TP
 .I /* unmangled */
-means that the legacy (pre-1.8) argument access syntax should be made available inside the function. Hence, in addition to
+in an embedded-C function, means that the legacy (pre-1.8) argument
+access syntax should be made available inside the function. Hence, in
+addition to
 .I STAP_ARG_foo
 and
 .I STAP_RETVALUE
@@ -1412,7 +1414,7 @@ one can use
 .I THIS->foo
 and
 .I THIS->__retvalue
-respectively in side the function. This is useful for quickly migrating code written for SystemTap version 1.7 and earlier.
+respectively inside the function. This is useful for quickly migrating code written for SystemTap version 1.7 and earlier.
 .TP
 .I /* string */
 in embedded-C expressions only, means that the expression has
This page took 0.033646 seconds and 5 git commands to generate.