]> sourceware.org Git - systemtap.git/blobdiff - stapprobes.3stap
Don't compile csclient.cxx and cscommon.cxx when HAVE_NSS is false.
[systemtap.git] / stapprobes.3stap
index 9bb3fa330f7cb08c75fd474e2affdee968c5733c..443eb91ff67a7c123c7f90d41dab5c081f486b06 100644 (file)
@@ -1,4 +1,4 @@
-.\" -*- nroff -*-
+.\" t
 .TH STAPPROBES 3stap 
 .SH NAME
 stapprobes \- systemtap probe points
@@ -73,7 +73,6 @@ signal.*? if (switch)
 kprobe.function("foo")
 .ESAMPLE
 
-
 Probes may be broadly classified into "synchronous" and
 "asynchronous".  A "synchronous" event is deemed to occur when any
 processor executes an instruction matched by the specification.  This
@@ -86,6 +85,40 @@ wildcards or aliases), and all them are then probed.  A probe
 declaration may also contain several comma-separated specifications,
 all of which are probed.
 
+.SH DWARF DEBUGINFO
+
+Resolving some probe points requires DWARF debuginfo or "debug
+symbols" for the specific part being instrumented.  For some others,
+DWARF is automatically synthesized on the fly from source code header
+files.  For others, it is not needed at all.  Since a systemtap script
+may use any mixture of probe points together, the union of their DWARF
+requirements has to be met on the computer where script compilation
+occurs.  (See the \fI\-\-use\-server\fR option and the \fBstap-server\
+(8)\fR man page for information about the remote compilation facility,
+which allows these requirements to be met on a different machine.)
+.PP
+The following point lists many of the available probe point families,
+to classify them with respect to their need for DWARF debuginfo.
+
+.TS
+l l l.
+\fBDWARF       NON-DWARF\fP
+
+kernel.function, .statement    kernel.mark
+module.function, .statement    process.mark
+process.function, .statement   begin, end, error, never
+process.mark \fI(backup)\fP    timer
+       perf
+       procfs
+\fBAUTO-DWARF\fP       kernel.statement.absolute
+       kernel.data
+kernel.trace   kprobe.function
+       process.statement.absolute
+       process.begin, .end, .error
+.TE
+
+.SH PROBE POINT FAMILIES
+
 .SS BEGIN/END/ERROR
 
 The probe points
@@ -153,7 +186,7 @@ return do not have a corresponding
 .IR .return
 probe.
 .PP
-Each probe alias defines a variety of variables. Looking at the tapset source
+Each probe alias provides a variety of variables. Looking at the tapset source
 code is the most reliable way.  Generally, each variable listed in the standard
 manual page is made available as a script-level variable, so
 .IR syscall.open
@@ -170,8 +203,11 @@ The name of the system call.
 .IR retstr
 For return probes, a pretty-printed form of the system-call result.
 .PP
-Not all probe aliases obey all of these general guidelines.  Please report
-any bothersome ones you encounter as a bug.
+As usual for probe aliases, these variables are all simply initialized
+once from the underlying $context variables, so that later changes to
+$context variables are not automatically reflected.  Not all probe
+aliases obey all of these general guidelines.  Please report any
+bothersome ones you encounter as a bug.
 
 
 .SS TIMERS
@@ -256,8 +292,9 @@ modifier for
 filters the results to include only instances of inlined functions.
 The
 .B .call
-modifier selects the opposite subset.  Inline functions do not have an
-identifiable return point, so
+modifier selects the opposite subset.  The \textbf{.exported} modifier
+filters the results to include only exported functions.  Inline
+functions do not have an identifiable return point, so
 .B .return
 is not supported on 
 .B .inline
@@ -285,6 +322,8 @@ module(MPATTERN).function(PATTERN).return
 .br
 module(MPATTERN).function(PATTERN).inline
 .br
+module(MPATTERN).function(PATTERN).label(LPATTERN)
+.br
 .br
 kernel.statement(PATTERN)
 .br
