summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AUTHORS12
-rw-r--r--ChangeLog7
-rw-r--r--NEWS50
-rwxr-xr-xconfigure20
-rw-r--r--configure.ac2
-rw-r--r--examples/futexes.stp36
-rw-r--r--examples/futexes.txt18
-rw-r--r--examples/helloworld.stp1
-rw-r--r--examples/iostat-scsi.stp51
-rw-r--r--examples/iostat-scsi.txt14
-rw-r--r--examples/nettop.stp53
-rw-r--r--examples/nettop.txt20
-rw-r--r--examples/pf2.stp15
-rw-r--r--examples/pf2.txt21
14 files changed, 305 insertions, 15 deletions
diff --git a/AUTHORS b/AUTHORS
index 37e65bfe..b0feb9e3 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,7 +1,11 @@
-./
Frank Ch. Eigler <fche@redhat.com>
-Graydon Hoare <graydon@redhat.com>
-
-./runtime
Martin Hunt <hunt@redhat.com>
+Li Guanglei <guanglei@cn.ibm.com>
+Joshua Stone <josh.i.stone@intel.com>
+David Smith <dsmith@redhat.com>
+Graydon Hoare <formerly graydon@redhat.com>
+Roland McGrath <roland@redhat.com>
+Will Cohen <wcohen@redhat.com>
+Thang Nguyen <thang.p.nguyen@intel.com>
Tom Zanussi <zanussi@us.ibm.com>
+... and others! \ No newline at end of file
diff --git a/ChangeLog b/ChangeLog
index f7eba4dd..5351906b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-01-01 Frank Ch. Eigler <fche@redhat.com>
+
+ * configure.ac: Bump version to 0.5.12 for release.
+ * configure: Regenerated.
+ * NEWS, AUTHORS: Populate & repopulate.
+ * examples/*: Added several .stp/.txt files from the wiki.
+
2006-12-29 Frank Ch. Eigler <fche@elastic.org>
* tapsets.cxx (*group:emit_module_init): flush stdout less for timing
diff --git a/NEWS b/NEWS
index e69de29b..21d15998 100644
--- a/NEWS
+++ b/NEWS
@@ -0,0 +1,50 @@
+* What's new since version 0.5.10?
+
+- Offline processing of debugging information, enabling general
+ cross-compilation of probe scripts to remote hosts, without
+ requiring identical module/memory layout. This slows down
+ compilation/translation somewhat.
+
+- Kernel symbol table data is loaded by staprun at startup time
+ rather than compiled into the module.
+
+- Support the "limit" keyword for foreach iterations:
+ foreach ([x,y] in ary limit 5) { ... }
+ This implicitly exits after the fifth iteration. It also enables
+ more efficient key/value sorting.
+
+- Support the "maxactive" keyword for return probes:
+ probe kernel.function("sdfsdf").maxactive(848) { ... }
+ This allows up to 848 concurrently outstanding entries to
+ the sdfsdf function before one returns. The default maxactive
+ number is smaller, and can result in missed return probes.
+
+- Support accessing of saved function arguments from within
+ return probes. These values are saved by a synthesized
+ function-entry probe.
+
+- Add substantial version/architecture checking in compiled probes to
+ assert correct installation of debugging information and correct
+ execution on a compatible kernel.
+
+- Add probe-time checking for sufficient free stack space when probe
+ handlers are invoked, as a safety improvement.
+
+- Add an optional numeric parameter for begin/end probe specifications,
+ to order their execution.
+ probe begin(10) { } /* comes after */ probe begin(-10) {}
+
+- Add an optional array size declaration, which is handy for very small
+ or very large ones.
+ global little[5], big[20000]
+
+- Include some example scripts along with the documentation.
+
+- Change the start-time allocation of probe memory to avoid causing OOM
+ situations, and to abort cleanly if free kernel memory is short.
+
+- Automatically use the kernel DWARF unwinder, if present, for stack
+ tracebacks.
+
+- Many minor bug fixes, performance, tapset, and error message
+ improvements.
diff --git a/configure b/configure
index 7cee7614..60ec8c78 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for systemtap 0.5.11.
+# Generated by GNU Autoconf 2.59 for systemtap 0.5.12.
#
# Report bugs to <systemtap@sources.redhat.com>.
#
@@ -269,8 +269,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='systemtap'
PACKAGE_TARNAME='systemtap'
-PACKAGE_VERSION='0.5.11'
-PACKAGE_STRING='systemtap 0.5.11'
+PACKAGE_VERSION='0.5.12'
+PACKAGE_STRING='systemtap 0.5.12'
PACKAGE_BUGREPORT='systemtap@sources.redhat.com'
# Factoring default headers for most tests.
@@ -791,7 +791,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures systemtap 0.5.11 to adapt to many kinds of systems.
+\`configure' configures systemtap 0.5.12 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -853,7 +853,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of systemtap 0.5.11:";;
+ short | recursive ) echo "Configuration of systemtap 0.5.12:";;
esac
cat <<\_ACEOF
@@ -985,7 +985,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-systemtap configure 0.5.11
+systemtap configure 0.5.12
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -999,7 +999,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by systemtap $as_me 0.5.11, which was
+It was created by systemtap $as_me 0.5.12, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1644,7 +1644,7 @@ fi
# Define the identity of the package.
PACKAGE='systemtap'
- VERSION='0.5.11'
+ VERSION='0.5.12'
cat >>confdefs.h <<_ACEOF
@@ -6394,7 +6394,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
-This file was extended by systemtap $as_me 0.5.11, which was
+This file was extended by systemtap $as_me 0.5.12, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -6457,7 +6457,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-systemtap config.status 0.5.11
+systemtap config.status 0.5.12
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/configure.ac b/configure.ac
index ea3b61da..319065bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
dnl configure.ac --- autoconf input file for systemtap
dnl Process this file with autoconf to produce a configure script.
-AC_INIT([systemtap], 0.5.11, systemtap@sources.redhat.com, systemtap)
+AC_INIT([systemtap], 0.5.12, systemtap@sources.redhat.com, systemtap)
AC_PREREQ(2.59)
AM_INIT_AUTOMAKE
diff --git a/examples/futexes.stp b/examples/futexes.stp
new file mode 100644
index 00000000..608ce0de
--- /dev/null
+++ b/examples/futexes.stp
@@ -0,0 +1,36 @@
+#! stap
+
+# This script tries to identify contended user-space locks by hooking
+# into the futex system call.
+
+global thread_thislock # short
+global thread_blocktime #
+global FUTEX_WAIT = 0, FUTEX_WAKE = 1
+
+global lock_waits # long-lived stats on (tid,lock) blockage elapsed time
+global process_names # long-lived pid-to-execname mapping
+
+probe syscall.futex {
+ if (op != FUTEX_WAIT) next # we don't care about originators of WAKE events
+ t = tid ()
+ process_names[pid()] = execname()
+ thread_thislock[t] = $uaddr
+ thread_blocktime[t] = gettimeofday_us()
+}
+
+probe syscall.futex.return {
+ t = tid()
+ ts = thread_blocktime[t]
+ if (ts) {
+ elapsed = gettimeofday_us() - ts
+ lock_waits[pid(), thread_thislock[t]] <<< elapsed
+ delete thread_blocktime[t]
+ delete thread_thislock[t]
+ }
+}
+
+probe end {
+ foreach ([pid+, lock] in lock_waits)
+ printf ("%s[%d] lock %p contended %d times, %d avg us\n",
+ process_names[pid], pid, lock, @count(lock_waits[pid,lock]), @avg(lock_waits[pid,lock]))
+}
diff --git a/examples/futexes.txt b/examples/futexes.txt
new file mode 100644
index 00000000..51de4352
--- /dev/null
+++ b/examples/futexes.txt
@@ -0,0 +1,18 @@
+From: http://sourceware.org/systemtap/wiki/WSFutexContention
+
+# stap futexes.stp
+^C
+liferea-bin[3613] lock 0x0a117340 contended 1 times, 71 avg us
+java_vm[8155] lock 0x09baa45c contended 9 times, 1004013 avg us
+java_vm[8155] lock 0x09d6f9ac contended 186 times, 55964 avg us
+xmms[16738] lock 0xbfe29eec contended 777 times, 69 avg us
+xmms[16738] lock 0xbfe29ecc contended 119 times, 64 avg us
+xmms[16738] lock 0xbfe29ebc contended 111 times, 68 avg us
+xmms[16738] lock 0xbfe29ef0 contended 742 times, 91 avg us
+xmms[16738] lock 0xbfe29ed0 contended 107 times, 101 avg us
+xmms[16738] lock 0xbfe29ec0 contended 107 times, 74 avg us
+firefox-bin[21801] lock 0x096d16f4 contended 24 times, 12 avg us
+firefox-bin[21801] lock 0x096d1198 contended 2 times, 4 avg us
+firefox-bin[21801] lock 0x096d16f8 contended 150 times, 64997 avg us
+named[23869] lock 0x41ab0b84 contended 1 times, 131 avg us
+named[23869] lock 0x41ab0b50 contended 1 times, 26 avg us
diff --git a/examples/helloworld.stp b/examples/helloworld.stp
new file mode 100644
index 00000000..82e406af
--- /dev/null
+++ b/examples/helloworld.stp
@@ -0,0 +1 @@
+probe begin { log("hello world") exit () }
diff --git a/examples/iostat-scsi.stp b/examples/iostat-scsi.stp
new file mode 100644
index 00000000..2fb4acf1
--- /dev/null
+++ b/examples/iostat-scsi.stp
@@ -0,0 +1,51 @@
+global devices, reads, writes
+
+/* data collection: SCSI disk */
+probe module("sd_mod").function("sd_init_command") {
+ device=kernel_string($SCpnt->request->rq_disk->disk_name)
+ sector_size=$SCpnt->device->sector_size
+ nr_sectors=$SCpnt->request->nr_sectors
+ devices[device] = 1
+ if ($SCpnt->request->flags /* cmd_flags on some kernels */ & 1)
+ writes[device] <<< nr_sectors * sector_size
+ else
+ reads[device] <<< nr_sectors * sector_size
+}
+/* data collection: SCSI tape */
+probe module("st").function("st_do_scsi") {
+ device=kernel_string($STp->disk->disk_name)
+ devices[device] = 1
+ if ($direction)
+ writes[device] <<< $bytes
+ else
+ reads[device] <<< $bytes
+}
+
+
+/* reporting */
+global blksize=512
+global hdrcount
+probe timer.s($1) {
+ if ((hdrcount++ % 10) == 0)
+ printf("%9s %9s %9s %9s %9s %9s\n",
+ "Device:","tps","blk_read/s","blk_wrtn/s","blk_read","blk_wrtn")
+
+ foreach (dev in devices) {
+ rdcount=@count(reads[dev])
+ wrcount=@count(writes[dev])
+ tps=(rdcount+wrcount)*100/$1
+ rdblkcount=rdcount ? @sum(reads[dev])/blksize : 0
+ wrblkcount=wrcount ? @sum(writes[dev])/blksize : 0
+ rdblkrate=rdblkcount*100/$1
+ wrblkrate=wrblkcount*100/$1
+ printf("%9s %6d.%02d %6d.%02d %6d.%02d %9d %9d\n",
+ dev, tps/100,tps%100,
+ rdblkrate/100,rdblkrate%100,
+ wrblkrate/100,wrblkrate%100,
+ rdblkcount, wrblkcount)
+ }
+ printf ("\n")
+ delete devices
+ delete reads
+ delete writes
+}
diff --git a/examples/iostat-scsi.txt b/examples/iostat-scsi.txt
new file mode 100644
index 00000000..81157b1d
--- /dev/null
+++ b/examples/iostat-scsi.txt
@@ -0,0 +1,14 @@
+From: http://sourceware.org/systemtap/wiki/WSiostatSCSI
+
+# stap iostat-scsi.stp 10 # seconds between reports
+ Device: tps blk_read/s blk_wrtn/s blk_read blk_wrtn
+ sda 1.30 2.40 105.60 24 1056
+
+ sda 0.30 0.00 4.00 0 40
+
+ sda 21.30 1.60 428.80 16 4288
+
+ sda 30.40 2820.80 11.60 28208 116
+
+ sda 38.10 2816.80 53.60 28168 536
+^C
diff --git a/examples/nettop.stp b/examples/nettop.stp
new file mode 100644
index 00000000..4004a03d
--- /dev/null
+++ b/examples/nettop.stp
@@ -0,0 +1,53 @@
+global ifxmit, ifrecv, ifdevs, ifpid, execname, user
+
+probe netdev.transmit
+{
+ p = pid()
+ execname[p] = execname()
+ user[p] = uid()
+ ifdevs[p, dev_name] = dev_name
+ ifxmit[p, dev_name] <<< length
+ ifpid[p, dev_name] ++
+}
+
+probe netdev.receive
+{
+ p = pid()
+ execname[p] = execname()
+ user[p] = uid()
+ ifdevs[p, dev_name] = dev_name
+ ifrecv[p, dev_name] <<< length
+ ifpid[p, dev_name] ++
+}
+
+
+function print_activity()
+{
+ printf("%5s %5s %-7s %7s %7s %7s %7s %-15s\n",
+ "PID", "UID", "DEV", "XMIT_PK", "RECV_PK",
+ "XMIT_KB", "RECV_KB", "COMMAND")
+
+ foreach ([pid, dev] in ifpid-) {
+ n_xmit = @count(ifxmit[pid, dev])
+ n_recv = @count(ifrecv[pid, dev])
+ printf("%5d %5d %-7s %7d %7d %7d %7d %-15s\n",
+ pid, user[pid], dev, n_xmit, n_recv,
+ n_xmit ? @sum(ifxmit[pid, dev])/1024 : 0,
+ n_recv ? @sum(ifrecv[pid, dev])/1024 : 0,
+ execname[pid])
+ }
+
+ print("\n")
+
+ delete execname
+ delete user
+ delete ifdevs
+ delete ifxmit
+ delete ifrecv
+ delete ifpid
+}
+
+probe timer.ms(5000)
+{
+ print_activity()
+}
diff --git a/examples/nettop.txt b/examples/nettop.txt
new file mode 100644
index 00000000..2bfd4967
--- /dev/null
+++ b/examples/nettop.txt
@@ -0,0 +1,20 @@
+From: http://sourceware.org/systemtap/wiki/WSNetTop
+
+# stap nettop.stp
+ PID UID DEV XMIT_PK RECV_PK XMIT_KB RECV_KB COMMAND
+ 0 0 eth0 66 344 18 19 swapper
+ 2469 0 eth0 214 39 167 1 Xvnc
+23470 0 eth0 24 35 5 1 firefox-bin
+ 2281 0 eth0 1 1 0 0 wcstatusd
+22446 0 eth0 1 0 1 0 sshd
+ 2538 0 eth0 0 1 0 0 metacity
+23557 0 eth0 0 1 0 0 sh
+23559 0 eth0 0 1 0 0 lspci
+23566 0 eth0 0 1 0 0 sh
+
+ PID UID DEV XMIT_PK RECV_PK XMIT_KB RECV_KB COMMAND
+ 0 0 eth0 14 80 0 3 swapper
+ 2469 0 eth0 32 2 20 0 Xvnc
+22446 0 eth0 1 0 0 0 sshd
+ 2052 38 eth0 1 0 0 0 ntpd
+
diff --git a/examples/pf2.stp b/examples/pf2.stp
new file mode 100644
index 00000000..dce2cdec
--- /dev/null
+++ b/examples/pf2.stp
@@ -0,0 +1,15 @@
+#! stap
+global profile, pcount
+probe timer.profile {
+ pcount ++
+ fn = probefunc ()
+ if (fn != "") profile[fn] ++ # <<< 1 would be better ...
+}
+probe timer.ms(4000) {
+ printf ("\n--- %d samples recorded:\n", pcount)
+ foreach (f in profile- limit 10) { # ... but can only sort scalar arrays (bz #2305)
+ printf ("%s\t%d\n", f, profile[f])
+ }
+ delete profile
+ pcount = 0
+}
diff --git a/examples/pf2.txt b/examples/pf2.txt
new file mode 100644
index 00000000..0fafe17e
--- /dev/null
+++ b/examples/pf2.txt
@@ -0,0 +1,21 @@
+From: http://sourceware.org/systemtap/wiki/WSKernelProfile
+
+# stap pf2.stp
+
+--- 109 samples recorded:
+mwait_idle 71
+check_poison_obj 4
+_spin_unlock_irqrestore 2
+dbg_redzone1 1
+kfree 1
+kmem_cache_free 1
+_spin_unlock_irq 1
+end_buffer_write_sync 1
+lock_acquire 1
+
+--- 108 samples recorded:
+mwait_idle 91
+check_poison_obj 3
+_spin_unlock_irq 2
+delay_tsc 1
+