]>
Commit | Line | Data |
---|---|---|
94d406fc SC |
1 | * What's new in version 1.7 |
2 | ||
4d0fcb93 SC |
3 | - process("...").library("...").plt("...") probes are now supported. Wildcards |
4 | are supported in the plt-name part, to refer to any function in the program | |
5 | linkage table which matches the glob pattern and the rest of the probe point. | |
6 | ||
b82d77b4 DB |
7 | - A new option, --dump-probe-types, will dump a list of supported probe types. |
8 | If --unprivileged is also specified, the list will be limited to probe types | |
9 | which are available to unprivileged users. | |
10 | ||
d70b339b CM |
11 | - Systemtap can now automatically download the required debuginfo |
12 | using abrt. The --download-debuginfo[=OPTION] can be used to | |
13 | control this feature. Possible values are: 'yes', 'no', 'ask', | |
14 | and a positive number representing the timeout desired. The | |
15 | default behavior is to not automatically download the debuginfo. | |
16 | ||
70e85f76 FCE |
17 | - On 2.6.29+ kernels, systemtap can now probe kernel modules that |
18 | arrive and/or depart during the run-time of a session. This allows | |
19 | probing of device driver initialization functions, which had been | |
20 | blacklisted. | |
21 | ||
440d9b00 DB |
22 | - The following probe types are deprecated in release 1.7 and will be removed in release 1.8: |
23 | kernel.function(number).inline | |
24 | module(string).function(number).inline | |
25 | process.function(number).inline | |
26 | process.library(string).function(number).inline | |
27 | process(string).function(number).inline | |
28 | process(string).library(string).function(number).inline | |
29 | ||
a7ebbe13 | 30 | * What's new in version 1.6, 2011-07-25 |
358771db | 31 | |
304d73b1 FCE |
32 | - Security fixes for CVE-2011-2503: read instead of mmap to load modules, |
33 | CVE-2011-2502: Don't allow path-based auth for uprobes | |
34 | ||
5b314cd0 DB |
35 | - The systemtap compile-server no longer uses the -k option when calling the |
36 | translator (stap). As a result, the server will now take advantage of the | |
37 | module cache when compiling the same script more than once. You may observe | |
38 | an improvement in the performance of the server in this situation. | |
39 | ||
40 | - The systemtap compile-server and client now each check the version of the | |
41 | other, allowing both to adapt when communicating with a down-level | |
42 | counterpart. As a result, all version of the client can communicate | |
43 | with all versions of the server and vice-versa. Client will prefer newer | |
44 | servers when selecting a server automatically. | |
45 | ||
fb12b1e0 WC |
46 | - SystemTap has improved support for the ARM architecture. The |
47 | kread() and kwrite() operations for ARM were corrected allowing many | |
48 | of the tapsets probes and function to work properly on the ARM | |
49 | architecture. | |
50 | ||
0497872a CM |
51 | - Staprun can now rename the module to a unique name with the '-R' option before |
52 | inserting it. Systemtap itself will also call staprun with '-R' by default. | |
53 | This allows the same module to be inserted more than once, without conflicting | |
54 | duplicate names. | |
55 | ||
abc330b6 LB |
56 | - Systemtap error messages now provide feedback when staprun or any other |
57 | process fails to launch. This also specifically covers when the user | |
58 | doesn't have the proper permissions to launch staprun. | |
59 | ||
c523a015 LB |
60 | - Systemtap will now map - to _ in module names. Previously, |
61 | stap -L 'module("i2c-core").function("*")' would be empty. It now returns | |
62 | a list had stap -L 'module("i2c_core").function("*") been specified. | |
63 | ||
ee3fbc52 FCE |
64 | - Systemtap now fills in missing process names to probe points, to |
65 | avoid having to name them twice twice: | |
66 | % stap -e 'probe process("a.out").function("*") {}' -c 'a.out ...' | |
67 | Now the probed process name is inferred from the -c CMD argument. | |
68 | % stap -e 'probe process.function("*") {}' -c 'a.out ...' | |
6d5d594e | 69 | |
5a195cd5 LB |
70 | - stap -L 'process("PATH").syscall' will now list context variables |
71 | ||
e050d62f MW |
72 | - Depends on elfutils 0.142+. |
73 | ||
20ab10df MW |
74 | - Deprecated task_backtrace:string (task:long). This function will go |
75 | away after 1.6. Please run your scripts with stap --check-version. | |
76 | ||
a64d8b13 | 77 | * What's new in version 1.5, 2011-05-23 |
5dbcdbd6 | 78 | |
304d73b1 FCE |
79 | - Security fixes for CVE-2011-1781, CVE-2011-1769: correct DW_OP_{mod,div} |
80 | division-by-zero bug | |
81 | ||
5dbcdbd6 DB |
82 | - The compile server and its related tools (stap-gen-ert, stap-authorize-cert, |
83 | stap-sign-module) have been re-implemented in C++. Previously, these | |
84 | components were a mix of bash scripts and C code. These changes should be | |
85 | transparent to the end user with the exception of NSS certificate database | |
86 | password prompting (see below). The old implementation would prompt more | |
87 | than once for the same password in some situations. | |
88 | ||
eb521ae6 LB |
89 | - eventcount.stp now allows for event counting in the format of |
90 | 'stap eventcount.stp process.end syscall.* ...', and also reports | |
91 | corresponding event tid's. | |
6e0c15da | 92 | |
d1d13a8b SC |
93 | - Systemtap checks that the build-id of the module being probed matches the |
94 | build-id saved in the systemtap module. Invoking systemtap with | |
95 | -DSTP_NO_BUILDID_CHECK will bypass this build-id runtime verification. See | |
96 | man ld(1) for info on --build-id. | |
97 | ||
276c6712 LB |
98 | - stapio will now report if a child process has an abnormal exit along with |
99 | the associated status or signal. | |
100 | ||
710a2a45 SC |
101 | - Compiler optimization may sometimes result in systemtap not being able to |
102 | access a user-space probe argument. Compiling the application with | |
103 | -DSTAP_SDT_ARG_CONSTRAINT=nr will force the argument to be an immediate or | |
104 | register value which should enable systemtap to access the argument. | |
105 | ||
2a990836 LB |
106 | - GNU Gettext has now been intergrated with systemtap. Our translation |
107 | page can be found at http://www.transifex.net/projects/p/systemtap/ . | |
108 | "make update-po" will generate the necessary files to use translated | |
109 | messages. Please refer to the po/README file for more info and | |
110 | please consider contributing to this I18N effort! | |
111 | ||
bf8e91d0 JS |
112 | - The new addr() function returns the probe's instruction pointer. |
113 | ||
b73a1293 SC |
114 | - process("...").library("...") probes are now supported. Wildcards |
115 | are supported in the library-name part, to refer to any shared | |
116 | library that is required by process-name, which matches the glob | |
117 | pattern and the rest of the probe point. | |
118 | ||
b9d64db6 JS |
119 | - The "--remote USER@HOST" functionality can now be specified multiple times |
120 | to fan out on multiple targets. If the targets have distinct kernel and | |
121 | architecture configurations, stap will automatically build the script | |
122 | appropriately for each one. This option is also no longer considered | |
123 | experimental. | |
124 | ||
e96e9380 DB |
125 | - The NSS certificate database generated for use by the compile server is now |
126 | generated with no password. Previously, a random password was generated and | |
127 | used to access the database. This change should be transparent to most users. | |
128 | However, if you are prompted for a password when using systemtap, then | |
129 | running $libexecdir/stap-gen-cert should correct the problem. | |
130 | ||
798cba32 FCE |
131 | - The timestamp tapset includes jiffies() and HZ() for lightweight approximate |
132 | timekeeping. | |
133 | ||
4ce43c59 FCE |
134 | - A powerful new command line option --version has been added. |
135 | ||
c2807b0b SC |
136 | - process.mark now supports $$parms for reading probe parameters. |
137 | ||
cc28ec4f FCE |
138 | - A new command line option, --use-server-on-error[=yes|no] is available |
139 | for stap. It instructs stap to retry compilation of a script using a | |
140 | compile server if it fails on the local host. The default setting | |
141 | is 'no'. | |
ce286ff0 | 142 | |
1114c4f2 DB |
143 | - The following deprecated tools have been removed: |
144 | stap-client | |
145 | stap-authorize-server-cert | |
146 | stap-authorize-signing-cert | |
147 | stap-find-or-start-server | |
148 | stap-find-servers | |
149 | Use the --use-server, --trust-server and --list-servers options of stap | |
cc28ec4f | 150 | instead. |
6e0c15da | 151 | |
c36cb86a | 152 | * What's new in version 1.4, 2011-01-17 |
051bc1a0 | 153 | |
304d73b1 FCE |
154 | - Security fixes for CVE-2010-4170, CVE-2010-4171: staprun module |
155 | loading/unloading | |
156 | ||
02f44009 DB |
157 | - A new /* myproc-unprivileged */ marker is now available for embedded C |
158 | code and and expressions. Like the /* unprivileged */ marker, it makes | |
159 | the code or expression available for use in unprivileged mode (see | |
160 | --unprivileged). However, it also automatically adds a call to | |
161 | assert_is_myproc() to the code or expression, thus, making it available | |
162 | to the unprivileged user only if the target of the current probe is within | |
163 | the user's own process. | |
164 | ||
e37d61db FCE |
165 | - The experimental "--remote USER@HOST" option will run pass 5 on a given |
166 | ssh host, after building locally (or with --use-server) for that target. | |
6eb5c1a1 | 167 | |
8358a79c FCE |
168 | - Warning messages from the script may now be suppressed with the stap |
169 | and/or staprun -w option. By default, duplicate warning messages are | |
170 | suppressed (up to a certain limit). With stap --vp 00002 and above, | |
171 | the duplicate elimination is defeated. | |
172 | ||
35f71b69 FCE |
173 | - The print_ubacktrace and usym* functions attempt to print the full |
174 | path of the user-space binaries' paths, instead of just the basename. | |
175 | The maximum saved path length is set by -DTASK_FINDER_VMA_ENTRY_PATHLEN, | |
121d2e8f FCE |
176 | default 64. Warning messages are produced if unwinding fails due to |
177 | a missing 'stap -d MODULE' option, providing preloaded unwind data. | |
35f71b69 | 178 | |
d62c7736 FCE |
179 | - The new tz_ctime() tapset function prints times in the local time zone. |
180 | ||
685087ea FCE |
181 | - More kernel tracepoints are accessible to the kernel.trace("...") mechanism, |
182 | if kernel source trees or debuginfo are available. These formerly "hidden" | |
183 | tracepoints are those that are declared somewhere other than the usual | |
184 | include/linux/trace/ headers, such as xfs and kvm. | |
185 | ||
c480f651 FCE |
186 | - debuginfo-based process("...").function/.statement/.mark probes support |
187 | wildcards in the process-name part, to refer to any executable files that | |
188 | match the glob pattern and the rest of the probe point. | |
c3c5e2eb | 189 | |
a1e3433a LB |
190 | - The -t option now displays information per probe-point rather than a summary |
191 | for each probe. It also now shows the derivation chain for each probe-point. | |
d1eef011 | 192 | |
6a46f4fb FCE |
193 | - A rewrite of the sys/sdt.h header file provides zero-cost startup (few or |
194 | no ELF relocations) for the debuginfo-less near-zero-cost runtime probes. | |
195 | Binaries compiled with earlier sdt.h versions remain supported. The | |
196 | stap -L (listing) option now lists parameters for sys/sdt.h markers. | |
197 | ||
0dd4c6e7 DB |
198 | - The implementation of the integrated compile-server client has been |
199 | extended. | |
0dd4c6e7 DB |
200 | o --use-server now accepts an argument representing a particular server and |
201 | may be specified more than once. | |
202 | o --list-servers now accepts an expanded range of arguments. | |
c3c5e2eb FCE |
203 | o a new --trust-servers option has been added to stap to replace several |
204 | old certificate-management scripts. | |
219868f8 DB |
205 | o The following tools are now deprecated and will be removed in release 1.5: |
206 | stap-client | |
207 | stap-authorize-server-cert | |
208 | stap-authorize-signing-cert | |
209 | stap-find-or-start-server | |
210 | stap-find-servers | |
211 | See man stap(1) for complete details. | |
212 | ||
213 | - The compile-server now returns the uprobes.ko to the client when it is | |
214 | required by the script being compiled. The integrated compile-server client | |
215 | now makes it available to be loaded by staprun. The old (deprecated) | |
216 | stap-client does not do this. | |
0dd4c6e7 | 217 | |
d1bcbe71 RH |
218 | - process probes with scripts as the target are recognized by stap and the |
219 | interpreter would be selected for probing. | |
220 | ||
8dc503b6 FCE |
221 | - Starting in release 1.5, these old variables/functions will be deprecated |
222 | and will only be available when the '--compatible=1.4' flag is used: | |
223 | ||
d1eef011 DS |
224 | - In the 'syscall.add_key' probe, the 'description_auddr' variable |
225 | has been deprecated in favor of the new 'description_uaddr' | |
226 | variable. | |
227 | - In the 'syscall.fgetxattr', 'syscall.fsetxattr', | |
228 | 'syscall.getxattr', 'syscall.lgetxattr', and | |
229 | 'syscall.lremovexattr' probes, the 'name2' variable has been | |
230 | deprecated in favor of the new 'name_str' variable. | |
89e2abb1 DS |
231 | - In the 'nd_syscall.accept' probe the 'flag_str' variable |
232 | has been deprecated in favor of the new 'flags_str' variable. | |
233 | - In the 'nd_syscall.dup' probe the 'old_fd' variable has been | |
234 | deprecated in favor of the new 'oldfd' variable. | |
235 | - In the 'nd_syscall.fgetxattr', 'nd_syscall.fremovexattr', | |
236 | 'nd_syscall.fsetxattr', 'nd_syscall.getxattr', and | |
237 | 'nd_syscall.lremovexattr' probes, the 'name2' variable has been | |
238 | deprecated in favor of the new 'name_str' variable. | |
8dc503b6 FCE |
239 | - The tapset alias 'nd_syscall.compat_pselect7a' was misnamed. It should |
240 | have been 'nd_syscall.compat_pselect7' (without the trailing 'a'). | |
241 | - The tapset function 'cpuid' is deprecated in favor of the better known | |
242 | 'cpu'. | |
b149489c DS |
243 | - In the i386 'syscall.sigaltstack' probe, the 'ussp' variable has |
244 | been deprecated in favor of the new 'uss_uaddr' variable. | |
245 | - In the ia64 'syscall.sigaltstack' probe, the 'ss_uaddr' and | |
246 | 'oss_uaddr' variables have been deprecated in favor of the new | |
247 | 'uss_uaddr' and 'uoss_uaddr' variables. | |
248 | - The powerpc tapset alias 'syscall.compat_sysctl' was deprecated | |
249 | and renamed 'syscall.sysctl32'. | |
250 | - In the x86_64 'syscall.sigaltstack' probe, the 'regs_uaddr' | |
251 | variable has been deprecated in favor of the new 'regs' variable. | |
89e2abb1 | 252 | |
4432f146 | 253 | * What's new in version 1.3, 2010-07-21 |
649260f3 | 254 | |
c9b524b2 JS |
255 | - The uprobes kernel module now has about half the overhead when probing |
256 | NOPs, which is particularly relevant for sdt.h markers. | |
257 | ||
866b7fea FCE |
258 | - New stap option -G VAR=VALUE allows overriding global variables |
259 | by passing the settings to staprun as module options. | |
bb25d08f | 260 | |
b352f4b0 DS |
261 | - The tapset alias 'syscall.compat_pselect7a' was misnamed. It should |
262 | have been 'syscall.compat_pselect7' (without the trailing 'a'). | |
70032df1 DS |
263 | Starting in release 1.4, the old name will be deprecated and |
264 | will only be available when the '--compatible=1.3' flag is used. | |
b352f4b0 | 265 | |
279aece5 FCE |
266 | - A new procfs parameter .umask(UMASK) which provides modification of |
267 | file permissions using the proper umask value. Default file | |
268 | permissions for a read probe are 0400, 0200 for a write probe, and | |
269 | 0600 for a file with a read and write probe. | |
270 | ||
49db4869 MW |
271 | - It is now possible in some situations to use print_ubacktrace() to |
272 | get a user space stack trace from a kernel probe point. e.g. for | |
273 | user backtraces when there is a pagefault: | |
274 | $ stap -d /bin/sort --ldd -e 'probe vm.pagefault { | |
275 | if (pid() == target()) { | |
276 | printf("pagefault @0x%x\n", address); print_ubacktrace(); | |
277 | } }' -c /bin/sort | |
278 | [...] | |
279 | pagefault @0x7fea0595fa70 | |
280 | 0x000000384f07f958 : __GI_strcmp+0x12b8/0x1440 [libc-2.12.so] | |
281 | 0x000000384f02824e : __gconv_lookup_cache+0xee/0x5a0 [libc-2.12.so] | |
282 | 0x000000384f021092 : __gconv_find_transform+0x92/0x2cf [libc-2.12.so] | |
283 | 0x000000384f094896 : __wcsmbs_load_conv+0x106/0x2b0 [libc-2.12.so] | |
284 | 0x000000384f08bd90 : mbrtowc+0x1b0/0x1c0 [libc-2.12.so] | |
285 | 0x0000000000404199 : ismbblank+0x39/0x90 [sort] | |
286 | 0x0000000000404a4f : inittables_mb+0xef/0x290 [sort] | |
287 | 0x0000000000406934 : main+0x174/0x2510 [sort] | |
288 | 0x000000384f01ec5d : __libc_start_main+0xfd/0x1d0 [libc-2.12.so] | |
289 | 0x0000000000402509 : _start+0x29/0x2c [sort] | |
290 | [...] | |
291 | ||
292 | - New tapset functions to get a string representation of a stack trace: | |
293 | sprint_[u]backtrace() and sprint_[u]stack(). | |
294 | ||
295 | - New tapset function to get the module (shared library) name for a | |
296 | user space address umodname:string(long). The module name will now | |
297 | also be in the output of usymdata() and in backtrace addresses even | |
298 | when they were not given with -d at the command line. | |
299 | ||
300 | - Kernel backtraces are now much faster (replaced a linear search | |
301 | with a binary search). | |
302 | ||
eb3a0eee | 303 | - A new integrated compile-server client is now available as part of stap. |
1e7630bf | 304 | |
eb3a0eee DB |
305 | o 'stap --use-server ...' is equivalent to 'stap-client ...' |
306 | o 'stap --list-servers' is equivalent to 'stap-find-servers' | |
307 | o 'stap --list-servers=online' is equivalent to 'stap-find-servers --all' | |
1e7630bf DB |
308 | o stap-client and its related tools will soon be deprecated. |
309 | o the nss-devel and avahi-devel packages are required for building stap with | |
310 | the integrated client (checked during configuration). | |
311 | o nss and avahi are required to run the integrated client. | |
312 | ||
8cc799a5 JS |
313 | - A new operator @entry is available for automatically saving an expression |
314 | at entry time for use in a .return probe. | |
315 | probe foo.return { println(get_cycles() - @entry(get_cycles())) } | |
316 | ||
34af38db JS |
317 | - Probe $target variables and @cast() can now use a suffix to print complex |
318 | data types as strings. Use a single '$' for a shallow view, or '$$' for a | |
319 | deeper view that includes nested types. For example, with fs_struct: | |
320 | $fs$ : "{.users=%i, .lock={...}, .umask=%i, | |
321 | .in_exec=%i, .root={...}, .pwd={...}}" | |
322 | $fs$$ : "{.users=%i, .lock={.raw_lock={.lock=%u}}, .umask=%i, .in_exec=%i, | |
323 | .root={.mnt=%p, .dentry=%p}, .pwd={.mnt=%p, .dentry=%p}}" | |
324 | ||
a794dbeb FCE |
325 | - The <sys/sdt.h> user-space markers no longer default to an implicit |
326 | MARKER_NAME_ENABLED() semaphore check for each marker. To check for | |
327 | enabled markers use a .d declaration file, then: | |
328 | if (MARKER_NAME_ENABLED()) MARKER_NAME() | |
954b1d89 | 329 | |
ef428667 FCE |
330 | - Hyphenated <sys/sdt.h> marker names such as process(...).mark("foo-bar") |
331 | are now accepted in scripts. They are mapped to the double-underscore | |
332 | form ("foo__bar"). | |
333 | ||
279aece5 FCE |
334 | - More robust <sys/sdt.h> user-space markers support is included. For |
335 | some platforms (x86*, ppc*), this can let systemtap probe the markers | |
336 | without debuginfo. This implementation also supports preserving | |
a794dbeb FCE |
337 | the "provider" name associated with a marker: |
338 | probe process("foo").provider("bar").mark("baz") to match | |
339 | STAP_PROBE<n>(bar, baz <...>) | |
279aece5 FCE |
340 | (Compile with -DSTAP_SDT_V1 to revert to the previous implementation. |
341 | Systemtap supports pre-existing or new binaries using them.) | |
f83336a5 | 342 | |
7d902887 FCE |
343 | - Embedded-C may be used within expressions as values, when in guru mode: |
344 | num = %{ LINUX_VERSION_CODE %} // int64_t | |
345 | name = %{ /* string */ THIS_MODULE->name %} // const char* | |
346 | printf ("%s %x\n", name, num) | |
347 | The usual /* pure */, /* unprivileged */, and /* guru */ markers may be used | |
348 | as with embedded-C functions. | |
349 | ||
38105915 | 350 | - By default the systemtap-runtime RPM builds now include a shared |
114fbea7 | 351 | library, staplog.so, that allows crash to extract systemtap data from |
38105915 WC |
352 | a vmcore image. |
353 | ||
9747ca47 JS |
354 | - Iterating with "foreach" can now explicitly save the value for the loop. |
355 | foreach(v = [i,j] in array) | |
356 | printf("array[%d,%s] = %d\n", i, j, v /* array[i,j] */) | |
357 | ||
ef06c938 FCE |
358 | - The new "--ldd" option automatically adds any additional shared |
359 | libraries needed by probed or -d-listed userspace binaries to the -d | |
e19ae9a8 FCE |
360 | list, to enable symbolic backtracing through them. Similarly, the |
361 | new "--all-modules" option automatically adds any currently loaded | |
362 | kernel modules (listed in /proc/modules) to the -d list. | |
ef06c938 | 363 | |
b2c904c0 JS |
364 | - A new family of set_kernel_* functions make it easier for gurus to write |
365 | new values at arbitrary memory addresses. | |
366 | ||
649260f3 JS |
367 | - Probe wildcards can now use '**' to cross the '.' separator. |
368 | $ stap -l 'sys**open' | |
369 | syscall.mq_open | |
370 | syscall.open | |
371 | ||
13c4a0b0 FCE |
372 | - Backward compatibility flags (--compatible=VERSION, and matching |
373 | script preprocessing predicate %( systemtap_v CMP "version" %) | |
374 | and a deprecation policy are being introduced, in case future | |
375 | tapset/language changes break valid scripts. | |
376 | ||
4432f146 | 377 | * What's new in version 1.2, 2010-03-22 |
489e3d51 | 378 | |
f33e9151 FCE |
379 | - Prototype support for "perf events", where the kernel supports the |
380 | 2.6.33 in-kernel API. Probe points may refer to low-level | |
381 | perf_event_attr type/config numbers, or to a number of aliases | |
382 | defined in the new perf.stp tapset: | |
383 | probe perf.sw.cpu_clock, perf.type(0).config(4) { } | |
384 | ||
da9e11bd JS |
385 | - Type-casting can now use multiple headers to resolve codependencies. |
386 | @cast(task, "task_struct", | |
387 | "kernel<linux/sched.h><linux/fs_struct.h>")->fs->umask | |
388 | ||
9039b639 FCE |
389 | - Tapset-related man pages have been renamed. 'man -k 3stap' should show |
390 | the installed list, which due to prefixing should no longer collide over | |
391 | ordinary system functions. | |
392 | ||
985adad3 | 393 | - User space marker arguments no longer use volatile if the version of gcc, |
03a74626 | 394 | which must be at least 4.5.0, supports richer DWARF debuginfo. Use cflags |
87d85b96 FCE |
395 | -DSTAP_SDT_VOLATILE=volatile or -DSTAP_SDT_VOLATILE= when building |
396 | the sys/sdt.h application to override this one way or another. | |
103c7c8d | 397 | |
f4fe2e93 FCE |
398 | - A new construct for error handling is available. It is similar to c++ |
399 | exception catching, using try and catch as new keywords. Within a handler | |
400 | or function, the following is valid and may be nested: | |
401 | try { /* arbitrary statements */ } | |
402 | catch (er) { /* e.g. println("caught error ", er) */ } | |
403 | ||
57a56e00 FCE |
404 | - A new command line flag '-W' forces systemtap to abort translation of |
405 | a script if any warnings are produced. It is similar to gcc's -Werror. | |
406 | (If '-w' is also supplied to suppress warnings, it wins.) | |
407 | ||
30263a73 FCE |
408 | - A new predicate @defined is available for testing whether a |
409 | particular $variable/expression is resolvable at translate time: | |
410 | probe foo { if (@defined($bar)) log ("$bar is available here") } | |
411 | ||
489e3d51 FCE |
412 | - Adjacent string literals are glued together, making this |
413 | construct valid: | |
414 | probe process("/usr" @1 "/bin").function("*") { ... } | |
415 | ||
15b2e969 FCE |
416 | - In order to limit potential impact from future security problems, |
417 | the stap-server process does not permit its being launched as root. | |
418 | ||
489e3d51 FCE |
419 | - On recent kernels, for some architectures/configurations, hardware |
420 | breakpoint probes are supported. The probe point syntax is: | |
421 | ||
422 | probe kernel.data(ADDRESS).write | |
423 | probe kernel.data(ADDRESS).length(LEN).write | |
424 | probe kernel.data("SYMBOL_NAME").write | |
dd225250 | 425 | |
4432f146 | 426 | * What's new in version 1.1, 2010-01-15 |
450718c9 | 427 | |
d5d6f6f1 RD |
428 | - New tracepoint based tapset for memory subsystem. |
429 | ||
bcdf36b1 FCE |
430 | - The loading of signed modules by staprun is no longer allowed for |
431 | ordinary, unprivileged users. This means that only root, members of | |
de23650e | 432 | the group 'stapdev' and members of the group 'stapusr' can load |
bcdf36b1 FCE |
433 | systemtap modules using staprun, stap or stap-client. The minimum |
434 | privilege required to run arbitrary --unprivileged scripts is now | |
de23650e | 435 | 'stapusr' membership. |
bcdf36b1 FCE |
436 | |
437 | - The stap-server initscript is available. This initscript allows you | |
438 | to start systemtap compile servers as a system service and to manage | |
439 | these servers as a group or individually. The stap-server initscript | |
440 | is installed by the systemtap-server rpm. The build directory for | |
441 | the uprobes module (/usr/share/systemtap/runtime/uprobes) is made | |
442 | writable by the 'stap-server' group. All of the files generated when | |
443 | building the uprobes module, including the digital signature, are | |
444 | also writable by members of stap-server. | |
d2c9f522 | 445 | |
5807ac64 DB |
446 | See initscript/README.stap-server for details. |
447 | ||
b515db67 WH |
448 | - Some of the compile server client, server and certificate management |
449 | tools have been moved from $bindir to $libexecdir/systemtap. | |
0f4e0b6f DB |
450 | You should use the new stap-server script or the stap-server initscript |
451 | for server management where possible. The stap-server script provides the same | |
452 | functionality as the stap-server initscript except that the servers are | |
453 | run by the invoking user by default as opposed to servers started by the | |
454 | stap-server initscript which are run by the user stap-server | |
455 | by default. See stap-server(8) for more information. | |
456 | ||
457 | You may continue to use these tools by adding $libexecdir/systemtap to | |
458 | your path. You would need to do this, for example, if you are not root, | |
459 | you want to start a compile server and you are not running systemtap from a | |
460 | private installation. In this case you still need to use stap-start-server. | |
461 | ||
0710d850 DS |
462 | - Any diagnostic output line that starts with "ERROR", as in |
463 | error("foo"), will promote a "Pass 5: run failed", and the return | |
464 | code is 1. | |
b49f69f3 | 465 | |
2e526dab FCE |
466 | - Systemtap now warns about global variables being referenced from other |
467 | script files. This aims to protect against unintended local-vs-global | |
468 | namespace collisions such as: | |
469 | ||
470 | % cat some_tapset.stp | |
471 | probe baz.one = bar { foo = $foo; bar = $bar } | |
472 | % cat end_user_script.stp | |
473 | global foo # intended to be private variable | |
474 | probe timer.s(1) { foo ++ } | |
475 | probe baz.* { println(foo, pp()) } | |
476 | % stap end_user_script.stp | |
477 | WARNING: cross-file global variable reference to foo from some_tapset.stp | |
478 | ||
561079c8 FCE |
479 | - Preprocessor conditional for kernel configuration testing: |
480 | %( CONFIG_foo == "y" %? ... %) | |
481 | ||
450718c9 FCE |
482 | - ftrace(msg:string) tapset function to send strings to the system-wide |
483 | ftrace ring-buffer (if any). | |
484 | ||
6e2d1162 MW |
485 | - Better support for richer DWARF debuginfo output from GCC 4.5 |
486 | (variable tracking assignments). Kernel modules are now always resolved | |
487 | against all their dependencies to find any info referring to missing | |
488 | symbols. DW_AT_const_value is now supported when no DW_AT_location | |
489 | is available. | |
490 | ||
4432f146 | 491 | * What's new in verson 1.0, 2009-09-22 |
f07c3b68 | 492 | |
23c0a2b3 JS |
493 | - process().mark() probes now use an enabling semaphore to reduce the |
494 | computation overhead of dormant probes. | |
495 | ||
bb2b3e3b JS |
496 | - The function spec for dwarf probes now supports C++ scopes, so you can |
497 | limit the probes to specific namespaces or classes. Multiple scopes | |
498 | can be specified, and they will be matched progressively outward. | |
499 | probe process("foo").function("std::vector<*>::*") { } | |
500 | probe process("foo").function("::global_function") { } | |
501 | ||
4b2cdd06 JS |
502 | - It is now possible to cross-compile systemtap scripts for foreign |
503 | architectures, using the new '-a ARCH' and '-B OPT=VALUE' flags. | |
504 | For example, put arm-linux-gcc etc. into your $PATH, and point | |
505 | systemtap at the target kernel build tree with: | |
506 | stap -a arm -B CROSS_COMPILE=arm-linux- -r /build/tree [...] | |
507 | The -B option is passed to kbuild make. -r identifies the already | |
508 | configured/built kernel tree and -a its architecture (kbuild ARCH=...). | |
509 | Systemtap will infer -p4. | |
510 | ||
ba01c24c | 511 | - Cross compilation using the systemtap client and server |
742b8971 JS |
512 | - stap-start-server now accepts the -r, -R, -I, -B and -a options in |
513 | order to start a cross compiling server. The server will correctly | |
514 | advertise itself with respect to the kernel release and architecture | |
515 | that it compiles for. | |
516 | - When specified on stap-client, the -r and -a options will be | |
517 | considered when searching for a suitable server. | |
ba01c24c | 518 | |
742b8971 | 519 | - When using the systemtap client and server udp port 5353 must be open |
de23650e | 520 | in your firewall in order for the client to find servers using |
742b8971 JS |
521 | avahi-browse. Also the systemtap server will choose a random port in |
522 | the range 1024-63999 for accepting ssl connections. | |
902d0d67 | 523 | |
500bc85c | 524 | - Support for unprivileged users: |
f6efd18a MW |
525 | *********************************************************************** |
526 | * WARNING!!!!!!!!!! * | |
527 | * This feature is EXPERIMENTAL at this time and should be used with * | |
528 | * care. This feature allows systemtap kernel modules to be loaded by * | |
529 | * unprivileged users. The user interface and restrictions will change * | |
530 | * as this feature evolves. * | |
531 | *********************************************************************** | |
742b8971 JS |
532 | - Systemtap modules generated from scripts which use a restricted |
533 | subset of the features available may be loaded by staprun for | |
534 | unprivileged users. Previously, staprun would load modules only for | |
535 | root or for members of the groups stapdev and stapusr. | |
f6efd18a MW |
536 | - Using the --unprivileged option on stap enables translation-time |
537 | checking for use by unprivileged users (see restrictions below). | |
538 | - All modules deemed suitable for use by unprivileged users will be | |
ba01c24c | 539 | signed by the systemtap server when --unprivileged is specified on |
742b8971 JS |
540 | stap-client. See module signing in release 0.9.8 and stap-server in |
541 | release 0.9 below. | |
f6efd18a MW |
542 | - Modules signed by trusted signers (servers) and verified by staprun |
543 | will be loaded by staprun regardless of the user's privilege level. | |
544 | - The system administrator asserts the trustworthiness of a signer | |
545 | (server) by running stap-authorize-signing-cert <cert-file> as root, | |
ba01c24c | 546 | where the <cert-file> can be found in |
742b8971 JS |
547 | ~<user>/.systemtap/ssl/server/stap.cert for servers started by |
548 | ordinary users and in $sysconfdir/systemtap/ssl/server/stap.cert for | |
549 | servers started by root. | |
550 | - Restrictions are intentionally strict at this time and may be | |
551 | relaxed in the future: | |
500bc85c | 552 | - probe points are restricted to: |
20ab90b5 DB |
553 | begin, begin(n), end, end(n), error, error(n), never, |
554 | timer.{jiffies,s,sec,ms,msec,us,usec,ns,nsec}(n)*, timer.hz(n), | |
742b8971 | 555 | process.* (for processes owned by the user). |
b232fab3 | 556 | - use of embedded C code is not allowed. |
ba01c24c DB |
557 | - use of tapset functions is restricted. |
558 | - some tapset functions may not be used at all. A message will be | |
559 | generated at module compilation time. | |
742b8971 JS |
560 | - some actions by allowed tapset functions may only be performed |
561 | in the context of the user's own process. A runtime fault will | |
562 | occur in these situations, for example, direct memory access. | |
563 | - The is_myproc() tapset function has been provided so that | |
564 | tapset writers for unprivileged users can check that the | |
565 | context is of the users own process before attempting these | |
566 | actions. | |
500bc85c | 567 | - accessing the kernel memory space is not allowed. |
ba01c24c DB |
568 | - The following command line options may not be used by stap-client |
569 | -g, -I, -D, -R, -B | |
570 | - The following environment variables are ignored by stap-client: | |
500bc85c DB |
571 | SYSTEMTAP_RUNTIME, SYSTEMTAP_TAPSET, SYSTEMTAP_DEBUGINFO_PATH |
572 | - nss and nss-tools are required to use this feature. | |
573 | ||
bc7cd435 MH |
574 | - Support output file switching by SIGUSR2. Users can command running |
575 | stapio to switch output file by sending SIGUSR2. | |
576 | ||
8faf4a73 DB |
577 | - Memory consumption for scripts involving many uprobes has been |
578 | dramatically reduced. | |
579 | ||
580 | - The preprocessor now supports || and && in the conditions. | |
f6efd18a | 581 | e.g. %( arch == "x86_64" || arch == "ia64" %: ... %) |
8faf4a73 | 582 | |
8faf4a73 DB |
583 | - The systemtap notion of "architecture" now matches the kernel's, rather |
584 | than that of "uname -m". This means that 32-bit i386 family are all | |
585 | known as "i386" rather than "i386" or "i686"; "ppc64" as "powerpc"; | |
586 | "s390x" as "s390", and so on. This is consistent between the new | |
587 | "-a ARCH" flag and the script-level %( arch ... %) conditional. | |
588 | ||
589 | - It is now possible to define multiple probe aliases with the same name. | |
590 | A probe will expand to all matching aliases. | |
742b8971 JS |
591 | probe foo = bar { } |
592 | probe foo = baz { } | |
593 | probe foo { } # expands twice, once to bar and once to baz | |
8faf4a73 | 594 | |
96fb769c DS |
595 | - A new experimental transport mechanism, using ftrace's ring_buffer, |
596 | has been added. This may become the default transport mechanism in | |
597 | future versions of systemtap. To test this new transport mechanism, | |
598 | define 'STP_USE_RING_BUFFER'. | |
599 | ||
f6efd18a MW |
600 | - Support for recognizing DW_OP_{stack,implicit}_value DWARF expressions |
601 | as emitted by GCC 4.5. | |
c61807d2 | 602 | |
4432f146 | 603 | * What's new in version 0.9.9, 2009-08-04 |
f07c3b68 FCE |
604 | |
605 | - Systemwide kernel .function.return (kretprobe) maxactive defaults may | |
606 | be overridden with the -DKRETACTIVE=nnn parameter. | |
607 | ||
76ff718a FCE |
608 | - Translation pass 2 is significantly faster by avoiding unnecessary |
609 | searching through a kernel build/module directory tree. | |
610 | ||
230a1203 MW |
611 | - When compiled against elfutils 0.142 systemtap now handles the new |
612 | DW_OP_call_frame_CFA generated by by GCC. | |
613 | ||
614 | - uprobes and ustack() are more robust when used on applications that | |
615 | depend on prelinked/separate debuginfo shared libraries. | |
616 | ||
617 | - User space PROBE marks are not always found with or without separate | |
618 | debuginfo. The .probes section itself is now always put in the main | |
de23650e WH |
619 | elf file and marked as allocated. When building pic code the section |
620 | is marked writable. The selinux memory check problems seen with | |
621 | programs using STAP_PROBES is fixed. | |
230a1203 MW |
622 | |
623 | - statement() probes can now override "address not at start of statement" | |
624 | errors in guru mode. They also provide alternative addresses to use | |
625 | in non-guru mode. | |
626 | ||
da01fcc6 JS |
627 | - The stapgraph application can generate graphs of data and events |
628 | emitted by systemtap scripts in real time. Run "stapgraph | |
79bd71a1 TM |
629 | testsuite/systemtap.examples/general/grapher.stp" for an example of |
630 | graphing the system load average and keyboard events. | |
631 | ||
da01fcc6 JS |
632 | - Dwarf probes now show parameters and local variables in the verbose |
633 | listing mode (-L). | |
634 | ||
635 | - Symbol aliases are now resolved to their canonical dwarf names. For | |
636 | example, probing "malloc" in libc resolves to "__libc_malloc". | |
637 | ||
638 | - The syntax for dereferencing $target variables and @cast() gained new | |
639 | capabilities: | |
640 | - Array indexes can now be arbitrary numeric expressions. | |
641 | - Array subscripts are now supported on pointer types. | |
642 | - An '&' operator before a @cast or $target returns the address of the | |
643 | final component, especially useful for nested structures. | |
644 | ||
645 | - For reading all probe variables, kernel.mark now supports $$vars and | |
646 | $$parms, and process.syscall now supports $$vars. | |
647 | ||
648 | - The SNMP tapset provides probes and functions for many network | |
649 | statistics. See stapprobes.snmp(3stap) for more details. | |
650 | ||
651 | - The dentry tapset provides functions to map kernel VFS directory entries | |
652 | to file or full path names: d_path(), d_name() and reverse_path_walk(). | |
653 | ||
654 | - SystemTap now has userspace markers in its own binaries, and the stap | |
655 | tapset provides the available probepoints and local variables. | |
656 | ||
657 | - Miscellaneous new tapset functions: | |
658 | - pgrp() returns the process group ID of the current process | |
659 | - str_replace() performs string replacement | |
660 | ||
4432f146 | 661 | * What's new in version 0.9.8, 2009-06-11 |
c3e80cab | 662 | |
849d6546 JS |
663 | - Miscellaneous new tapset functions: |
664 | - sid() returns the session ID of the current process | |
665 | - stringat() indexes a single character from a string. | |
666 | ||
667 | - Using %M in print formats for hex dumps can now print entire buffers, | |
668 | instead of just small numbers. | |
669 | ||
6766808e JS |
670 | - Dwarfless syscalls: The nd_syscalls tapset is now available to probe |
671 | system calls without requiring kernel debugging information. All of | |
672 | the same probepoints in the normal syscalls tapset are available with | |
673 | an "nd_" prefix, e.g. syscall.open becomes nd_syscall.open. Most | |
674 | syscall arguments are also available by name in nd_syscalls. | |
675 | ||
87c589a9 | 676 | - Module signing: If the appropriate nss libraries are available on your |
b232fab3 | 677 | system, stap-server will sign each compiled module using a self-generated |
87c589a9 JS |
678 | certificate. This is the first step toward extending authority to |
679 | load certain modules to unprivileged users. For now, if the system | |
680 | administrator adds a certificate to a database of trusted signers | |
681 | (stap-authorize-signing-cert), modules signed using that certificate | |
682 | will be verified by staprun against tampering. Otherwise, you should | |
683 | notice no difference in the operation of stap or staprun. | |
c3e80cab | 684 | |
4432f146 | 685 | * What's new in version 0.9.7, 2009-04-23 |
dcfd7fed | 686 | |
cff7feda JS |
687 | - @cast can now determine its type information using an explicit header |
688 | specification. For example: | |
689 | @cast(tv, "timeval", "<sys/time.h>")->tv_sec | |
690 | @cast(task, "task_struct", "kernel<linux/sched.h>")->tgid | |
691 | ||
1f65cc4f JS |
692 | - The overlapping process.* tapsets are now separated. Those probe points |
693 | documented in stapprobes(3stap) remain the same. Those that were formerly | |
694 | in stapprobes.process(3stap) have been renamed to kprocess, to reflect | |
695 | their kernel perspective on processes. | |
696 | ||
dcfd7fed FCE |
697 | - The --skip-badvars option now also suppresses run-time error |
698 | messages that would otherwise result from erroneous memory accesses. | |
699 | Such accesses can originate from $context expressions fueled by | |
700 | erroneous debug data, or by kernel_{long,string,...}() tapset calls. | |
701 | ||
94c3c803 AM |
702 | - New probes kprobe.function(FUNCTION) and kprobe.function(FUNCTION).return |
703 | for dwarfless probing. These postpone function address resolution to | |
704 | run-time and use the kprobe symbol-resolution mechanism. | |
705 | Probing of absolute statements can be done using the | |
706 | kprobe.statement(ADDRESS).absolute construct. | |
707 | ||
819ec23d MW |
708 | - EXPERIMENTAL support for user process unwinding. A new collection of |
709 | tapset functions have been added to handle user space backtraces from | |
710 | probe points that support them (currently process and timer probes - | |
711 | for timer probes test whether or not in user space first with the | |
712 | already existing user_mode() function). The new tapset functions are: | |
713 | uaddr - User space address of current running task. | |
714 | usymname - Return the symbol of an address in the current task. | |
715 | usymdata - Return the symbol and module offset of an address. | |
716 | print_ustack - Print out stack for the current task from string. | |
717 | print_ubacktrace - Print stack back trace for current task. | |
718 | ubacktrace - Hex backtrace of current task stack. | |
719 | Please read http://sourceware.org/ml/systemtap/2009-q2/msg00364.html | |
720 | on the current restrictions and possible changes in the future and | |
721 | give feedback if you want to influence future developments. | |
722 | ||
4432f146 | 723 | * What's new in version 0.9.5, 2009-03-27 |
944e2486 | 724 | |
891e4fb2 JS |
725 | - New probes process().insn and process().insn.block that allows |
726 | inspection of the process after each instruction or block of | |
727 | instructions executed. So to count the total number of instructions | |
728 | a process executes during a run do something like: | |
729 | $ stap -e 'global steps; probe process("/bin/ls").insn {steps++} | |
730 | probe end {printf("Total instructions: %d\n", steps);}' \ | |
731 | -c /bin/ls | |
732 | This feature can slow down execution of a process somewhat. | |
83dd1a8e | 733 | |
891e4fb2 JS |
734 | - Systemtap probes and function man pages extracted from the tapsets |
735 | are now available under 3stap. To show the page for probe vm.pagefault | |
736 | or the stap function pexecname do: | |
737 | $ man 3stap vm.pagefault | |
738 | $ man 3stap pexecname | |
8e9d6257 | 739 | |
b1a4288c JS |
740 | - Kernel tracepoints are now supported for probing predefined kernel |
741 | events without any debuginfo. Tracepoints incur less overhead than | |
742 | kprobes, and context parameters are available with full type | |
743 | information. Any kernel 2.6.28 and later should have defined | |
744 | tracepoints. Try the following to see what's available: | |
745 | $ stap -L 'kernel.trace("*")' | |
746 | ||
ccd65d4a JS |
747 | - Typecasting with @cast now supports modules search paths, which is |
748 | useful in case there are multiple places where the type definition | |
749 | may be found. For example: | |
750 | @cast(sdev, "scsi_device", "kernel:scsi_mod")->sdev_state | |
751 | ||
701c41be MH |
752 | - On-file flight recorder is supported. It allows stap to record huge |
753 | trace log on the disk and to run in background. | |
754 | Passing -F option with -o option runs stap in background mode. In this | |
755 | mode, staprun is detached from console, and stap itself shows staprun's | |
756 | pid and exits. | |
757 | Specifying the max size and the max number of log files are also available | |
758 | by passing -S option. This option has one or two arguments seperated by | |
759 | a comma. The first argument is the max size of a log file in MB. If the | |
760 | size of a log file exceeds it, stap switches to the next log file | |
761 | automatically. The second is how many files are kept on the disk. If the | |
762 | number of log files exceeds it, the oldest log file is removed | |
763 | automatically. The second argument can be omitted. | |
764 | ||
765 | For example, this will record output on log files each of them is smaller | |
766 | than 1024MB and keep last 3 logs, in background. | |
767 | % stap -F -o /tmp/staplog -S 1024,3 script.stp | |
768 | ||
e2ae0696 LR |
769 | - In guru mode (-g), the kernel probing blacklist is disabled, leaving |
770 | only a subset - the kernel's own internal kprobe blacklist - to attempt | |
771 | to filter out areas unsafe to probe. The differences may be enough to | |
772 | probe more interrupt handlers. | |
773 | ||
3bd0d4df | 774 | - Variables unavailable in current context may be skipped by setting a |
947d86f9 FCE |
775 | session level flag with command line option --skip-badvars now available. |
776 | This replaces any dwarf $variable expressions that could not be resolved | |
777 | with literal numeric zeros, along with a warning message. | |
3bd0d4df | 778 | |
59fde7cc MW |
779 | - Both kernel markers and kernel tracepoint support argument listing |
780 | through stap -L 'kernel.mark("*")' or stap -L 'kernel.trace("*")' | |
781 | ||
782 | - Users can use -DINTERRUPTIBLE=0 to prevent interrupt reentrancy in | |
783 | their script, at the cost of a bit more overhead to toggle the | |
784 | interrupt mask. | |
785 | ||
786 | - Added reentrancy debugging. If stap is run with the arguments | |
787 | "-t -DDEBUG_REENTRANCY", additional warnings will be printed for | |
788 | every reentrancy event, including the probe points of the | |
789 | resident and interloper probes. | |
790 | ||
387a7a57 MW |
791 | - Default to --disable-pie for configure. |
792 | Use --enable-pie to turn it back on. | |
793 | ||
794 | - Improved sdt.h compatibility and test suite for static dtrace | |
795 | compatible user space markers. | |
796 | ||
797 | - Some architectures now use syscall wrappers (HAVE_SYSCALL_WRAPPERS). | |
798 | The syscall tapset has been enhanced to take care of the syscall | |
799 | wrappers in this release. | |
800 | ||
801 | - Security fix for CVE-2009-0784: stapusr module-path checking race. | |
802 | ||
4432f146 | 803 | * What's new in version 0.9, 2009-02-19 |
6b2ad26c | 804 | |
60ea9291 JS |
805 | - Typecasting is now supported using the @cast operator. A script can |
806 | define a pointer type for a "long" value, and then access type members | |
807 | using the same syntax as with $target variables. For example, this will | |
808 | retrieve the parent pid from a kernel task_struct: | |
809 | @cast(pointer, "task_struct", "kernel")->parent->pid | |
810 | ||
76d146ad MW |
811 | - process().mark() probes are now possible to trace static user space |
812 | markers put in programs with the STAP_PROBE macro using the new | |
813 | sys/sdt.h include file. This also provides dtrace compatible markers | |
814 | through DTRACE_PROBE and an associated python 'dtrace' script that | |
815 | can be used in builds based on dtrace that need dtrace -h or -G | |
816 | functionality. | |
817 | ||
62c977f5 MW |
818 | - For those that really want to run stap from the build tree there is |
819 | now the 'run-stap' script in the top-level build directory that sets | |
820 | up the SYSTEMTAP_TAPSET, SYSTEMTAP_RUNTIME, SYSTEMTAP_STAPRUN, and | |
821 | SYSTEMTAP_STAPIO environment variables (installing systemtap, in a | |
822 | local prefix, is still recommended for common use). | |
823 | ||
824 | - Systemtap now comes with a new Beginners Guide that walks the user | |
825 | through their first steps setting up stap, understanding how it all | |
2a321362 MW |
826 | works, introduces some useful scripts and describes some common |
827 | pitfalls. It isn't created by default since it needs a Publican | |
828 | setup, but full build instructions can be found in the wiki: | |
829 | http://sourceware.org/systemtap/wiki/PublicanQuikHowto | |
830 | An online version can be found at: | |
831 | http://sourceware.org/systemtap/SystemTap_Beginners_Guide.pdf | |
832 | ||
3ad1e1ee MW |
833 | - Standard tapsets included with Systemtap were modified to include |
834 | extractable documentation information based on the kernel-doc | |
835 | infrastructure. When configured --enabled-docs a HTML and PDF | |
836 | version of the Tapset Reference Manual is produced explaining probes | |
837 | defined in each tapset. | |
838 | ||
9e494cbb DB |
839 | - The systemtap client and compile server are now available. |
840 | These allow you to compile a systemtap module on a host other than | |
841 | the one which it will be run, providing the client and server | |
842 | are compatible. Other than using a server for passes 1 through | |
843 | 4, the client behaves like the 'stap' front end itself. This | |
844 | means, among other things, that the client will automatically | |
845 | load the resulting module on the local host unless -p[1234] | |
c8bf931d | 846 | was specified. See stap-server(8) for more details. |
9e494cbb | 847 | The client/server now use SSL for network connection security and |
6288515e DB |
848 | for signing. |
849 | ||
850 | The systemtap client and server are prototypes only. Interfaces, options | |
851 | and usage may change at any time. | |
9e494cbb | 852 | |
592470cd SC |
853 | - function("func").label("label") probes are now supported to allow matching |
854 | the label of a function. | |
855 | ||
9a8d8be3 MH |
856 | - Systemtap initscript is available. This initscript allows you to run |
857 | systemtap scripts as system services (in flight recorder mode) and | |
858 | control those scripts individually. | |
e2a741be | 859 | See README.systemtap for details. |
9a8d8be3 | 860 | |
b5e66ada FCE |
861 | - The stap "-r DIR" option may be used to identify a hand-made kernel |
862 | build directory. The tool determines the appropriate release string | |
863 | automatically from the directory. | |
7471ea1f | 864 | |
453edad1 | 865 | - Serious problems associated with user-space probing in shared libraries |
592470cd | 866 | were corrected, making it now possible to experiment with probe shared |
7d091090 FCE |
867 | libraries. Assuming dwarf debugging information is installed, use this |
868 | twist on the normal syntax: | |
869 | ||
870 | probe process("/lib64/libc-2.8.so").function("....") { ... } | |
871 | ||
872 | This would probe all threads that call into that library. Running | |
873 | "stap -c CMD" or "stap -x PID" naturally restricts this to the target | |
453edad1 | 874 | command+descendants only. $$vars etc. may be used. |
7d091090 FCE |
875 | |
876 | - For scripts that sometimes terminate with excessive "skipped" probes, | |
877 | rerunning the script with "-t" (timing) will print more details about | |
878 | the skippage reasons. | |
879 | ||
fd2aeae9 FCE |
880 | - Symbol tables and unwind (backtracing) data support were formerly |
881 | compiled in for all probed modules as identified by the script | |
882 | (kernel; module("name"); process("file")) plus those listed by the | |
883 | stap "-d BINARY" option. Now, this data is included only if the systemtap | |
884 | script uses tapset functions like probefunc() or backtrace() that require | |
885 | such information. This shrinks the probe modules considerably for the rest. | |
886 | ||
e0b4e89d | 887 | - Per-pass verbosity control is available with the new "--vp {N}+" option. |
fd2aeae9 FCE |
888 | "stap --vp 040" adds 4 units of -v verbosity only to pass 2. This is useful |
889 | for diagnosing errors from one pass without excessive verbosity from others. | |
e0b4e89d | 890 | |
5c4dcbfb FCE |
891 | - Most probe handlers now run with interrupts enabled, for improved |
892 | system responsiveness and less probing overhead. This may result | |
893 | in more skipped probes, for example if a reentrant probe handler | |
fd2aeae9 FCE |
894 | is attempted from within an interrupt handler. It may also make the |
895 | systemtap overload detection facility more likely to be triggered, as | |
896 | interrupt handlers' run time would be included in the self-assessed | |
897 | overhead of running probe handlers. | |
6b2ad26c | 898 | |
4432f146 | 899 | * What's new in version 0.8, 2008-11-13 |
cfaa068c | 900 | |
2f9f9366 FCE |
901 | - Cache limiting is now available. If the compiled module cache size is |
902 | over a limit specified in the $SYSTEMTAP_DIR/cache/cache_mb_limit file, | |
903 | some old cache entries will be unlinked. See man stap(1) for more. | |
904 | ||
57b2fd2b RA |
905 | - Error and warning messages are now followed by source context displaying |
906 | the erroneous line/s and a handy '^' in the following line pointing to the | |
907 | appropriate column. | |
908 | ||
23433b34 EB |
909 | - A bug reporting tool "stap-report" is now available which will quickly |
910 | retrieve much of the information requested here: | |
911 | http://sourceware.org/systemtap/wiki/HowToReportBugs | |
912 | ||
25a63204 FCE |
913 | - The translator can resolve members of anonymous structs / unions: |
914 | given struct { int foo; struct { int bar; }; } *p; | |
915 | this now works: $p->bar | |
916 | ||
2fa2a091 NT |
917 | - The stap "-F" flag activates "flight recorder" mode, which consists of |
918 | translating the given script as usual, but implicitly launching it into | |
919 | the background with staprun's existing "-L" (launch) option. A user | |
920 | can later reattach to the module with "staprun -A MODULENAME". | |
921 | ||
6270adc1 MH |
922 | - Additional context variables are available on user-space syscall probes. |
923 | - $argN ($arg1, $arg2, ... $arg6) in process(PATH_OR_PID).syscall | |
924 | gives you the argument of the system call. | |
5d67b47c MH |
925 | - $return in process(PATH_OR_PID).syscall.return gives you the return |
926 | value of the system call. | |
6270adc1 | 927 | |
cec7293b | 928 | - Target process mode (stap -c CMD or -x PID) now implicitly restricts all |
094b05c7 | 929 | "process.*" probes to the given child process. (It does not affect |
34f2e0b9 FCE |
930 | kernel.* or other probe types.) The CMD string is normally run directly, |
931 | rather than via a /bin/sh -c subshell, since then utrace/uprobe probes | |
932 | receive a fairly "clean" event stream. If metacharacters like | |
933 | redirection operators were present in CMD, then "sh -c CMD" is still | |
934 | used, and utrace/uprobe probes will receive events from the shell. | |
cec7293b FCE |
935 | |
936 | % stap -e 'probe process.syscall, process.end { | |
937 | printf("%s %d %s\n", execname(), pid(), pp())}'\ | |
938 | -c ls | |
939 | ls 2323 process.syscall | |
940 | ls 2323 process.syscall | |
941 | ls 2323 process.end | |
942 | ||
1044139f FCE |
943 | - Probe listing mode is improved: "-L" lists available script-level variables |
944 | ||
945 | % stap -L 'syscall.*open*' | |
946 | syscall.mq_open name:string name_uaddr:long filename:string mode:long u_attr_uaddr:long oflag:long argstr:string | |
947 | syscall.open name:string filename:string flags:long mode:long argstr:string | |
948 | syscall.openat name:string filename:string flags:long mode:long argstr:string | |
949 | ||
e070cc9c FCE |
950 | - All user-space-related probes support $PATH-resolved executable |
951 | names, so | |
952 | ||
953 | probe process("ls").syscall {} | |
954 | probe process("./a.out").syscall {} | |
955 | ||
956 | work now, instead of just | |
957 | ||
958 | probe process("/bin/ls").syscall {} | |
959 | probe process("/my/directory/a.out").syscall {} | |
960 | ||
961 | - Prototype symbolic user-space probing support: | |
962 | ||
963 | # stap -e 'probe process("ls").function("*").call { | |
964 | log (probefunc()." ".$$parms) | |
965 | }' \ | |
966 | -c 'ls -l' | |
967 | ||
968 | This requires: | |
969 | - debugging information for the named program | |
970 | - a version of utrace in the kernel that is compatible with the "uprobes" | |
971 | kernel module prototype. This includes RHEL5 and older Fedora, but not | |
972 | yet current lkml-track utrace; a "pass 4a"-time build failure means | |
973 | your system cannot use this yet. | |
974 | ||
cd221ed4 | 975 | - Global variables which are written to but never read are now |
e070cc9c | 976 | automatically displayed when the session does a shutdown. For example: |
5d954165 | 977 | |
e070cc9c FCE |
978 | global running_tasks |
979 | probe timer.profile {running_tasks[pid(),tid()] = execname()} | |
5d954165 | 980 | probe timer.ms(8000) {exit()} |
cd221ed4 | 981 | |
a93f0b31 SC |
982 | - A formatted string representation of the variables, parameters, or local |
983 | variables at a probe point is now supported via the special $$vars, | |
a43ba433 FCE |
984 | $$parms, and $$locals context variables, which expand to a string |
985 | containing a list "var1=0xdead var2=0xbeef var3=?". (Here, var3 exists | |
986 | but is for some reason unavailable.) In return probes only, $$return | |
fd574705 | 987 | expands to an empty string for a void function, or "return=0xf00". |
a93f0b31 | 988 | |
e10599ff | 989 | |
4432f146 | 990 | * What's new in version 0.7, 2008-07-15 |
c2af6f02 | 991 | |
99a5f9cf SC |
992 | - .statement("func@file:*") and .statement("func@file:M-N") probes are now |
993 | supported to allow matching a range of lines in a function. This allows | |
994 | tracing the execution of a function. | |
995 | ||
14a75801 FCE |
996 | - Scripts relying on probe point wildcards like "syscall.*" that expand |
997 | to distinct kprobes are processed significantly faster than before. | |
998 | ||
d57671d3 FCE |
999 | - The vector of script command line arguments is available in a |
1000 | tapset-provided global array argv[]. It is indexed 1 ... argc, | |
1001 | another global. This can substitute for of preprocessor | |
1002 | directives @NNN that fail at parse time if there are not | |
1003 | enough arguments. | |
1004 | ||
1005 | printf("argv: %s %s %s", argv[1], argv[2], argv[3]) | |
1006 | ||
1bd128a3 SC |
1007 | - .statement("func@file+line") probes are now supported to allow a |
1008 | match relative to the entry of the function incremented by line | |
1009 | number. This allows using the same systemtap script if the rest | |
1010 | of the file.c source only changes slightly. | |
1011 | ||
16442b90 FCE |
1012 | - A probe listing mode is available. |
1013 | % stap -l vm.* | |
1014 | vm.brk | |
1015 | vm.mmap | |
1016 | vm.munmap | |
1017 | vm.oom_kill | |
1018 | vm.pagefault | |
1019 | vm.write_shared | |
1020 | ||
159cb109 DS |
1021 | - More user-space probe types are added: |
1022 | ||
dd078c96 DS |
1023 | probe process(PID).begin { } |
1024 | probe process("PATH").begin { } | |
1025 | probe process(PID).thread.begin { } | |
1026 | probe process("PATH").thread.begin { } | |
1027 | probe process(PID).end { } | |
1028 | probe process("PATH").end { } | |
1029 | probe process(PID).thread.end { } | |
1030 | probe process("PATH").thread.end { } | |
159cb109 DS |
1031 | probe process(PID).syscall { } |
1032 | probe process("PATH").syscall { } | |
1033 | probe process(PID).syscall.return { } | |
1034 | probe process("PATH").syscall.return { } | |
16442b90 | 1035 | |
c3799d72 AM |
1036 | - Globals now accept ; terminators |
1037 | ||
1038 | global odds, evens; | |
1039 | global little[10], big[5]; | |
1040 | ||
4432f146 | 1041 | * What's new in version 0.6, 2007-12-15 |
62802575 FCE |
1042 | |
1043 | - A copy of the systemtap tutorial and language reference guide | |
1044 | are now included. | |
683b62c0 | 1045 | |
34201621 DB |
1046 | - There is a new format specifier, %m, for the printf family of |
1047 | functions. It functions like %s, except that it does not stop when | |
1048 | a nul ('\0') byte is encountered. The number of bytes output is | |
1049 | determined by the precision specifier. The default precision is 1. | |
1050 | For example: | |
1051 | ||
1052 | printf ("%m", "My String") // prints one character: M | |
1053 | printf ("%.5", myString) // prints 5 bytes beginning at the start | |
1054 | // of myString | |
1055 | ||
1056 | - The %b format specifier for the printf family of functions has been enhanced | |
1057 | as follows: | |
1058 | ||
1059 | 1) When the width and precision are both unspecified, the default is %8.8b. | |
1060 | 2) When only one of the width or precision is specified, the other defaults | |
1061 | to the same value. For example, %4b == %.4b == %4.4b | |
1062 | 3) Nul ('\0') bytes are used for field width padding. For example, | |
1063 | ||
1064 | printf ("%b", 0x1111deadbeef2222) // prints all eight bytes | |
1065 | printf ("%4.2b", 0xdeadbeef) // prints \0\0\xbe\xef | |
1066 | ||
1067 | - Dynamic width and precision are now supported for all printf family format | |
1068 | specifiers. For example: | |
1069 | ||
1070 | four = 4 | |
1071 | two = 2 | |
1072 | printf ("%*.*b", four, two, 0xdeadbbeef) // prints \0\0\xbe\xef | |
1073 | printf ("%*d", four, two) // prints <space><space><space>2 | |
1074 | ||
7a468d68 | 1075 | - Preprocessor conditional expressions can now include wildcard style |
e070cc9c | 1076 | matches on kernel versions. |
7a468d68 FCE |
1077 | %( kernel_vr != "*xen" %? foo %: bar %) |
1078 | ||
1ada6f08 FCE |
1079 | - Prototype support for user-space probing is showing some progress. |
1080 | No symbolic notations are supported yet (so no probing by function names, | |
1081 | file names, process names, and no access to $context variables), but at | |
1082 | least it's something: | |
1083 | ||
1084 | probe process(PID).statement(ADDRESS).absolute { } | |
1085 | ||
1086 | This will set a uprobe on the given process-id and given virtual address. | |
1087 | The proble handler runs in kernel-space as usual, and can generally use | |
1088 | existing tapset functions. | |
1089 | ||
149eaccd MH |
1090 | - Crash utility can retrieve systemtap's relay buffer from a kernel dump |
1091 | image by using staplog which is a crash extension module. To use this | |
1092 | feature, type commands as below from crash(8)'s command line: | |
1093 | ||
1094 | crash> extend staplog.so | |
1095 | crash> help systemtaplog | |
1096 | ||
1097 | Then, you can see more precise help message. | |
1098 | ||
1099 | - You can share a relay buffer amoung several scripts and merge outputs from | |
1100 | several scripts by using "-DRELAY_HOST" and "-DRELAY_GUEST" options. | |
1101 | For example: | |
1102 | ||
1103 | # run a host script | |
1104 | % stap -ve 'probe begin{}' -o merged.out -DRELAY_HOST & | |
1105 | # wait until starting the host. | |
1106 | % stap -ve 'probe begin{print("hello ");exit()}' -DRELAY_GUEST | |
1107 | % stap -ve 'probe begin{print("world\n");exit()}' -DRELAY_GUEST | |
1108 | ||
1109 | Then, you'll see "hello world" in merged.out. | |
1110 | ||
dfd11cc3 MH |
1111 | - You can add a conditional statement for each probe point or aliase, which |
1112 | is evaluated when the probe point is hit. If the condition is false, the | |
1113 | whole probe body(including aliases) is skipped. For example: | |
1114 | ||
1115 | global switch = 0; | |
1116 | probe syscall.* if (switch) { ... } | |
1117 | probe procfs.write {switch = strtol($value,10)} /* enable/disable ctrl */ | |
1118 | ||
a9e8f7e0 FCE |
1119 | - Systemtap will warn you if your script contains unused variables or |
1120 | functions. This is helpful in case of misspelled variables. If it | |
1121 | doth protest too much, turn it off with "stap -w ...". | |
1122 | ||
683b62c0 FCE |
1123 | - You can add error-handling probes to a script, which are run if a |
1124 | script was stopped due to errors. In such a case, "end" probes are | |
1125 | not run, but "error" ones are. | |
1126 | ||
1127 | probe error { println ("oops, errors encountered; here's a report anyway") | |
1128 | foreach (coin in mint) { println (coin) } } | |
98aab489 | 1129 | |
d898100a FCE |
1130 | - In a related twist, one may list probe points in order of preference, |
1131 | and mark any of them as "sufficient" beyond just "optional". Probe | |
1132 | point sequence expansion stops if a sufficient-marked probe point has a hit. | |
1133 | This is useful for probes on functions that may be in a module (CONFIG_FOO=m) | |
1134 | or may have been compiled into the kernel (CONFIG_FOO=y), but we don't know | |
1135 | which. Instead of | |
1136 | ||
1137 | probe module("sd").function("sd_init_command") ? , | |
1138 | kernel.function("sd_init_command") ? { ... } | |
1139 | ||
1140 | which might match neither, now one can write this: | |
1141 | ||
1142 | probe module("sd").function("sd_init_command") ! , /* <-- note excl. mark */ | |
1143 | kernel.function("sd_init_command") { ... } | |
1144 | ||
98aab489 | 1145 | - New security model. To install a systemtap kernel module, a user |
fedd4090 FCE |
1146 | must be one of the following: the root user; a member of the |
1147 | 'stapdev' group; or a member of the 'stapusr' group. Members of the | |
1148 | stapusr group can only use modules located in the | |
1149 | /lib/modules/VERSION/systemtap directory (where VERSION is the | |
1150 | output of "uname -r"). | |
1151 | ||
1152 | - .statement("...@file:line") probes now apply heuristics to allow an | |
1153 | approximate match for the line number. This works similarly to gdb, | |
1154 | where a breakpoint placed on an empty source line is automatically | |
1155 | moved to the next statement. A silly bug that made many $target | |
1156 | variables inaccessible to .statement() probes was also fixed. | |
98aab489 | 1157 | |
6d4a0530 FCE |
1158 | - LKET has been retired. Please let us know on <systemtap@sourceware.org> |
1159 | if you have been a user of the tapset/tools, so we can help you find | |
1160 | another way. | |
1161 | ||
4fcb4393 FCE |
1162 | - New families of printing functions println() and printd() have been added. |
1163 | println() is like print() but adds a newline at the end; | |
1164 | printd() is like a sequence of print()s, with a specified field delimiter. | |
1165 | ||
4432f146 | 1166 | * What's new since version 0.5.14?, 2007-07-03 |
db6f191e | 1167 | |
3f99432c FCE |
1168 | - The way in which command line arguments for scripts are substituted has |
1169 | changed. Previously, $1 etc. would interpret the corresponding command | |
1170 | line argument as an numeric literal, and @1 as a string literal. Now, | |
1171 | the command line arguments are pasted uninterpreted wherever $1 etc. | |
1172 | appears at the beginning of a token. @1 is similar, but is quoted as | |
1173 | a string. This change does not modify old scripts, but has the effect | |
1174 | of permitting substitution of arbitrary token sequences. | |
1175 | ||
1176 | # This worked before, and still does: | |
1177 | % stap -e 'probe timer.s($1) {}' 5 | |
1178 | # Now this also works: | |
1179 | % stap -e 'probe syscall.$1 {log(@1)}' open | |
1180 | # This won't crash, just signal a recursion error: | |
1181 | % stap -e '$1' '$1' | |
1182 | # As before, $1... is recognized only at the beginning of a token | |
1183 | % stap -e 'probe begin {foo$1=5}' | |
db6f191e | 1184 | |
4432f146 | 1185 | * What's new since version 0.5.13?, 2007-03-26 |
8438f752 | 1186 | |
b8da0ad1 FCE |
1187 | - The way in which systemtap resolves function/inline probes has changed: |
1188 | .function(...) - now refers to all functions, inlined or not | |
1189 | .inline(...) - is deprecated, use instead: | |
1190 | .function(...).inline - filters function() to only inlined instances | |
1191 | .function(...).call - filters function() to only non-inlined instances | |
1192 | .function(...).return - as before, but now pairs best with .function().call | |
1193 | .statement() is unchanged. | |
8438f752 | 1194 | |
4432f146 | 1195 | * What's new since version 0.5.12?, 2007-01-01 |
9abec538 FCE |
1196 | |
1197 | - When running in -p4 (compile-only) mode, the compiled .ko file name | |
1198 | is printed on standard output. | |
1199 | ||
dcc4fec4 FCE |
1200 | - An array element with a null value such as zero or an empty string |
1201 | is now preserved, and will show up in a "foreach" loop or "in" test. | |
1202 | To delete such an element, the scripts needs to use an explicit | |
1203 | "delete array[idx]" statement rather than something like "array[idx]=0". | |
1204 | ||
44f75386 FCE |
1205 | - The new "-P" option controls whether prologue searching heuristics |
1206 | will be activated for function probes. This was needed to get correct | |
1207 | debugging information (dwarf location list) data for $target variables. | |
1208 | Modern compilers (gcc 4.1+) tend not to need this heuristic, so it is | |
1209 | no longer default. A new configure flag (--enable-prologues) restores | |
1210 | it as a default setting, and is appropriate for older compilers (gcc 3.*). | |
9abec538 | 1211 | |
74525094 FCE |
1212 | - Each systemtap module prints a one-line message to the kernel informational |
1213 | log when it starts. This line identifies the translator version, base | |
1214 | address of the probe module, a broken-down memory consumption estimate, and | |
1215 | the total number of probes. This is meant as a debugging / auditing aid. | |
1216 | ||
29fdb4e4 DS |
1217 | - Begin/end probes are run with interrupts enabled (but with |
1218 | preemption disabled). This will allow begin/end probes to be | |
1219 | longer, to support generating longer reports. | |
74525094 | 1220 | |
37ebca01 FCE |
1221 | - The numeric forms of kernel.statement() and kernel.function() probe points |
1222 | are now interpreted as relocatable values - treated as relative to the | |
1223 | _stext symbol in that kernel binary. Since some modern kernel images | |
1224 | are relocated to a different virtual address at startup, such addresses | |
1225 | may shift up or down when actually inserted into a running kernel. | |
1226 | ||
1227 | kernel.statement(0xdeadbeef): validated, interpreted relative to _stext, | |
1228 | may map to 0xceadbeef at run time. | |
1229 | ||
1230 | In order to specify unrelocated addresses, use the new ".absolute" | |
1231 | probe point suffix for such numeric addresses. These are only | |
1232 | allowed in guru mode, and provide access to no $target variables. | |
1233 | They don't use debugging information at all, actually. | |
1234 | ||
1235 | kernel.statement(0xfeedface).absolute: raw, unvalidated, guru mode only | |
1236 | ||
4432f146 | 1237 | * What's new since version 0.5.10?, 2006-10-19 |
7ad9d4f5 FCE |
1238 | |
1239 | - Offline processing of debugging information, enabling general | |
1240 | cross-compilation of probe scripts to remote hosts, without | |
1241 | requiring identical module/memory layout. This slows down | |
1242 | compilation/translation somewhat. | |
1243 | ||
1244 | - Kernel symbol table data is loaded by staprun at startup time | |
1245 | rather than compiled into the module. | |
1246 | ||
1247 | - Support the "limit" keyword for foreach iterations: | |
1248 | foreach ([x,y] in ary limit 5) { ... } | |
1249 | This implicitly exits after the fifth iteration. It also enables | |
1250 | more efficient key/value sorting. | |
1251 | ||
1252 | - Support the "maxactive" keyword for return probes: | |
1253 | probe kernel.function("sdfsdf").maxactive(848) { ... } | |
1254 | This allows up to 848 concurrently outstanding entries to | |
1255 | the sdfsdf function before one returns. The default maxactive | |
1256 | number is smaller, and can result in missed return probes. | |
1257 | ||
1258 | - Support accessing of saved function arguments from within | |
1259 | return probes. These values are saved by a synthesized | |
1260 | function-entry probe. | |
1261 | ||
1262 | - Add substantial version/architecture checking in compiled probes to | |
1263 | assert correct installation of debugging information and correct | |
1264 | execution on a compatible kernel. | |
1265 | ||
1266 | - Add probe-time checking for sufficient free stack space when probe | |
1267 | handlers are invoked, as a safety improvement. | |
1268 | ||
1269 | - Add an optional numeric parameter for begin/end probe specifications, | |
e070cc9c | 1270 | to order their execution. |
7ad9d4f5 FCE |
1271 | probe begin(10) { } /* comes after */ probe begin(-10) {} |
1272 | ||
1273 | - Add an optional array size declaration, which is handy for very small | |
1274 | or very large ones. | |
e070cc9c | 1275 | global little[5], big[20000] |
7ad9d4f5 FCE |
1276 | |
1277 | - Include some example scripts along with the documentation. | |
1278 | ||
1279 | - Change the start-time allocation of probe memory to avoid causing OOM | |
1280 | situations, and to abort cleanly if free kernel memory is short. | |
1281 | ||
1282 | - Automatically use the kernel DWARF unwinder, if present, for stack | |
1283 | tracebacks. | |
1284 | ||
1285 | - Many minor bug fixes, performance, tapset, and error message | |
1286 | improvements. |