]> sourceware.org Git - systemtap.git/commitdiff
Removed stapfuncs.3stap and moved corresponding information to docstrings.
authorSerguei Makarov <smakarov@redhat.com>
Thu, 7 Jun 2012 17:47:41 +0000 (13:47 -0400)
committerSerguei Makarov <smakarov@redhat.com>
Thu, 7 Jun 2012 17:48:34 +0000 (13:48 -0400)
17 files changed:
Makefile.am
Makefile.in
doc/SystemTap_Tapset_Reference/tapsets.tmpl
runtime/staprun/staprun.8
stap-merge.1
stap-server.8
stap.1
stapex.3stap
stapfuncs.3stap [deleted file]
stappaths.7.in
tapset/dev.stp
tapset/indent.stp
tapset/inet.stp
tapset/queue_stats.stp
tapset/registers.stp [new file with mode: 0644]
tapset/signal.stp
tapset/target_set.stp

index c5f423b426a0418240aee5efa5cb8ab1a5bdb1a2..690684bbf8ec13a330283e3181beac7155b402da 100644 (file)
@@ -17,7 +17,7 @@ AM_CPPFLAGS = -DBINDIR='"$(bindir)"' \
 AM_CFLAGS = -D_GNU_SOURCE -fexceptions -Wall -Werror -Wunused -Wformat=2 -W
 AM_CXXFLAGS = -Wall -Werror
 
-man_MANS = stapprobes.3stap stapfuncs.3stap stapvars.3stap stapex.3stap \
+man_MANS = stapprobes.3stap stapvars.3stap stapex.3stap \
 dtrace.1 stap-merge.1\
 stappaths.7
 
index 0597047b7cf05ec9b6a409db31c315116d99c584..6ce320a042d3899860e7ee41047c1a8d4e3bc5bd 100644 (file)
@@ -435,9 +435,8 @@ AM_CPPFLAGS = -DBINDIR='"$(bindir)"' \
 
 AM_CFLAGS = -D_GNU_SOURCE -fexceptions -Wall -Werror -Wunused -Wformat=2 -W
 AM_CXXFLAGS = -Wall -Werror
-man_MANS = stapprobes.3stap stapfuncs.3stap stapvars.3stap \
-       stapex.3stap dtrace.1 stap-merge.1 stappaths.7 $(am__append_2) \
-       $(am__append_5)
+man_MANS = stapprobes.3stap stapvars.3stap stapex.3stap dtrace.1 \
+       stap-merge.1 stappaths.7 $(am__append_2) $(am__append_5)
 bin_SCRIPTS = stap-report $(am__append_3) $(am__append_7)
 pkglibexec_SCRIPTS = stap-env $(am__append_8)
 oldinclude_HEADERS = includes/sys/sdt.h includes/sys/sdt-config.h
index 4e17e807c70fb96d6bcfc39c0722af3b263fc320..6a31e684ec7d3f57f95127be537be635b13af217 100644 (file)
 !Itapset/task.stp
 !Itapset/pn.stp
 !Itapset/pstrace.stp
+!Itapset/registers.stp
   </chapter>
 
   <chapter id="timestamp_stp">
       It contains the following probe points:
     </para>
 !Itapset/kprocess.stp
+!Itapset/target_set.stp
   </chapter>
   <chapter id="signal.stp">
     <title>Signal Tapset</title>
   <chapter id="errno.stp">
     <title>Errno Tapset</title>
     <para>
-      This set of funciont is used to handle errno number values.
-      It contains the following function:
+      This set of functions is used to handle errno number values.
+      It contains the following functions:
     </para>
 !Itapset/errno.stp
+  </chapter>
+  <chapter id="dev.stp">
+    <title>Device Tapset</title>
+    <para>
+      This set of functions is used to handle kernel and userspace device numbers.
+      It contains the following functions:
+    </para>
+!Itapset/dev.stp
   </chapter>
   <chapter id="dentry.stp">
     <title>Directory-entry (dentry) Tapset</title>
index 8eae097db20a4c70f0bb5719b2d48221c315c68a..766953a06f767406503e316c02ee93be971980ef 100644 (file)
@@ -256,7 +256,6 @@ user and not be world writable.
 .SH SEE ALSO
 .IR stap (1),
 .IR stapprobes (3stap),
-.IR stapfuncs (3stap),
 .IR stap\-server (8),
 .IR stapex (3stap)
 