@@ -296,6 +335,10 @@ process("PATH").function("NAME")
 .br
 process("PATH").statement("*@FILE.c:123")
 .br
+process("PATH").library("PATH").function("NAME")
+.br
+process("PATH").library("PATH").statement("*@FILE.c:123")
+.br
 process("PATH").function("*").return
 .br
 process("PATH").function("myfun").label("foo")
@@ -333,7 +376,7 @@ or a "+".  The line number is assumed to be an
 absolute line number if preceded by a ":", or relative to the entry of
 the function if preceded by a "+".  
 All the lines in the function can be matched with ":*".  
-A range of lines x through y can be matched with ":x-y".
+A range of lines x through y can be matched with ":x\-y".
 .PP
 As an alternative, PATTERN may be a numeric constant, indicating an
 address.  Such an address may be found from symbol tables of the
@@ -367,6 +410,28 @@ pointers (char *) may be copied to systemtap string values using the
 .IR kernel_string " or " user_string
 functions.
 .TP
+@var("varname")
+an alternative syntax for
+.IR $varname
+.
+.TP
+@var("varname@src/file.c")
+refers to the global (either file local or external) variable
+.IR varname
+defined when the file
+.IR src/file.c
+was compiled. The CU in which the variable is resolved is the first CU
+in the module of the probe point which matches the given file name at
+the end and has the shortest file name path (e.g. given
+.IR @var("foo@bar/baz.c")
+and CUs with file name paths
+.IR src/sub/module/bar/baz.c
+and
+.IR src/bar/baz.c
+the second CU will be chosen to resolve the (file) global variable
+.IR foo
+.
+.TP
 $var\->field traversal via a structure's or a pointer's field.  This
 generalized indirection operator may be repeated to follow more
 levels.  Note that the
@@ -417,7 +482,7 @@ is addressable.
 expands to 1 or 0 iff the given context variable expression is resolvable,
 for use in conditionals such as   
 .SAMPLE
-@defined($foo->bar) ? $foo->bar : 0
+@defined($foo\->bar) ? $foo\->bar : 0
 .ESAMPLE
 .TP
 $EXPR$
@@ -572,9 +637,14 @@ probe gets called for every block-stepped instruction of the process described b
 .PP
 If a process probe is specified without a PID or FULLPATH, all user
 threads will be probed.  However, if systemtap was invoked with the
-.IR -c " or " -x
+.IR \-c " or " \-x
 options, then process probes are restricted to the process
-hierarchy associated with the target process.
+hierarchy associated with the target process.  If a process probe is
+specified without a PID or FULLPATH, but with the 
+.IR \-c "
+option, the PATH of the
+.IR \-c "
+cmd will be heuristically filled into the process PATH.
 
 .PP
 Third, symbolic static instrumentation compiled into programs and
@@ -602,10 +672,14 @@ parts of the probe point name.
 Finally, full symbolic source-level probes in user-space programs
 and shared libraries are supported.  These are exactly analogous
 to the symbolic DWARF-based kernel/module probes described above,
-and expose similar contextual $-variables.
+and expose similar contextual $variables.
 .SAMPLE
 process("PATH").function("NAME")
 process("PATH").statement("*@FILE.c:123")
+process("PATH").plt("NAME")
+process("PATH").library("PATH").plt("NAME")
+process("PATH").library("PATH").function("NAME")
+process("PATH").library("PATH").statement("*@FILE.c:123")
 process("PATH").function("*").return
 process("PATH").function("myfun").label("foo")
 .ESAMPLE
@@ -618,8 +692,13 @@ to the working directory if they contain a "/" character, otherwise in
 .BR $PATH .
 If PATH names refer to scripts, the actual interpreters (specified in the
 script in the first line after the #! characters) are probed.
-PATH may also refer to shared libraries, in which case all proceses that
-map it at runtime would be selected for probing.
+If PATH is a process component parameter referring to shared libraries
+then all processes that map it at runtime would be selected for
+probing.  If PATH is a library component parameter referring to shared
+libraries then the process specified by the process component would be
+selected.  A .plt probe will probe functions in the program linkage table
+corresponding to the rest of the probe point.  .plt can be specified
+as a shorthand for .plt("*").
 If the PATH string contains wildcards as in the MPATTERN case, then
 standard globbing is performed to find all matching paths.  In this
 case, the 
@@ -839,6 +918,36 @@ when an input script requests 5 hardware breakpoint probes on an x86
 system while x86 architecture supports a maximum of 4 breakpoints.
 Users are cautioned to set probes judiciously.
 
+.SS PERF
+
+This 
+.IR prototype
+family of probe points interfaces to the kernel "perf event"
+infrasture for controlling hardware performance counters.
+The events being attached to are described by the "type",
+"config" fields of the 
+.IR perf_event_attr
+structure, and are sampled at an interval governed by the
+"sample_period" field.
+
+These fields are made available to systemtap scripts using
+the following syntax:
+.SAMPLE
+probe perf.type(NN).config(MM).sample(XX)
+probe perf.type(NN).config(MM)
+.ESAMPLE
+The systemtap probe handler is called once per XX increments
+of the underlying performance counter.  The default sampling
+count is 1000000.
+The range of valid type/config is described by the 
+.IR perf_event_open (2)
+system call, and/or the 
+.IR linux/perf_event.h
+file.  Invalid combinations or exhausted hardware counter resources
+result in errors during systemtap script startup.  Systemtap does
+not sanity-check the values: it merely passes them through to
+the kernel for error- and safety-checking.
+
 .SH EXAMPLES
 .PP
 Here are some example probe points, defining the associated events.
@@ -854,8 +963,8 @@ refers to a periodic interrupt, every 1000 +/\- 200 jiffies.
 kernel.function("*init*"), kernel.function("*exit*")
 refers to all kernel functions with "init" or "exit" in the name.
 .TP
-kernel.function("*@kernel/sched.c:240")
-refers to any functions within the "kernel/sched.c" file that span
+kernel.function("*@kernel/time.c:240")
+refers to any functions within the "kernel/time.c" file that span
 line 240.  
 .BR
 Note
@@ -877,8 +986,8 @@ kernel.statement(0xc0044852)
 refers to the first byte of the statement whose compiled instructions
 include the given address in the kernel.
 .TP
-kernel.statement("*@kernel/sched.c:2917")
-refers to the statement of line 2917 within "kernel/sched.c".
+kernel.statement("*@kernel/time.c:296")
+refers to the statement of line 296 within "kernel/time.c".
 .TP
 kernel.statement("bio_init@fs/bio.c+3")
 refers to the statement at line bio_init+3 within "fs/bio.c".
@@ -889,33 +998,6 @@ refers to a hardware preakpoint of type "write" set on pid_max
 syscall.*.return
 refers to the group of probe aliases with any name in the third position
 
-.SS PERF
-
-This 
-.IR prototype
-family of probe points interfaces to the kernel "perf event"
-infrasture for controlling hardware performance counters.
-The events being attached to are described by the "type",
-"config" fields of the 
-.IR perf_event_attr
-structure, and are sampled at an interval governed by the
-"sample_period" field.
-
-These fields are made available to systemtap scripts using
-the following syntax:
-.SAMPLE
-probe perf.type(NN).config(MM).sample(XX)
-probe perf.type(NN).config(MM)
-.ESAMPLE
-The range of valid type/config is described by the 
-.IR perf_event_open (2)
-system call, and/or the 
-.IR linux/perf_event.h
-file.  Invalid combinations or exhausted hardware counter resources
-result in errors during systemtap script startup.  Systemtap does
-not sanity-check the values: it merely passes them through to
-the kernel for error- and safety-checking.
-
 .SH SEE ALSO
 .IR stap (1),
 .IR probe::* (3stap),
This page took 0.030096 seconds and 5 git commands to generate.