1 * What's new in version 0.7
3 - The vector of script command line arguments is available in a
4 tapset-provided global array argv[]. It is indexed 1 ... argc,
5 another global. This can substitute for of preprocessor
6 directives @NNN that fail at parse time if there are not
9 printf("argv: %s %s %s", argv[1], argv[2], argv[3])
11 - .statement("func@file+line") probes are now supported to allow a
12 match relative to the entry of the function incremented by line
13 number. This allows using the same systemtap script if the rest
14 of the file.c source only changes slightly.
16 - Stack backtraces for x86 and x86-64 are generated by a dwarf
17 debuginfo-based unwinder based on the code from <jbeulich@novell.com>.
18 This should give more accurate backtraces.
20 - A probe listing mode is available.
29 - More user-space probe types are added:
31 probe process(PID).begin { }
32 probe process("PATH").begin { }
33 probe process(PID).thread.begin { }
34 probe process("PATH").thread.begin { }
35 probe process(PID).end { }
36 probe process("PATH").end { }
37 probe process(PID).thread.end { }
38 probe process("PATH").thread.end { }
39 probe process(PID).syscall { }
40 probe process("PATH").syscall { }
41 probe process(PID).syscall.return { }
42 probe process("PATH").syscall.return { }
44 - Globals now accept ; terminators
47 global little[10], big[5];
49 * What's new in version 0.6
51 - A copy of the systemtap tutorial and language reference guide
54 - There is a new format specifier, %m, for the printf family of
55 functions. It functions like %s, except that it does not stop when
56 a nul ('\0') byte is encountered. The number of bytes output is
57 determined by the precision specifier. The default precision is 1.
60 printf ("%m", "My String") // prints one character: M
61 printf ("%.5", myString) // prints 5 bytes beginning at the start
64 - The %b format specifier for the printf family of functions has been enhanced
67 1) When the width and precision are both unspecified, the default is %8.8b.
68 2) When only one of the width or precision is specified, the other defaults
69 to the same value. For example, %4b == %.4b == %4.4b
70 3) Nul ('\0') bytes are used for field width padding. For example,
72 printf ("%b", 0x1111deadbeef2222) // prints all eight bytes
73 printf ("%4.2b", 0xdeadbeef) // prints \0\0\xbe\xef
75 - Dynamic width and precision are now supported for all printf family format
76 specifiers. For example:
80 printf ("%*.*b", four, two, 0xdeadbbeef) // prints \0\0\xbe\xef
81 printf ("%*d", four, two) // prints <space><space><space>2
83 - Preprocessor conditional expressions can now include wildcard style
84 matches on kernel versions.
85 %( kernel_vr != "*xen" %? foo %: bar %)
87 - Prototype support for user-space probing is showing some progress.
88 No symbolic notations are supported yet (so no probing by function names,
89 file names, process names, and no access to $context variables), but at
92 probe process(PID).statement(ADDRESS).absolute { }
94 This will set a uprobe on the given process-id and given virtual address.
95 The proble handler runs in kernel-space as usual, and can generally use
96 existing tapset functions.
98 - Crash utility can retrieve systemtap's relay buffer from a kernel dump
99 image by using staplog which is a crash extension module. To use this
100 feature, type commands as below from crash(8)'s command line:
102 crash> extend staplog.so
103 crash> help systemtaplog
105 Then, you can see more precise help message.
107 - You can share a relay buffer amoung several scripts and merge outputs from
108 several scripts by using "-DRELAY_HOST" and "-DRELAY_GUEST" options.
112 % stap -ve 'probe begin{}' -o merged.out -DRELAY_HOST &
113 # wait until starting the host.
114 % stap -ve 'probe begin{print("hello ");exit()}' -DRELAY_GUEST
115 % stap -ve 'probe begin{print("world\n");exit()}' -DRELAY_GUEST
117 Then, you'll see "hello world" in merged.out.
119 - You can add a conditional statement for each probe point or aliase, which
120 is evaluated when the probe point is hit. If the condition is false, the
121 whole probe body(including aliases) is skipped. For example:
124 probe syscall.* if (switch) { ... }
125 probe procfs.write {switch = strtol($value,10)} /* enable/disable ctrl */
127 - Systemtap will warn you if your script contains unused variables or
128 functions. This is helpful in case of misspelled variables. If it
129 doth protest too much, turn it off with "stap -w ...".
131 - You can add error-handling probes to a script, which are run if a
132 script was stopped due to errors. In such a case, "end" probes are
133 not run, but "error" ones are.
135 probe error { println ("oops, errors encountered; here's a report anyway")
136 foreach (coin in mint) { println (coin) } }
138 - In a related twist, one may list probe points in order of preference,
139 and mark any of them as "sufficient" beyond just "optional". Probe
140 point sequence expansion stops if a sufficient-marked probe point has a hit.
141 This is useful for probes on functions that may be in a module (CONFIG_FOO=m)
142 or may have been compiled into the kernel (CONFIG_FOO=y), but we don't know
145 probe module("sd").function("sd_init_command") ? ,
146 kernel.function("sd_init_command") ? { ... }
148 which might match neither, now one can write this:
150 probe module("sd").function("sd_init_command") ! , /* <-- note excl. mark */
151 kernel.function("sd_init_command") { ... }
153 - New security model. To install a systemtap kernel module, a user
154 must be one of the following: the root user; a member of the
155 'stapdev' group; or a member of the 'stapusr' group. Members of the
156 stapusr group can only use modules located in the
157 /lib/modules/VERSION/systemtap directory (where VERSION is the
158 output of "uname -r").
160 - .statement("...@file:line") probes now apply heuristics to allow an
161 approximate match for the line number. This works similarly to gdb,
162 where a breakpoint placed on an empty source line is automatically
163 moved to the next statement. A silly bug that made many $target
164 variables inaccessible to .statement() probes was also fixed.
166 - LKET has been retired. Please let us know on <systemtap@sourceware.org>
167 if you have been a user of the tapset/tools, so we can help you find
170 - New families of printing functions println() and printd() have been added.
171 println() is like print() but adds a newline at the end;
172 printd() is like a sequence of print()s, with a specified field delimiter.
174 * What's new since version 0.5.14?
176 - The way in which command line arguments for scripts are substituted has
177 changed. Previously, $1 etc. would interpret the corresponding command
178 line argument as an numeric literal, and @1 as a string literal. Now,
179 the command line arguments are pasted uninterpreted wherever $1 etc.
180 appears at the beginning of a token. @1 is similar, but is quoted as
181 a string. This change does not modify old scripts, but has the effect
182 of permitting substitution of arbitrary token sequences.
184 # This worked before, and still does:
185 % stap -e 'probe timer.s($1) {}' 5
186 # Now this also works:
187 % stap -e 'probe syscall.$1 {log(@1)}' open
188 # This won't crash, just signal a recursion error:
190 # As before, $1... is recognized only at the beginning of a token
191 % stap -e 'probe begin {foo$1=5}'
193 * What's new since version 0.5.13?
195 - The way in which systemtap resolves function/inline probes has changed:
196 .function(...) - now refers to all functions, inlined or not
197 .inline(...) - is deprecated, use instead:
198 .function(...).inline - filters function() to only inlined instances
199 .function(...).call - filters function() to only non-inlined instances
200 .function(...).return - as before, but now pairs best with .function().call
201 .statement() is unchanged.
203 * What's new since version 0.5.12?
205 - When running in -p4 (compile-only) mode, the compiled .ko file name
206 is printed on standard output.
208 - An array element with a null value such as zero or an empty string
209 is now preserved, and will show up in a "foreach" loop or "in" test.
210 To delete such an element, the scripts needs to use an explicit
211 "delete array[idx]" statement rather than something like "array[idx]=0".
213 - The new "-P" option controls whether prologue searching heuristics
214 will be activated for function probes. This was needed to get correct
215 debugging information (dwarf location list) data for $target variables.
216 Modern compilers (gcc 4.1+) tend not to need this heuristic, so it is
217 no longer default. A new configure flag (--enable-prologues) restores
218 it as a default setting, and is appropriate for older compilers (gcc 3.*).
220 - Each systemtap module prints a one-line message to the kernel informational
221 log when it starts. This line identifies the translator version, base
222 address of the probe module, a broken-down memory consumption estimate, and
223 the total number of probes. This is meant as a debugging / auditing aid.
225 - Begin/end probes are run with interrupts enabled (but with
226 preemption disabled). This will allow begin/end probes to be
227 longer, to support generating longer reports.
229 - The numeric forms of kernel.statement() and kernel.function() probe points
230 are now interpreted as relocatable values - treated as relative to the
231 _stext symbol in that kernel binary. Since some modern kernel images
232 are relocated to a different virtual address at startup, such addresses
233 may shift up or down when actually inserted into a running kernel.
235 kernel.statement(0xdeadbeef): validated, interpreted relative to _stext,
236 may map to 0xceadbeef at run time.
238 In order to specify unrelocated addresses, use the new ".absolute"
239 probe point suffix for such numeric addresses. These are only
240 allowed in guru mode, and provide access to no $target variables.
241 They don't use debugging information at all, actually.
243 kernel.statement(0xfeedface).absolute: raw, unvalidated, guru mode only
245 * What's new since version 0.5.10?
247 - Offline processing of debugging information, enabling general
248 cross-compilation of probe scripts to remote hosts, without
249 requiring identical module/memory layout. This slows down
250 compilation/translation somewhat.
252 - Kernel symbol table data is loaded by staprun at startup time
253 rather than compiled into the module.
255 - Support the "limit" keyword for foreach iterations:
256 foreach ([x,y] in ary limit 5) { ... }
257 This implicitly exits after the fifth iteration. It also enables
258 more efficient key/value sorting.
260 - Support the "maxactive" keyword for return probes:
261 probe kernel.function("sdfsdf").maxactive(848) { ... }
262 This allows up to 848 concurrently outstanding entries to
263 the sdfsdf function before one returns. The default maxactive
264 number is smaller, and can result in missed return probes.
266 - Support accessing of saved function arguments from within
267 return probes. These values are saved by a synthesized
268 function-entry probe.
270 - Add substantial version/architecture checking in compiled probes to
271 assert correct installation of debugging information and correct
272 execution on a compatible kernel.
274 - Add probe-time checking for sufficient free stack space when probe
275 handlers are invoked, as a safety improvement.
277 - Add an optional numeric parameter for begin/end probe specifications,
278 to order their execution.
279 probe begin(10) { } /* comes after */ probe begin(-10) {}
281 - Add an optional array size declaration, which is handy for very small
283 global little[5], big[20000]
285 - Include some example scripts along with the documentation.
287 - Change the start-time allocation of probe memory to avoid causing OOM
288 situations, and to abort cleanly if free kernel memory is short.
290 - Automatically use the kernel DWARF unwinder, if present, for stack
293 - Many minor bug fixes, performance, tapset, and error message