index 8cc6ac43daa153ece25c128db4fa48c7ae94d131..9d7ef87ec014a7330def0eafdeb074d1a365b6c8 100644 (file)
@@ -84,7 +84,6 @@ stappaths (7) manual page.
 
 .SH SEE ALSO
 .IR stapprobes (3stap),
-.IR stapfuncs (3stap),
 .IR stappaths (7),
 .IR staprun (8),
 .IR stapvars (3stap),
index 3c43b204bcc3040193f96df4ebe99ba494b0f8e6..29f5a8134744645352e08c7568d8bf01b28944f4 100644 (file)
@@ -519,7 +519,6 @@ stappaths (7) manual page.
 .IR stap (1),
 .IR staprun (8),
 .IR stapprobes (3stap),
-.IR stapfuncs (3stap),
 .IR stappaths (7),
 .IR stapex (3stap),
 .IR avahi ,
diff --git a/stap.1 b/stap.1
index aea093641b11af3e4917028df36f04ed7b86c4da..1271d7203a1441df82bde846006626c15a66b44f 100644 (file)
--- a/stap.1
+++ b/stap.1
@@ -1355,11 +1355,12 @@ type and should be treated as a string value, instead of
 the default long numeric.
 
 .SS BUILT-INS
-A set of builtin functions and probe point aliases are provided
-by the scripts installed in the directory specified in the stappaths (7)
+A set of builtin probe point aliases are provided
+by the scripts installed in the directory specified in the
+.IR stappaths (7)
 manual page.  The functions are described in the
-.IR stapfuncs "(3stap) and " stapprobes (3stap)
-manual pages.
+.IR stapprobes (3stap)
+manual page.
 
 .SH PROCESSING
 The translator begins pass 1 by parsing the given input script,
@@ -2093,7 +2094,6 @@ stappaths (7) manual page.
 
 .SH SEE ALSO
 .IR stapprobes (3stap),
-.IR stapfuncs (3stap),
 .IR stappaths (7),
 .IR staprun (8),
 .IR stapvars (3stap),
index 96d6e0f093d03c8bb2ab2b5bc78e82e6a0c3e59b..051eb3cda4c25512afeb798b1d7a64040d0f270c 100644 (file)
@@ -118,5 +118,4 @@ The directory to find more examples can be found in the stappaths (7) manual pag
 .SH SEE ALSO
 .IR stap (1)
 .IR stapprobes (3stap)
-.IR stapfuncs (3stap)
 .IR stappaths (7)
diff --git a/stapfuncs.3stap b/stapfuncs.3stap
deleted file mode 100644 (file)
index c3541be..0000000
+++ /dev/null
@@ -1,310 +0,0 @@
-.\" -*- nroff -*-
-.TH STAPFUNCS 3stap
-.SH NAME
-stapfuncs \- systemtap functions
-
-.SH DESCRIPTION
-The following sections enumerate a few of public functions provided by
-standard tapsets installed, show in the stappaths (7) manual page.   Most
-are individually documented in the 
-.IR 3stap
-manual section, with the
-.IR function::
-prefix.
-.PP
-Each function is described with a signature, and its behavior/restrictions.
-The signature line includes the name of the function, the type of
-its return value (if any), and the names and types of all parameters.
-The syntax is the same as printed with the 
-.IR stap " option " \-p2 .
-Examples:
-
-.TP
-example1:long (v:string, k:long)
-In function "example1", do something with the given string and integer.
-Return some integer.
-
-.TP
-example2:unknown ()
-In function "example2", do something.  There is no explicit return value
-and take no parameters.
-
-
-.SS TARGET_SET
-.TP
-target_set_pid:long (tid:long)
-Return whether the given process-id is within the "target set", that is whether
-it is a descendent of the top-level target() process.
-.TP
-target_set_report:unknown ()
-Print a report about the target set, and their ancestry. 
-
-.SS ERRNO
-.TP
-errno_str:string (e:long)
-Return the symbolic string associated with the given error code, like
-"ENOENT" for the number 2, or "E#3333" for an out-of-range value like 3333.
-
-.SS REGISTERS
-.TP
-register:long (name:string)
-Return the value of the named CPU register,
-as it was saved when the current probe point was hit.
-If the register is 32 bits, it is sign-extended to 64 bits.
-
-For the i386 architecture, the following names are recognized.
-(name1/name2 indicates that name1 and name2 are alternative names
-for the same register.)
-eax/ax, ebp/bp, ebx/bx, ecx/cx, edi/di, edx/dx, eflags/flags,
-eip/ip, esi/si, esp/sp, orig_eax/orig_ax,
-xcs/cs, xds/ds, xes/es, xfs/fs, xss/ss.
-
-For the x86_64 architecture, the following names are recognized:
-64-bit registers:
-r8, r9, r10, r11, r12, r13, r14, r15,
-rax/ax, rbp/bp, rbx/bx, rcx/cx, rdi/di, rdx/dx,
-rip/ip, rsi/si, rsp/sp;
-32-bit registers:
-eax, ebp, ebx, ecx, edx, edi, edx, eip, esi, esp, flags/eflags, orig_eax;
-segment registers: xcs/cs, xss/ss.
-
-For powerpc, the following names are recognized:
-r0, r1, ... r31, nip, msr, orig_gpr3, ctr, link, xer, ccr, softe, trap,
-dar, dsisr, result.
-
-For s390x, the following names are recognized:
-r0, r1, ... r15, args, psw.mask, psw.addr, orig_gpr2, ilc, trap.
-
-.TP
-u_register:long (name:string)
-Same as register(name), except that
-if the register is 32 bits, it is zero-extended to 64 bits.
-
-.SS NUMBERED FUNCTION ARGUMENTS
-The functions in this section provide the values of a probed function's
-arguments.
-They can be called when you have hit
-a probe point at the entry to a function.
-Arguments are referred to by number, starting at 1.
-Ordinarily, you can access arguments by name as well,
-but you may find these functions useful if the code you are probing
-was built without debugging information.
-
-On 32-bit architectures
-\(em and when probing 32-bit applications on 64-bit architectures \(em
-a 64-bit argument occupies two "arg slots."
-For example, if you are probing the following function
-
-   void f(int a, long long b, char *c)
-
-you would refer to a, b, and c as int_arg(1), longlong_arg(2), and
-pointer_arg(3), respectively, on a 64-bit architecture;
-but on a 32-bit architecture, you would refer to c as pointer_arg(4)
-(since b occupies slots 2 and 3).
-
-If the function you are probing doesn't follow the default rules
-for argument passing, you need to call one of the following functions
-(which see) in your handler before calling any *_arg function:
-asmlinkage(), fastcall(), or regparm().
-(This isn't necessary when referring to arguments only by name.)
-.TP
-int_arg:long (n:long)
-Return the value of argument n as a signed int
-(i.e., a 32-bit integer sign-extended to 64 bits).
-.TP
-uint_arg:long (n:long)
-Return the value of argument n as an unsigned int
-(i.e., a 32-bit integer zero-extended to 64 bits).
-.TP
-long_arg:long (n:long)
-Return the value of argument n as a signed long.
-On architectures where a long is 32 bits, the value is sign-extended to 64 bits.
-.TP
-ulong_arg:long (n:long)
-Return the value of argument n as an unsigned long.
-On architectures where a long is 32 bits, the value is zero-extended to 64 bits.
-.TP
-longlong_arg:long (n:long)
-Return the value of argument n as a 64-bit value.
-.TP
-ulonglong_arg:long (n:long)
-Same as longlong_arg(n).
-.TP
-pointer_arg:long (n:long)
-Same as ulong_arg(n).
-Use with any type of pointer.
-.TP
-s32_arg:long (n:long)
-Same as int_arg(n).
-.TP
-u32_arg:long (n:long)
-Same as uint_arg(n).
-.TP
-s64_arg:long (n:long)
-Same as longlong_arg(n).
-.TP
-u64_arg:long (n:long)
-Same as [u]longlong_arg(n).
-.TP
-asmlinkage:unknown ()
-The probed kernel function is declared asmlinkage in the source.
-.TP
-fastcall:unknown ()
-The probed kernel function is declared fastcall in the source.
-.TP
-regparm:unknown (n:long)
-The probed function was built with the gcc \-mregparm=n option.
-(The i386 kernel is built with \-mregparm=3, so systemtap considers
-regparm(3) the default for kernel functions on that architecture.)
-Only valid on i386 and x86_64 (when probing 32bit applications).
-Produces an error on other architectures.
-
-For some architectures, the *_arg functions may reject unusually high
-values of n.
-
-.SS QUEUE_STATS
-.PP
-The queue_stats tapset provides functions that, given notifications of
-elementary queuing events (wait, run, done), tracks averages such as
-queue length, service and wait times, utilization.  The following
-three functions should be called from appropriate probes, in sequence.
-.TP
-qs_wait:unknown (qname:string)
-Record that a new request was enqueued for the given queue name.
-.TP
-qs_run:unknown (qname:string)
-Record that a previously enqueued request was removed from the given
-wait queue and is now being serviced.
-.TP
-qs_done:unknown (qname:string)
-Record that a request originally from the given queue has completed
-being serviced.
-.\" XXX: qs_time
-.PP
-Functions with the prefix 
-.BR qsq_
-are for querying the statistics averaged since the first queue operation
-(or when
-.BR qsq_start
-was called). Since statistics are often fractional, a scale parameter
-is multiplies the result to a more useful scale.  For some fractions,
-a scale of 100 will usefully return percentage numbers.
-.TP
-qsq_start:unknown (qname:string)
-Reset the statistics counters for the given queue, and start tracking
-anew from this moment.
-.TP
-qsq_print:unknown (qname:string)
-Print a line containing a selection of the given queue's statistics.
-.TP
-qsq_utilization:long (qname:string, scale:long)
-Return the fraction of elapsed time when the resource was utilized.
-.TP
-qsq_blocked:long (qname:string, scale:long)
-Return the fraction of elapsed time when the wait queue was used.
-.TP
-qsq_wait_queue_length:long (qname:string, scale:long)
-Return the average length of the wait queue.
-.TP
-qsq_service_time:long (qname:string, scale:long)
-Return the average time required to service a request.
-.TP
-qsq_wait_time:long (qname:string, scale:long)
-Return the average time a request took from being enqueued to completed.
-.TP
-qsq_throughput:long (qname:string, scale:long)
-Return the average rate of requests per scale units of time.
-
-.SS INDENT
-.PP
-The indent tapset provides functions to generate indented lines for
-nested kinds of trace messages.  Each line contains a relative
-timestamp, and the process name / pid.
-.TP
-thread_indent:string (delta:long)
-Return a string with an appropriate indentation for this thread.
-Call it with a small positive or matching negative delta.
-If this is the outermost, initial level of indentation, reset the
-relative timestamp base to zero.
-.TP
-thread_timestamp:long ()
-Return an absolute timestamp value for use by the indentation function.
-The default function uses 
-.IR gettimeofday_us
-
-.SS SYSTEM
-.TP
-system (cmd:string)
-Runs a command on the system. The command will run in the background
-when the current probe completes.
-
-
-.SS INET
-These functions convert between network (big-endian) and host byte order, like their
-namesake C functions.
-.TP
-ntohll:long (x:long)
-Convert from network to host byte order, 64-bit.
-.TP
-ntohl:long (x:long)
-Convert from network to host byte order, 32-bit.
-.TP
-ntohs:long (x:long)
-Convert from network to host byte order, 16-bit.
-.TP
-htonll:long (x:long)
-Convert from host to network byte order, 64-bit.
-.TP
-htonl:long (x:long)
-Convert from host to network byte order, 32-bit.
-.TP
-htons:long (x:long)
-Convert from host to network byte order, 16-bit.
-
-.SS SIGNAL
-.TP
-get_sa_flags:long (act:long)
-Returns the numeric value of sa_flags.
-.TP
-get_sa_handler:long (act:long)
-Returns the numeric value of sa_handler.
-.TP
-sigset_mask_str:string (mask:long)
-Returns the string representation of the sigset sa_mask.
-.TP
-is_sig_blocked:long (task:long, sig:long)
-Returns 1 if the signal is currently blocked, or 0 if it is not.
-.TP
-sa_flags_str:string (sa_flags:long)
-Returns the string representation of sa_flags.
-.TP
-sa_handler_str(handler)
-Returns the string representation of sa_handler. If it is not SIG_DFL, SIG_IGN
-or SIG_ERR, it will return the address of the handler.
-.TP
-signal_str(num)
-Returns the string representation of the given signal number.
-
-.SS DEVICE
-.TP
-MAJOR:long(dev:long)
-Extracts the major device number from a kernel device number (kdev_t).
-.TP
-MINOR:long(dev:long)
-Extracts the minor device number from a kernel device number (kdev_t).
-.TP
-MKDEV:long(major:long, minor:long)
-Creates a value that can be compared to a kernel device number (kdev_t).
-.TP
-usrdev2kerndev:long(dev:long)
-Converts a user-space device number into the format used in the kernel.
-
-.SH FILES
-.TP
-More files and their corresponding paths can be found in the stappaths (7) manual page.
-
-.SH SEE ALSO
-.IR stap (1),
-.IR function::* (3stap),
-.IR tapset::* (3stap),
-.IR stappaths (7)
index 52fee6df8c5ff9445eb326103f6257a90b4a96fc..8a07729106cd835670ea223f4a8549f2b7253d89 100644 (file)
@@ -29,11 +29,11 @@ by the
 environment variable or the
 .I XDG_DATA_DIRS
 environment variable.
-This directory stores a set of builtin functions and probe point
+This directory stores a set of builtin probe point
 aliases are provided by the scripts installed here.
 These are described in the
-.IR stapfuncs "(3stap) and " stapprobes (3stap)
-manual pages.
+.IR stapprobes (3stap)
+manual page.
 .TP
 Runtime Path: @prefix@/share/systemtap/runtime/
 The runtime sources, unless overridden by the
@@ -132,7 +132,6 @@ stap\-server service default log file.
 
 .SH SEE ALSO
 .IR stapprobes (3stap),
-.IR stapfuncs (3stap),
 .IR staprun (8),
 .IR stapvars (3stap),
 .IR stapex (3stap),
index 2c22031add72579a77e53a7b485c68cc18d03d77..bb840ba1a957a10dde484ab9fe17578cbf145329 100644 (file)
 #include <linux/kdev_t.h>
 %}
 
+/**
+ * sfunction MAJOR - Extract major device number from a kernel device number (kdev_t)
+ *
+ * @dev: Kernel device number to query.
+ */
 function MAJOR:long(dev:long)
 %{ /* pure */
     THIS->__retvalue = MAJOR(THIS->dev);
 %}
 
 
+/**
+ * sfunction MINOR - Extract minor device number from a kernel device number (kdev_t)
+ *
+ * @dev: Kernel device number to query.
+ */
 function MINOR:long(dev:long)
 %{ /* pure */
     THIS->__retvalue = MINOR(THIS->dev);
 %}
 
 
+/**
+ * sfunction MKDEF - Creates a value that can be compared to a kernel device number (kdev_t)
+ *
+ * @major: Intended major device number.
+ * @minor: Intended minor device number.
+ */
 function MKDEV:long(major:long, minor:long)
 %{ /* pure */
     THIS->__retvalue = MKDEV(THIS->major,THIS->minor);
 %}
 
+/**
+ * sfunction usrdev2kerndev - Converts a user-space device number into the format used in the kernel
+ *
+ * @dev: Device number in user-space format.
+ */
 function usrdev2kerndev:long(dev:long)
 %{ /* pure */
     THIS->__retvalue = new_decode_dev(THIS->dev);
index e3996c57cbf0c27c713405157125834e9674f886..bc608461ba6e91a1015641f52aa2eac8fb55aab3 100644 (file)
@@ -1,3 +1,10 @@
+/* <tapsetdescription>
+ * The indent tapset provides functions to generate indented lines for
+ * nested kinds of trace messages.  Each line contains a relative
+ * timestamp, and the process name / pid.
+ * </tapsetdescription>
+ */
+
 global _indent_counters, _indent_timestamps
 
 function _generic_indent (idx, desc, delta) 
index 6b0cfd910d64d4785f006957be091a4db4e7b0a1..4eb5c52abbb23391b47cc737c58c72e794aea2a6 100644 (file)
@@ -1,5 +1,11 @@
 /* Some functions from libc <arpa/inet.h> */
 
+/* <tapsetdescription>
+ * These functions convert between network (big-endian) and host byte
+ * order, like their namesake C functions.
+ * </tapsetdescription>
+ */
+
 /**
  * sfunction htonll - Convert 64-bit long long from host to network order
  * @x: Value to convert
index ea283a26566cf6592be4c428835e927b03798d1c..b0ee7f883ab8cd2d4ae2c5951250ea82d45896d8 100644 (file)
@@ -1,4 +1,20 @@
 # qstats.stp: Queue statistics gathering tapset
+/* <tapsetdescription>
+ * The queue_stats tapset provides functions that,
+ * given notifications of elementary queuing events (wait, run, done),
+ * tracks averages such as queue length, service and wait times,
+ * utilization.
+ * 
+ * The functions qs_wait(), qs_run(), and qs_done() should be called
+ * from appropriate probes, in sequence.
+ * 
+ * Functions with the prefix qsq_ are for querying the statistics averaged
+ * since the first queue operation (or when qsq_start() was called).
+ * Since statistics are often fractional, a scale parameter is used to
+ * multiply the result to a more useful scale. For some fractions, a scale
+ * of 100 will usefully return percentage numbers.
+ * </tapsetdescription>
+ */
 
 # ------------------------------------------------------------------------
 
@@ -6,6 +22,7 @@
 # go into a separate file (say, qstats_qs_time.stp), so that a user
 # script can override it with another definition.
 
+/* XXX: docstring */
 function qs_time () { return gettimeofday_us () }
 
 # ------------------------------------------------------------------------
@@ -57,7 +74,7 @@ function qs_run (qname:string) { # starting to service request
 }
 
 /**
- * sfunction qs_run - Function to record finishing request 
+ * sfunction qs_done - Function to record finishing request 
  * @qname: the name of the service that finished 
  *
  * Description: This function records that a request 
@@ -188,7 +205,7 @@ function qsq_throughput:long (qname:string, scale:long) {
 # ------------------------------------------------------------------------
 
 /**
- * sfunction qsq_blocked - Returns a line of statistics for the given queue
+ * sfunction qsq_print - Prints a line of statistics for the given queue
  * @qname: queue name
  *
  * Description: This function prints a line containing the following
diff --git a/tapset/registers.stp b/tapset/registers.stp
new file mode 100644 (file)
index 0000000..aad061d
--- /dev/null
@@ -0,0 +1,228 @@
+/* This is a stub tapset documenting a number of
+ * architecture-dependent functions. For actual implementation of the
+ * functions, see tapset/ARCH/registers.stp. */
+
+/* <tapsetdescription>
+ * The functions in this tapset can be used to access information
+ * from the context at the time a probe point was hit. This includes
+ * functions to access named CPU registers, and functions that provide
+ * the values of a probed function's arguments. (The latter can be
+ * called when you have hit a probe point at the entry to a function,
+ * and are useful when the code you are probing was built without debugging
+ * informaiton.)
+ *
+ * Function arguments are referred to by number, starting at 1.
+ * On 32-bit architectures
+ * (and when probing 32-bit applications on 64-bit architectures)
+ * a 64-bit argument occupies two "arg slots."
+ * For example, if you are probing the following function
+ * 
+ *    void f(int a, long long b, char *c)
+ * 
+ * you would refer to a, b, and c as int_arg(1), longlong_arg(2), and
+ * pointer_arg(3), respectively, on a 64-bit architecture;
+ * but on a 32-bit architecture, you would refer to c as pointer_arg(4)
+ * (since b occupies slots 2 and 3).
+ * 
+ * If the function you are probing doesn't follow the default rules
+ * for argument passing, you need to call one of the following functions
+ * in your handler before calling any *_arg function:
+ * asmlinkage(), fastcall(), or regparm().
+ * (This isn't necessary when referring to arguments only by name.)
+ * 
+ * For some architectures, the *_arg functions may reject unusually
+ * high values of n.
+ * </tapsetdescription> */
+
+(% kernel_vr == "invalidkernel" %?
+
+/**
+ * sfunction register - Return the signed value of the named CPU register
+ *
+ * @name: Name of the register to return
+ *
+ * Description: Return the value of the named CPU register,
+ * as it was saved when the current probe point was hit.
+ * If the register is 32 bits, it is sign-extended to 64 bits.
+ * 
+ * For the i386 architecture, the following names are recognized.
+ * (name1/name2 indicates that name1 and name2 are alternative names
+ * for the same register.)
+ * eax/ax, ebp/bp, ebx/bx, ecx/cx, edi/di, edx/dx, eflags/flags,
+ * eip/ip, esi/si, esp/sp, orig_eax/orig_ax,
+ * xcs/cs, xds/ds, xes/es, xfs/fs, xss/ss.
+ * 
+ * For the x86_64 architecture, the following names are recognized:
+ * 64-bit registers:
+ * r8, r9, r10, r11, r12, r13, r14, r15,
+ * rax/ax, rbp/bp, rbx/bx, rcx/cx, rdi/di, rdx/dx,
+ * rip/ip, rsi/si, rsp/sp;
+ * 32-bit registers:
+ * eax, ebp, ebx, ecx, edx, edi, edx, eip, esi, esp, flags/eflags,
+ * orig_eax; segment registers: xcs/cs, xss/ss.
+ * 
+ * For powerpc, the following names are recognized:
+ * r0, r1, ... r31, nip, msr, orig_gpr3, ctr, link, xer, ccr, softe, trap,
+ * dar, dsisr, result.
+ * 
+ * For s390x, the following names are recognized:
+ * r0, r1, ... r15, args, psw.mask, psw.addr, orig_gpr2, ilc, trap.
+ */
+function register:long (name:string) { }
+
+/**
+ * sfunction u_register - Return the unsigned value of the named CPU register
+ * 
+ * @name: Name of the register to return
+ *
+ * Description: Same as register(name), except that if the register
+ * is 32 bits wide, it is zero-extended to 64 bits.
+ */
+function u_register:long (name:string) { }
+
+/**
+ * sfunction int_arg - Return function argument as signed int
+ *
+ * @n: index of argument to return
+ *
+ * Description: Return the value of argument n as a signed int
+ * (i.e., a 32-bit integer sign-extended to 64 bits).
+ */
+function int_arg:long (n:long) { }
+
+/**
+ * sfunction uint_arg - Return function argument as unsigned int
+ *
+ * @n: index of argument to return
+ *
+ * Description: Return the value of argument n as an unsigned int
+ * (i.e., a 32-bit integer zero-extended to 64 bits).
+ */
+function uint_arg:long (n:long) { }
+
+/**
+ * sfunction long_arg - Return function argument as signed long
+ *
+ * @n: index of argument to return
+ *
+ * Description: Return the value of argument n as a signed long.
+ * On architectures where a long is 32 bits, the value is sign-extended
+ * to 64 bits.
+ */
+function long_arg:long (n:long) { }
+
+/**
+ * sfunction ulong_arg - Return function argument as unsigned long
+ *
+ * @n: index of argument to return
+ *
+ * Description: Return the value of argument n as an unsigned long.
+ * On architectures where a long is 32 bits, the value is zero-extended
+ * to 64 bits.
+ */
+function ulong_arg:long (n:long) { }
+
+/**
+ * sfunction longlong_arg - Return function argument as 64-bit value
+ *
+ * @n: index of argument to return
+ *
+ * Description: Return the value of argument n as a 64-bit value.
+ */
+function longlong_arg:long (n:long) { }
+
+/**
+ * sfunction ulonglong_arg - Return function argument as 64-bit value
+ *
+ * @n: index of argument to return
+ *
+ * Description: Return the value of argument n as a 64-bit value.
+ * (Same as longlong_arg.)
+ */
+function ulonglong_arg:long (n:long) { }
+
+/**
+ * sfunction pointer_arg - Return function argument as pointer value
+ *
+ * @n: index of argument to return
+ *
+ * Description: Return the unsigned value of argument n, same as ulong_arg.
+ * Can be used with any type of pointer.
+ */
+function pointer_arg:long (n:long) { }
+
+/**
+ * sfunction s32_arg - Return function argument as signed 32-bit value
+ *
+ * @n: index of argument to return
+ *
+ * Description: Return the signed 32-bit value of argument n,
+ * same as int_arg.
+ */
+function s32_arg:long (n:long) { }
+
+/**
+ * sfunction u32_arg - Return function argument as unsigned 32-bit value
+ *
+ * @n: index of argument to return
+ *
+ * Description: Return the unsigned 32-bit value of argument n,
+ * same as uint_arg.
+ */
+function u32_arg:long (n:long) { }
+
+/**
+ * sfunction s64_arg - Return function argument as signed 64-bit value
+ *
+ * @n: index of argument to return
+ *
+ * Description: Return the signed 64-bit value of argument n,
+ * same as longlong_arg.
+ */
+function s64_arg:long (n:long) { }
+
+/**
+ * sfunction u64_arg - Return function argument as unsigned 64-bit value
+ *
+ * @n: index of argument to return
+ *
+ * Description: Return the unsigned 64-bit value of argument n,
+ * same as ulonglong_arg.
+ */
+function u64_arg:long (n:long) { }
+
+/**
+ * sfunction asmlinkage - Mark function as declared asmlinkage
+ *
+ * Description: Call this function before accessing arguments
+ * using the *_arg functions
+ * if the probed kernel function was declared asmlinkage in the source.
+ */
+function asmlinkage() { }
+
+/**
+ * sfunction fastcall - Mark function as declared fastcall
+ *
+ * Description: Call this function before accessing arguments
+ * using the *_arg functions
+ * if the probed kernel function was declared fastcall in the source.
+ */
+function fastcall() { }
+
+/**
+ * sfunction regparm - Specify regparm value used to compile function
+ *
+ * @n: original regparm value
+ *
+ * Description: Call this function with argument n before accessing function
+ * arguments using the *_arg function is the function was build with the
+ * gcc -mregparm=n option.
+ *
+ * (The i386 kernel is built with \-mregparm=3, so systemtap considers
+ * regparm(3) the default for kernel functions on that architecture.)
+ * Only valid on i386 and x86_64 (when probing 32bit applications).
+ * Produces an error on other architectures.
+ */
+function regparm(n:long) { }
+
+%)
index bf8454d75489db7e0bebf8b58cde31aa48cec7df..fbfd8c46b059d4804b2225062c827d737c244979 100644 (file)
@@ -748,11 +748,21 @@ probe signal.flush = kernel.function("flush_signals")
     pid_name = kernel_string($t->comm)
 }
 
+/**
+ * sfunction get_sa_flags - Returns the numeric value of sa_flags
+ *
+ * @act: address of the sigaction to query.
+ */
 function get_sa_flags:long (act:long)
 {
        return @cast(act, "k_sigaction", "kernel")->sa->sa_flags
 }
 
+/**
+ * sfunction get_sa_flags - Returns the numeric value of sa_handler
+ *
+ * @act: address of the sigaction to query.
+ */
 function get_sa_handler:long (act:long)
 {
        return @cast(act, "k_sigaction", "kernel")->sa->sa_handler
@@ -779,6 +789,11 @@ function get_sa_handler:long (act:long)
 //         sigset_t sa_mask;
 // };
 
+/**
+ * sfunction get_sa_flags - Returns the string representation of a sigset
+ *
+ * @mask: the sigset to convert to string.
+ */
 function sigset_mask_str:string (mask:long) %{ /* pure */
        int i, len;
        char *str = THIS->__retvalue, tmp[5];
@@ -799,6 +814,12 @@ function sigset_mask_str:string (mask:long) %{ /* pure */
 // [...]
 //         sigset_t blocked, real_blocked;
 
+/**
+ * sfunction is_sig_blocked - Returns 1 if the signal is currently blocked, or 0 if it is not
+ *
+ * @task: address of the task_struct to query.
+ * @sig: the signal number to test.
+ */
 function is_sig_blocked:long (task:long, sig:long) %{ /* pure */
        int i;
        sigset_t blocked;
@@ -809,6 +830,11 @@ function is_sig_blocked:long (task:long, sig:long) %{ /* pure */
        CATCH_DEREF_FAULT();
 %}
 
+/**
+ * sfunction sa_flags_str - Returns the string representation of sa_flags
+ *
+ * @sa_flags: the set of flags to convert to string.
+ */
 function sa_flags_str:string (sa_flags:long) %{ /* pure */
        int len;
        char *str = THIS->__retvalue;
@@ -825,6 +851,15 @@ function sa_flags_str:string (sa_flags:long) %{ /* pure */
        if (len) str[len - 1] = '\0';
 %}
 
+/**
+ * sfunction sa_handler - Returns the string representation of an sa_handler
+ *
+ * @handler: the sa_handler to convert to string.
+ *
+ * Description: Returns the string representation of an sa_handler.
+ * If it is not SIG_DFL, SIG_IGN or SIG_ERR, it will return the address
+ * of the handler.
+ */
 function sa_handler_str(handler) {
        if (handler == 0) return "default"; /* SIG_DFL */
        if (handler == 1) return "ignored"; /* SIG_IGN */
@@ -836,6 +871,11 @@ function sa_handler_str(handler) {
 
 global __sig[64]
 
+/**
+ * sfunction signal_str - Returns the string representation of a signal number
+ *
+ * @num: the signal number to convert to string.
+ */
 function signal_str(num) {
     if (!(64 in __sig)) {
        __sig[1] = "HUP"
index c3b1d2f9a3bb9f1ada69986850167ac9eadb3e36..b9bb687b34a7e620e642462df73f1d9e670b7816 100644 (file)
@@ -1,6 +1,15 @@
 
 global _target_set # map: target-set-pid -> ancestor-pid
 
+/**
+ * sfunction target_set_pid - Does pid descend from target process?
+ *
+ * @pid: The pid of the process to query
+ *
+ * Description: This function returns whether the given process-id is
+ * within the "target set", that is whether it is a descendant of the
+ * top-level target() process.
+ */
 function target_set_pid (pid)
 {
        return ([pid] in _target_set)
@@ -48,6 +57,12 @@ probe syscall.exit
 }
 %)
 
+/**
+ * sfunction target_set_report - Print a report about the target set
+ *
+ * Description: This function prints a report about the processes in the
+ * target set, and their ancestry.
+ */
 function target_set_report ()
 {
        printf("target set:\n")
This page took 0.059274 seconds and 5 git commands to generate.