summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2008-08-08 15:15:19 -0400
committerDave Brolley <brolley@redhat.com>2008-08-08 15:15:19 -0400
commit71906647386a9684086b0542318b536d95ae089c (patch)
treefb0348d7bb34095e95ad830da8e832bad9187a55
parentd5658775da9fa0ac792eb3f874df9f7c4d60de7e (diff)
parentf1118e1032612170cae8cd979cd529722ad95fdb (diff)
downloadsystemtap-steved-71906647386a9684086b0542318b536d95ae089c.tar.gz
systemtap-steved-71906647386a9684086b0542318b536d95ae089c.tar.xz
systemtap-steved-71906647386a9684086b0542318b536d95ae089c.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Conflicts: ChangeLog testsuite/ChangeLog
-rw-r--r--ChangeLog78
-rw-r--r--Makefile.am46
-rw-r--r--Makefile.in71
-rw-r--r--NEWS3
-rw-r--r--aclocal.m438
-rw-r--r--doc/Makefile.in4
-rw-r--r--runtime/ChangeLog14
-rw-r--r--runtime/task_finder.c108
-rw-r--r--runtime/task_finder_vma.c132
-rwxr-xr-xstap-find-servers4
-rwxr-xr-xstap-serverd10
-rw-r--r--staprun.8.in6
-rw-r--r--systemtap.spec10
-rw-r--r--tapsets.cxx9
-rw-r--r--testsuite/ChangeLog20
-rw-r--r--testsuite/Makefile.am9
-rw-r--r--testsuite/lib/stap_compile.exp1
-rw-r--r--testsuite/systemtap.base/cache.exp1
-rw-r--r--testsuite/systemtap.base/itrace.exp (renamed from systemtap.base/itrace.exp)8
-rw-r--r--testsuite/systemtap.base/stmt_rel.stp4
-rw-r--r--testsuite/systemtap.base/utrace_p4.exp41
-rw-r--r--testsuite/systemtap.base/vars.exp32
-rw-r--r--testsuite/systemtap.base/warnings.stp2
-rw-r--r--testsuite/systemtap.examples/ChangeLog51
-rw-r--r--testsuite/systemtap.examples/README52
-rw-r--r--testsuite/systemtap.examples/examples-index-gen.pl318
-rwxr-xr-xtestsuite/systemtap.examples/general/ansi_colors.stp (renamed from testsuite/systemtap.examples/small_demos/ansi_colors.stp)0
-rw-r--r--testsuite/systemtap.examples/general/click.wav (renamed from testsuite/systemtap.examples/small_demos/click.wav)bin1290 -> 1290 bytes
-rw-r--r--testsuite/systemtap.examples/general/graphs.meta (renamed from testsuite/systemtap.examples/graphs.meta)0
-rw-r--r--testsuite/systemtap.examples/general/graphs.stp (renamed from testsuite/systemtap.examples/graphs.stp)0
-rw-r--r--testsuite/systemtap.examples/general/helloworld.meta (renamed from testsuite/systemtap.examples/helloworld.meta)0
-rwxr-xr-xtestsuite/systemtap.examples/general/helloworld.stp (renamed from testsuite/systemtap.examples/helloworld.stp)0
-rwxr-xr-xtestsuite/systemtap.examples/general/key.stp (renamed from testsuite/systemtap.examples/small_demos/key.stp)0
-rwxr-xr-xtestsuite/systemtap.examples/general/keyhack.stp (renamed from testsuite/systemtap.examples/small_demos/keyhack.stp)0
-rw-r--r--testsuite/systemtap.examples/general/para-callgraph.meta (renamed from testsuite/systemtap.examples/para-callgraph.meta)0
-rw-r--r--testsuite/systemtap.examples/general/para-callgraph.stp (renamed from testsuite/systemtap.examples/para-callgraph.stp)0
-rw-r--r--testsuite/systemtap.examples/general/return.wav (renamed from testsuite/systemtap.examples/small_demos/return.wav)bin6584 -> 6584 bytes
-rw-r--r--testsuite/systemtap.examples/html/html_footer.tmpl14
-rw-r--r--testsuite/systemtap.examples/html/html_header.tmpl41
-rw-r--r--testsuite/systemtap.examples/html/systemtap.css164
-rw-r--r--testsuite/systemtap.examples/html/systemtapcorner.gifbin0 -> 970 bytes
-rw-r--r--testsuite/systemtap.examples/html/systemtaplogo.pngbin0 -> 1860 bytes
-rw-r--r--testsuite/systemtap.examples/index.html130
-rw-r--r--testsuite/systemtap.examples/index.txt214
-rw-r--r--testsuite/systemtap.examples/io/disktop.meta (renamed from testsuite/systemtap.examples/disktop.meta)0
-rw-r--r--testsuite/systemtap.examples/io/disktop.stp (renamed from testsuite/systemtap.examples/disktop.stp)0
-rw-r--r--testsuite/systemtap.examples/io/io_submit.meta (renamed from testsuite/systemtap.examples/io_submit.meta)0
-rw-r--r--testsuite/systemtap.examples/io/io_submit.stp (renamed from testsuite/systemtap.examples/io_submit.stp)0
-rwxr-xr-xtestsuite/systemtap.examples/io/iostat-scsi.stp (renamed from testsuite/systemtap.examples/iostat-scsi.stp)0
-rw-r--r--testsuite/systemtap.examples/io/iostat-scsi.txt (renamed from testsuite/systemtap.examples/iostat-scsi.txt)0
-rw-r--r--testsuite/systemtap.examples/io/iotime.meta (renamed from testsuite/systemtap.examples/iotime.meta)0
-rwxr-xr-xtestsuite/systemtap.examples/io/iotime.stp (renamed from testsuite/systemtap.examples/iotime.stp)0
-rw-r--r--testsuite/systemtap.examples/io/iotop.meta (renamed from testsuite/systemtap.examples/iotop.meta)0
-rw-r--r--testsuite/systemtap.examples/io/iotop.stp (renamed from testsuite/systemtap.examples/iotop.stp)0
-rw-r--r--testsuite/systemtap.examples/io/traceio.meta (renamed from testsuite/systemtap.examples/traceio.meta)0
-rw-r--r--testsuite/systemtap.examples/io/traceio.stp (renamed from testsuite/systemtap.examples/traceio.stp)0
-rw-r--r--testsuite/systemtap.examples/io/traceio2.meta (renamed from testsuite/systemtap.examples/traceio2.meta)0
-rw-r--r--testsuite/systemtap.examples/io/traceio2.stp (renamed from testsuite/systemtap.examples/traceio2.stp)0
-rw-r--r--testsuite/systemtap.examples/keyword-index.html258
-rw-r--r--testsuite/systemtap.examples/keyword-index.txt458
-rw-r--r--testsuite/systemtap.examples/network/nettop.meta (renamed from testsuite/systemtap.examples/nettop.meta)0
-rwxr-xr-xtestsuite/systemtap.examples/network/nettop.stp (renamed from testsuite/systemtap.examples/nettop.stp)0
-rw-r--r--testsuite/systemtap.examples/network/nettop.txt (renamed from testsuite/systemtap.examples/nettop.txt)0
-rw-r--r--testsuite/systemtap.examples/network/socket-trace.meta (renamed from testsuite/systemtap.examples/socket-trace.meta)0
-rwxr-xr-xtestsuite/systemtap.examples/network/socket-trace.stp (renamed from testsuite/systemtap.examples/socket-trace.stp)0
-rwxr-xr-xtestsuite/systemtap.examples/network/socktop (renamed from testsuite/systemtap.examples/socktop)0
-rw-r--r--testsuite/systemtap.examples/network/socktop.txt (renamed from testsuite/systemtap.examples/socktop.txt)0
-rw-r--r--testsuite/systemtap.examples/process/futexes.meta (renamed from testsuite/systemtap.examples/futexes.meta)2
-rwxr-xr-xtestsuite/systemtap.examples/process/futexes.stp (renamed from testsuite/systemtap.examples/futexes.stp)0
-rw-r--r--testsuite/systemtap.examples/process/futexes.txt (renamed from testsuite/systemtap.examples/futexes.txt)0
-rw-r--r--testsuite/systemtap.examples/process/pf2.meta (renamed from testsuite/systemtap.examples/pf2.meta)0
-rwxr-xr-xtestsuite/systemtap.examples/process/pf2.stp (renamed from testsuite/systemtap.examples/pf2.stp)0
-rw-r--r--testsuite/systemtap.examples/process/pf2.txt (renamed from testsuite/systemtap.examples/pf2.txt)0
-rwxr-xr-xtestsuite/systemtap.examples/process/proc_snoop.stp (renamed from testsuite/systemtap.examples/small_demos/proc_snoop.stp)0
-rw-r--r--testsuite/systemtap.examples/process/sig_by_pid.meta (renamed from testsuite/systemtap.examples/sig_by_pid.meta)0
-rwxr-xr-xtestsuite/systemtap.examples/process/sig_by_pid.stp (renamed from testsuite/systemtap.examples/sig_by_pid.stp)0
-rw-r--r--testsuite/systemtap.examples/process/sig_by_pid.txt (renamed from testsuite/systemtap.examples/sig_by_pid.txt)0
-rw-r--r--testsuite/systemtap.examples/process/sig_by_proc.meta (renamed from testsuite/systemtap.examples/sig_by_proc.meta)0
-rwxr-xr-xtestsuite/systemtap.examples/process/sig_by_proc.stp (renamed from testsuite/systemtap.examples/sig_by_proc.stp)0
-rw-r--r--testsuite/systemtap.examples/process/sig_by_proc.txt (renamed from testsuite/systemtap.examples/sig_by_proc.txt)0
-rw-r--r--testsuite/systemtap.examples/process/sigkill.meta (renamed from testsuite/systemtap.examples/sigkill.meta)0
-rw-r--r--testsuite/systemtap.examples/process/sigkill.stp (renamed from testsuite/systemtap.examples/sigkill.stp)0
-rw-r--r--testsuite/systemtap.examples/process/sigmon.meta (renamed from testsuite/systemtap.examples/sigmon.meta)0
-rwxr-xr-xtestsuite/systemtap.examples/process/sigmon.stp (renamed from testsuite/systemtap.examples/sigmon.stp)0
-rw-r--r--testsuite/systemtap.examples/process/sleepingBeauties.meta (renamed from testsuite/systemtap.examples/sleepingBeauties.meta)0
-rw-r--r--testsuite/systemtap.examples/process/sleepingBeauties.stp (renamed from testsuite/systemtap.examples/sleepingBeauties.stp)0
-rw-r--r--testsuite/systemtap.examples/process/sleeptime.meta (renamed from testsuite/systemtap.examples/sleeptime.meta)0
-rwxr-xr-xtestsuite/systemtap.examples/process/sleeptime.stp (renamed from testsuite/systemtap.examples/sleeptime.stp)0
-rw-r--r--testsuite/systemtap.examples/process/syscalls_by_pid.meta (renamed from testsuite/systemtap.examples/syscalls_by_pid.meta)0
-rwxr-xr-xtestsuite/systemtap.examples/process/syscalls_by_pid.stp (renamed from testsuite/systemtap.examples/syscalls_by_pid.stp)0
-rw-r--r--testsuite/systemtap.examples/process/syscalls_by_pid.txt (renamed from testsuite/systemtap.examples/syscalls_by_pid.txt)0
-rw-r--r--testsuite/systemtap.examples/process/syscalls_by_proc.meta (renamed from testsuite/systemtap.examples/syscalls_by_proc.meta)0
-rwxr-xr-xtestsuite/systemtap.examples/process/syscalls_by_proc.stp (renamed from testsuite/systemtap.examples/syscalls_by_proc.stp)0
-rw-r--r--testsuite/systemtap.examples/process/syscalls_by_proc.txt (renamed from testsuite/systemtap.examples/syscalls_by_proc.txt)0
-rwxr-xr-xtestsuite/systemtap.examples/process/syscalltimes (renamed from testsuite/systemtap.examples/syscalltimes)0
-rw-r--r--testsuite/systemtap.examples/process/syscalltimes.txt (renamed from testsuite/systemtap.examples/syscalltimes.txt)0
-rw-r--r--testsuite/systemtap.examples/process/wait4time.meta (renamed from testsuite/systemtap.examples/wait4time.meta)0
-rwxr-xr-xtestsuite/systemtap.examples/process/wait4time.stp (renamed from testsuite/systemtap.examples/wait4time.stp)0
-rw-r--r--testsuite/systemtap.examples/profiling/functioncallcount.meta (renamed from testsuite/systemtap.examples/functioncallcount.meta)0
-rw-r--r--testsuite/systemtap.examples/profiling/functioncallcount.stp (renamed from testsuite/systemtap.examples/functioncallcount.stp)0
-rw-r--r--testsuite/systemtap.examples/profiling/thread-times.meta (renamed from testsuite/systemtap.examples/thread-times.meta)0
-rw-r--r--testsuite/systemtap.examples/profiling/thread-times.stp (renamed from testsuite/systemtap.examples/thread-times.stp)0
-rwxr-xr-xtestsuite/systemtap.examples/small_demos/close.stp14
-rw-r--r--testsuite/systemtap.examples/small_demos/demo_script.txt102
-rwxr-xr-xtestsuite/systemtap.examples/small_demos/fileopen.stp24
-rwxr-xr-xtestsuite/systemtap.examples/small_demos/kmalloc.stp22
-rwxr-xr-xtestsuite/systemtap.examples/small_demos/kmalloc2.stp26
-rwxr-xr-xtestsuite/systemtap.examples/small_demos/prof.stp35
-rwxr-xr-xtestsuite/systemtap.examples/small_demos/rwtiming.stp74
-rwxr-xr-xtestsuite/systemtap.examples/small_demos/sched_snoop.stp35
-rwxr-xr-xtestsuite/systemtap.examples/small_demos/sys.stp17
-rwxr-xr-xtestsuite/systemtap.examples/small_demos/top.stp24
-rw-r--r--testsuite/systemtap.examples/subsystem-index.html162
-rw-r--r--testsuite/systemtap.examples/subsystem-index.txt242
114 files changed, 2567 insertions, 563 deletions
diff --git a/ChangeLog b/ChangeLog
index 398ccdb1..8416469d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -32,6 +32,84 @@
testsuite/lib/systemtap.exp.
* Makefile.in: Regenerated.
+2008-08-08 David Smith <dsmith@redhat.com>
+
+ * tapsets.cxx (utrace_derived_probe_group::emit_module_decls):
+ Calls stap_utrace_detach() to perform detach.
+
+2008-08-08 Mark Wielaard <mwielaard@redhat.com>
+
+ * Makefile.am (EXAMPLE_BUILD_DIR): Removed. Examples indexes are
+ always in srcdir.
+ (dist-hook): Always install examples from srcdir.
+ * Makefile.in: Regenerated.
+
+2008-08-08 Mark Wielaard <mwielaard@redhat.com>
+
+ * Makefile.am (rpm): Refer to srcdir spec file so make rpm works in
+ builddir.
+ * Makefile.in: Regenerated.
+
+2008-08-08 Mark Wielaard <mwielaard@redhat.com>
+
+ * systemtap.spec: Disable chmodding of samples/kmalloc-top.
+ It is currently not installed.
+
+2008-08-08 Mark Wielaard <mwielaard@redhat.com>
+
+ * Makefile.am (all-local): Depend on example_index, which now
+ doesn't generate anything in $srcdir anymore, only $builddir.
+ (EXAMPLE_SOURCE_DIR): New var.
+ (EXAMPLE_BUILD_DIR): New var.
+ (EXAMPLE_META_FILES): New var.
+ (EXAMPLE_INDEX_GEN): New var.
+ (example_index): New target.
+ ($EXAMPLE_BUILD_DIR/index.html): Likewise.
+ (install-data-local): Install examples from $buildir.
+ * Makefile.in: Regenerated.
+ * aclocal.m4: Likewise.
+
+2008-08-07 Frank Ch. Eigler <fche@elastic.org>
+
+ * Makefile.am (all-local): Don't run indexing code, since $srcdir
+ may be read-only.
+ (install-data): Simplify sample script installation; limit sources
+ to systemtap.examples directory only.
+ * Makefile.in: Regenerated.
+
+2008-08-07 Mark Wielaard <mwielaard@redhat.com>
+
+ * Makefile.am (all-local): Add example_index.
+ (dist-hook): Likewise.
+ (EXAMPLE_SRC): Add index and support files.
+ (EXAMPLE_INDEXES): New file list.
+ (example_index): New target.
+ (clean-local): Remove generated indexes.
+ * Makefile.in: Regenerated.
+
+2008-08-07 Mark Wielaard <mwielaard@redhat.com>
+
+ * systemtap.spec: Add comment about versioned vs unversioned docs.
+
+2008-08-06 Frank Ch. Eigler <fche@elastic.org>
+
+ * stap-find-servers (match_server, client_sysinfo):
+ Use "sysinfo=...." keyword in mdns TXT record.
+ * stap-serverd (advertise_presence): Ditto.
+ (initialization): Locate random usable server port if needed.
+ (listen): Complain if port turns out to be unusable after all.
+
+2008-08-06 Josh Stone <joshua.i.stone@intel.com>
+
+ PR 6820
+ From Eugeniy Meshcheryakov eugen@debian.org:
+ * staprun.8.in: fix minor formatting problems
+
+2008-08-05 Stan Cox <scox@redhat.com>
+
+ * NEWS: Updated $$vars, $$parms, $$locals.
+ * tapsets.cxx (visit_target_symbol): Missing break typo.
+
2008-08-04 Stan Cox <scox@redhat.com>
* tapsets.cxx (dwarf_var_expanding_copy_visitor::visit_target_symbol):
diff --git a/Makefile.am b/Makefile.am
index f2a5a7b9..1909e0fd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -140,10 +140,12 @@ STAPLOG=staplog.so
$(STAPLOG): staplog.c
$(CC) $(staplog_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -shared -rdynamic \
$(AM_LDFLAGS) $(LDFLAGS) -fPIC -o $@ $<
-all-local: $(STAPLOG)
+all-local: $(STAPLOG) example_index
install-exec-local: $(STAPLOG)
$(MKDIR_P) $(DESTDIR)$(pkglibdir)
$(INSTALL) $(STAPLOG) $(DESTDIR)$(pkglibdir)
+else
+all-local: example_index
endif
# Get extra libs as needed
@@ -159,30 +161,13 @@ EXTRA_DIST = auto_free.h buildrun.h elaborate.h loc2c.h session.h \
systemtap.spec
EXAMPLE_SOURCE_DIR = $(srcdir)/testsuite/systemtap.examples
-EXAMPLE_INSTALL_DIR = $(DESTDIR)$(datadir)/doc/systemtap/examples
-DEMO_SOURCE_DIR = $(srcdir)/testsuite/systemtap.examples/small_demos
-DEMO_INSTALL_DIR = $(DESTDIR)$(datadir)/doc/systemtap/examples/small_demos
-SAMPLE_SOURCE_DIR = $(srcdir)/testsuite/systemtap.samples
-SAMPLE_INSTALL_DIR = $(EXAMPLE_INSTALL_DIR)/samples
-
-EXAMPLE_SRC = $(EXAMPLE_SOURCE_DIR)/ChangeLog \
- $(EXAMPLE_SOURCE_DIR)/README \
- $(EXAMPLE_SOURCE_DIR)/*.stp \
- $(EXAMPLE_SOURCE_DIR)/*.txt \
- $(EXAMPLE_SOURCE_DIR)/*.meta
-
-DEMO_SRC = \
- $(EXAMPLE_SOURCE_DIR)/small_demos/*.stp \
- $(EXAMPLE_SOURCE_DIR)/small_demos/*.txt \
- $(EXAMPLE_SOURCE_DIR)/small_demos/*.wav
-
-SAMPLE_SRC = $(SAMPLE_SOURCE_DIR)/iotask.stp \
- $(SAMPLE_SOURCE_DIR)/kmalloc-stacks.stp \
- $(SAMPLE_SOURCE_DIR)/kmalloc-top \
- $(SAMPLE_SOURCE_DIR)/pfaults.stp \
- $(SAMPLE_SOURCE_DIR)/profile.stp \
- $(SAMPLE_SOURCE_DIR)/tcp_connections.stp \
- $(SAMPLE_SOURCE_DIR)/topsys.stp
+EXAMPLE_META_FILES = $(EXAMPLE_SOURCE_DIR)/*/*.meta
+EXAMPLE_INDEX_GEN = $(EXAMPLE_SOURCE_DIR)/examples-index-gen.pl
+
+example_index: $(EXAMPLE_SOURCE_DIR)/index.html
+
+$(EXAMPLE_SOURCE_DIR)/index.html: $(EXAMPLE_META_FILES) $(EXAMPLE_INDEX_GEN)
+ perl $(EXAMPLE_INDEX_GEN) $(EXAMPLE_SOURCE_DIR)
dist-hook: dist-gitversion
find $(distdir) -name CVS -o -name '*~' -o -name '.#*' | xargs rm -rf
@@ -199,12 +184,9 @@ install-data-local:
do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/uprobes/$$f; done)
(cd $(srcdir)/tapset; find . \( -name '*.stp' -o -name README \) -print \
| while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/tapset/$$f; done)
- $(MKDIR_P) $(EXAMPLE_INSTALL_DIR)
- $(INSTALL_DATA) $(EXAMPLE_SRC) $(EXAMPLE_INSTALL_DIR)
- $(MKDIR_P) $(DEMO_INSTALL_DIR)
- $(INSTALL_DATA) $(DEMO_SRC) $(DEMO_INSTALL_DIR)
- $(MKDIR_P) $(SAMPLE_INSTALL_DIR)
- $(INSTALL_DATA) $(SAMPLE_SRC) $(SAMPLE_INSTALL_DIR)
+ (cd $(srcdir)/testsuite/systemtap.examples; find . -type f -print \
+ | egrep -v 'check.exp|ChangeLog|examples-index-gen.pl' \
+ | while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(docdir)/examples/$$f; done)
TEST_COV_DIR = coverage
@@ -264,4 +246,4 @@ installcheck:
$(MAKE) -C testsuite installcheck RUNTESTFLAGS="$(RUNTESTFLAGS)" EXTRA_SYSTEMTAP_PATH="$(EXTRA_SYSTEMTAP_PATH)"
rpm: systemtap.spec dist
- rpmbuild --define "_sourcedir $(PWD)/" -ba systemtap.spec
+ rpmbuild --define "_sourcedir $(PWD)/" -ba $(srcdir)/systemtap.spec
diff --git a/Makefile.in b/Makefile.in
index 745205a9..42d2afb9 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -338,30 +338,8 @@ EXTRA_DIST = auto_free.h buildrun.h elaborate.h loc2c.h session.h \
systemtap.spec
EXAMPLE_SOURCE_DIR = $(srcdir)/testsuite/systemtap.examples
-EXAMPLE_INSTALL_DIR = $(DESTDIR)$(datadir)/doc/systemtap/examples
-DEMO_SOURCE_DIR = $(srcdir)/testsuite/systemtap.examples/small_demos
-DEMO_INSTALL_DIR = $(DESTDIR)$(datadir)/doc/systemtap/examples/small_demos
-SAMPLE_SOURCE_DIR = $(srcdir)/testsuite/systemtap.samples
-SAMPLE_INSTALL_DIR = $(EXAMPLE_INSTALL_DIR)/samples
-EXAMPLE_SRC = $(EXAMPLE_SOURCE_DIR)/ChangeLog \
- $(EXAMPLE_SOURCE_DIR)/README \
- $(EXAMPLE_SOURCE_DIR)/*.stp \
- $(EXAMPLE_SOURCE_DIR)/*.txt \
- $(EXAMPLE_SOURCE_DIR)/*.meta
-
-DEMO_SRC = \
- $(EXAMPLE_SOURCE_DIR)/small_demos/*.stp \
- $(EXAMPLE_SOURCE_DIR)/small_demos/*.txt \
- $(EXAMPLE_SOURCE_DIR)/small_demos/*.wav
-
-SAMPLE_SRC = $(SAMPLE_SOURCE_DIR)/iotask.stp \
- $(SAMPLE_SOURCE_DIR)/kmalloc-stacks.stp \
- $(SAMPLE_SOURCE_DIR)/kmalloc-top \
- $(SAMPLE_SOURCE_DIR)/pfaults.stp \
- $(SAMPLE_SOURCE_DIR)/profile.stp \
- $(SAMPLE_SOURCE_DIR)/tcp_connections.stp \
- $(SAMPLE_SOURCE_DIR)/topsys.stp
-
+EXAMPLE_META_FILES = $(EXAMPLE_SOURCE_DIR)/*/*.meta
+EXAMPLE_INDEX_GEN = $(EXAMPLE_SOURCE_DIR)/examples-index-gen.pl
TEST_COV_DIR = coverage
# XXX: leaves behind man pages
SUBDIRS = testsuite doc
@@ -1187,8 +1165,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -1213,8 +1191,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -1224,13 +1202,12 @@ ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
- here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
@@ -1303,6 +1280,10 @@ dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
@@ -1330,6 +1311,8 @@ distcheck: dist
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
@@ -1391,7 +1374,6 @@ distcleancheck: distclean
check-am: all-am
check: $(BUILT_SOURCES)
$(MAKE) $(AM_MAKEFLAGS) check-recursive
-@BUILD_CRASHMOD_FALSE@all-local:
all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS) config.h all-local
installdirs: installdirs-recursive
installdirs-am:
@@ -1499,7 +1481,7 @@ uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8
clean-binPROGRAMS clean-generic clean-local \
clean-noinstPROGRAMS clean-pkglibexecPROGRAMS ctags \
ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-hook \
- dist-shar dist-tarZ dist-zip distcheck distclean \
+ dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \
distclean-compile distclean-generic distclean-hdr \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
@@ -1570,10 +1552,16 @@ install-exec-hook:
@BUILD_CRASHMOD_TRUE@$(STAPLOG): staplog.c
@BUILD_CRASHMOD_TRUE@ $(CC) $(staplog_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -shared -rdynamic \
@BUILD_CRASHMOD_TRUE@ $(AM_LDFLAGS) $(LDFLAGS) -fPIC -o $@ $<
-@BUILD_CRASHMOD_TRUE@all-local: $(STAPLOG)
+@BUILD_CRASHMOD_TRUE@all-local: $(STAPLOG) example_index
@BUILD_CRASHMOD_TRUE@install-exec-local: $(STAPLOG)
@BUILD_CRASHMOD_TRUE@ $(MKDIR_P) $(DESTDIR)$(pkglibdir)
@BUILD_CRASHMOD_TRUE@ $(INSTALL) $(STAPLOG) $(DESTDIR)$(pkglibdir)
+@BUILD_CRASHMOD_FALSE@all-local: example_index
+
+example_index: $(EXAMPLE_SOURCE_DIR)/index.html
+
+$(EXAMPLE_SOURCE_DIR)/index.html: $(EXAMPLE_META_FILES) $(EXAMPLE_INDEX_GEN)
+ perl $(EXAMPLE_INDEX_GEN) $(EXAMPLE_SOURCE_DIR)
dist-hook: dist-gitversion
find $(distdir) -name CVS -o -name '*~' -o -name '.#*' | xargs rm -rf
@@ -1590,12 +1578,9 @@ install-data-local:
do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/runtime/uprobes/$$f; done)
(cd $(srcdir)/tapset; find . \( -name '*.stp' -o -name README \) -print \
| while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(pkgdatadir)/tapset/$$f; done)
- $(MKDIR_P) $(EXAMPLE_INSTALL_DIR)
- $(INSTALL_DATA) $(EXAMPLE_SRC) $(EXAMPLE_INSTALL_DIR)
- $(MKDIR_P) $(DEMO_INSTALL_DIR)
- $(INSTALL_DATA) $(DEMO_SRC) $(DEMO_INSTALL_DIR)
- $(MKDIR_P) $(SAMPLE_INSTALL_DIR)
- $(INSTALL_DATA) $(SAMPLE_SRC) $(SAMPLE_INSTALL_DIR)
+ (cd $(srcdir)/testsuite/systemtap.examples; find . -type f -print \
+ | egrep -v 'check.exp|ChangeLog|examples-index-gen.pl' \
+ | while read f; do $(INSTALL_DATA) -D $$f $(DESTDIR)$(docdir)/examples/$$f; done)
gcov:
@-$(MAKE) clean CXXFLAGS="-g -fprofile-arcs -ftest-coverage" all check
@@ -1650,7 +1635,7 @@ installcheck:
$(MAKE) -C testsuite installcheck RUNTESTFLAGS="$(RUNTESTFLAGS)" EXTRA_SYSTEMTAP_PATH="$(EXTRA_SYSTEMTAP_PATH)"
rpm: systemtap.spec dist
- rpmbuild --define "_sourcedir $(PWD)/" -ba systemtap.spec
+ rpmbuild --define "_sourcedir $(PWD)/" -ba $(srcdir)/systemtap.spec
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/NEWS b/NEWS
index 65af9271..0cdc2aa3 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
* What's new
+- A formatted string representation of the variables, parameters, or local
+ variables at a probe point is now supported via the special $$vars,
+ $$parms, and $$locals context variables.
* What's new in version 0.7
diff --git a/aclocal.m4 b/aclocal.m4
index 9d70920d..0e2027cd 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.10 -*- Autoconf -*-
+# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006 Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -11,12 +11,15 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-m4_if(m4_PACKAGE_VERSION, [2.61],,
-[m4_fatal([this file was generated for autoconf 2.61.
-You have another version of autoconf. If you want to use that,
-you should regenerate the build system entirely.], [63])])
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(AC_AUTOCONF_VERSION, [2.61],,
+[m4_warning([this file was generated for autoconf 2.61.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
-# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -31,7 +34,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.10'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.10], [],
+m4_if([$1], [1.10.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -47,8 +50,10 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.10])dnl
-_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
+[AM_AUTOMAKE_VERSION([1.10.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
@@ -343,7 +348,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
- if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
@@ -391,13 +396,13 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006 Free Software Foundation, Inc.
+# 2005, 2006, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 12
+# serial 13
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
@@ -502,16 +507,17 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC],
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
+_am_arg=$1
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
- $1 | $1:* )
+ $_am_arg | $_am_arg:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
-echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
@@ -872,7 +878,7 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
-# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 6464afc3..e01c5ebf 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/runtime/ChangeLog b/runtime/ChangeLog
index a8d73ffd..7dfade1c 100644
--- a/runtime/ChangeLog
+++ b/runtime/ChangeLog
@@ -1,3 +1,17 @@
+2008-08-08 David Smith <dsmith@redhat.com>
+
+ * task_finder.c (stap_utrace_detach): New function.
+ (stap_utrace_detach_ops): Calls stap_utrace_detach().
+ (__stp_utrace_attach_match_filename): Ditto.
+
+ * task_finder.c (__stp_tf_vm_cb): Added calls to save/delete vma
+ information.
+ * task_finder_vma.c (__stp_tf_vma_map_hash): New function.
+ (__stp_tf_get_vma_map_entry_internal): Ditto.
+ (stap_add_vma_map_info): Ditto.
+ (stap_remove_vma_map_info): Ditto.
+ (stap_find_vma_map_info): Ditto.
+
2008-07-24 Josh Stone <joshua.i.stone@intel.com>
* runtime/autoconf-module-nsections.c: removed
diff --git a/runtime/task_finder.c b/runtime/task_finder.c
index b22a60a8..1832c795 100644
--- a/runtime/task_finder.c
+++ b/runtime/task_finder.c
@@ -47,6 +47,15 @@ int __stp_tf_vm_cb(struct task_struct *tsk,
_stp_dbug(__FUNCTION__, __LINE__,
"vm_cb: tsk %d:%d path %s, start 0x%08lx, end 0x%08lx, offset 0x%lx\n",
tsk->pid, map_p, vm_path, vm_start, vm_end, vm_pgoff);
+ if (map_p) {
+ // FIXME: What should we do with vm_path? We can't save
+ // the vm_path pointer itself, but we don't have any
+ // storage space allocated to save it in...
+ stap_add_vma_map_info(tsk, vm_start, vm_end, vm_pgoff);
+ }
+ else {
+ stap_remove_vma_map_info(tsk, vm_start, vm_end, vm_pgoff);
+ }
return 0;
}
#endif
@@ -141,12 +150,72 @@ stap_register_task_finder_target(struct stap_task_finder_target *new_tgt)
return 0;
}
+static int
+stap_utrace_detach(struct task_struct *tsk,
+ const struct utrace_engine_ops *ops)
+{
+ struct utrace_attached_engine *engine;
+ struct mm_struct *mm;
+ int rc = 0;
+
+ // Ignore init
+ if (tsk == NULL || tsk->pid <= 1)
+ return 0;
+
+ // Notice we're not calling get_task_mm() here. Normally we
+ // avoid tasks with no mm, because those are kernel threads.
+ // So, why is this function different? When a thread is in
+ // the process of dying, its mm gets freed. Then, later the
+ // thread gets in the dying state and the thread's DEATH event
+ // handler gets called (if any).
+ //
+ // If a thread is in this "mortally wounded" state - no mm
+ // but not dead - and at that moment this function is called,
+ // we'd miss detaching from it if we were checking to see if
+ // it had an mm.
+
+ engine = utrace_attach(tsk, UTRACE_ATTACH_MATCH_OPS, ops, 0);
+ if (IS_ERR(engine)) {
+ rc = -PTR_ERR(engine);
+ if (rc != ENOENT) {
+ _stp_error("utrace_attach returned error %d on pid %d",
+ rc, tsk->pid);
+ }
+ else {
+ rc = 0;
+ }
+ }
+ else if (unlikely(engine == NULL)) {
+ _stp_error("utrace_attach returned NULL on pid %d",
+ (int)tsk->pid);
+ rc = EFAULT;
+ }
+ else {
+ rc = utrace_detach(tsk, engine);
+ switch (rc) {
+ case 0: /* success */
+ debug_task_finder_detach();
+ break;
+ case -ESRCH: /* REAP callback already begun */
+ case -EALREADY: /* DEATH callback already begun */
+ rc = 0; /* ignore these errors*/
+ break;
+ default:
+ rc = -rc;
+ _stp_error("utrace_detach returned error %d on pid %d",
+ rc, tsk->pid);
+ break;
+ }
+ }
+ return rc;
+}
+
static void
stap_utrace_detach_ops(struct utrace_engine_ops *ops)
{
struct task_struct *grp, *tsk;
struct utrace_attached_engine *engine;
- long error = 0;
+ int rc = 0;
pid_t pid = 0;
// Notice we're not calling get_task_mm() in this loop. In
@@ -164,31 +233,12 @@ stap_utrace_detach_ops(struct utrace_engine_ops *ops)
rcu_read_lock();
do_each_thread(grp, tsk) {
- if (tsk == NULL || tsk->pid <= 1)
- continue;
-
- engine = utrace_attach(tsk, UTRACE_ATTACH_MATCH_OPS,
- ops, 0);
- if (IS_ERR(engine)) {
- error = -PTR_ERR(engine);
- if (error != ENOENT) {
- pid = tsk->pid;
- goto udo_err;
- }
- error = 0;
- }
- else if (engine != NULL) {
- utrace_detach(tsk, engine);
- debug_task_finder_detach();
- }
+ rc = stap_utrace_detach(tsk, ops);
+ if (rc != 0)
+ goto udo_err;
} while_each_thread(grp, tsk);
udo_err:
rcu_read_unlock();
-
- if (error != 0) {
- _stp_error("utrace_attach returned error %d on pid %d",
- error, pid);
- }
debug_task_finder_report();
}
@@ -372,14 +422,10 @@ __stp_utrace_attach_match_filename(struct task_struct *tsk,
cb_tgt->engine_attached = 1;
}
else {
- struct utrace_attached_engine *engine;
- engine = utrace_attach(tsk,
- UTRACE_ATTACH_MATCH_OPS,
- &cb_tgt->ops, 0);
- if (! IS_ERR(engine) && engine != NULL) {
- utrace_detach(tsk, engine);
- debug_task_finder_detach();
- }
+ rc = stap_utrace_detach(tsk, &cb_tgt->ops);
+ if (rc != 0)
+ break;
+ cb_tgt->engine_attached = 0;
}
}
}
diff --git a/runtime/task_finder_vma.c b/runtime/task_finder_vma.c
index c0a018ab..9d43e36c 100644
--- a/runtime/task_finder_vma.c
+++ b/runtime/task_finder_vma.c
@@ -34,6 +34,8 @@ static struct hlist_head __stp_tf_vma_free_list[1];
static struct hlist_head __stp_tf_vma_table[__STP_TF_TABLE_SIZE];
+static struct hlist_head __stp_tf_vma_map[__STP_TF_TABLE_SIZE];
+
// __stp_tf_vma_initialize(): Initialize the free list. Grabs the
// mutex.
static void
@@ -171,3 +173,133 @@ __stp_tf_remove_vma_entry(struct __stp_tf_vma_entry *entry)
}
return 0;
}
+
+
+
+// __stp_tf_vma_map_hash(): Compute the vma map hash.
+static inline u32
+__stp_tf_vma_map_hash(struct task_struct *tsk)
+{
+ return (jhash_1word(tsk->pid, 0) & (__STP_TF_TABLE_SIZE - 1));
+}
+
+// Get vma_entry if the vma is present in the vma map hash table.
+// Returns NULL if not present. The __stp_tf_vma_mutex must be locked
+// before calling this function.
+static struct __stp_tf_vma_entry *
+__stp_tf_get_vma_map_entry_internal(struct task_struct *tsk,
+ unsigned long vm_start)
+{
+ struct hlist_head *head;
+ struct hlist_node *node;
+ struct __stp_tf_vma_entry *entry;
+
+ head = &__stp_tf_vma_map[__stp_tf_vma_map_hash(tsk)];
+ hlist_for_each_entry(entry, node, head, hlist) {
+ if (tsk->pid == entry->pid
+ && vm_start == entry->addr) {
+ mutex_unlock(&__stp_tf_vma_mutex);
+ return entry;
+ }
+ }
+ return NULL;
+}
+
+
+// Add the vma info to the vma map hash table.
+static int
+stap_add_vma_map_info(struct task_struct *tsk, unsigned long vm_start,
+ unsigned long vm_end, unsigned long vm_pgoff)
+{
+ struct hlist_head *head;
+ struct hlist_node *node;
+ struct __stp_tf_vma_entry *entry;
+
+ mutex_lock(&__stp_tf_vma_mutex);
+ entry = __stp_tf_get_vma_map_entry_internal(tsk, vm_start);
+ if (entry != NULL) {
+#if 0
+ printk(KERN_NOTICE
+ "vma (pid: %d, vm_start: 0x%lx) present?\n",
+ tsk->pid, entry->vm_start);
+#endif
+ mutex_unlock(&__stp_tf_vma_mutex);
+ return -EBUSY; /* Already there */
+ }
+
+ // Get an element from the free list.
+ entry = __stp_tf_vma_get_free_entry();
+ if (!entry) {
+ mutex_unlock(&__stp_tf_vma_mutex);
+ return -ENOMEM;
+ }
+
+ // Fill in the info
+ entry->pid = tsk->pid;
+ //entry->addr = addr; ???
+ entry->vm_start = vm_start;
+ entry->vm_end = vm_end;
+ entry->vm_pgoff = vm_pgoff;
+
+ head = &__stp_tf_vma_map[__stp_tf_vma_map_hash(tsk)];
+ hlist_add_head(&entry->hlist, head);
+ mutex_unlock(&__stp_tf_vma_mutex);
+ return 0;
+}
+
+
+// Remove the vma entry from the vma hash table.
+static int
+stap_remove_vma_map_info(struct task_struct *tsk, unsigned long vm_start,
+ unsigned long vm_end, unsigned long vm_pgoff)
+{
+ struct hlist_head *head;
+ struct hlist_node *node;
+ struct __stp_tf_vma_entry *entry;
+
+ mutex_lock(&__stp_tf_vma_mutex);
+ entry = __stp_tf_get_vma_map_entry_internal(tsk, vm_start);
+ if (entry != NULL) {
+ hlist_del(&entry->hlist);
+ __stp_tf_vma_put_free_entry(entry);
+ }
+ mutex_unlock(&__stp_tf_vma_mutex);
+ return 0;
+}
+
+// Finds vma info if the vma is present in the vma map hash table.
+// Returns ESRCH if not present. The __stp_tf_vma_mutex must *not* be
+// locked before calling this function.
+static int
+stap_find_vma_map_info(struct task_struct *tsk, unsigned long vm_addr,
+ unsigned long *vm_start, unsigned long *vm_end,
+ unsigned long *vm_pgoff)
+{
+ struct hlist_head *head;
+ struct hlist_node *node;
+ struct __stp_tf_vma_entry *entry;
+ struct __stp_tf_vma_entry *found_entry = NULL;
+ int rc = ESRCH;
+
+ mutex_lock(&__stp_tf_vma_mutex);
+ head = &__stp_tf_vma_map[__stp_tf_vma_map_hash(tsk)];
+ hlist_for_each_entry(entry, node, head, hlist) {
+ if (tsk->pid == entry->pid
+ && vm_addr >= entry->vm_start
+ && vm_addr < entry->vm_end) {
+ found_entry = entry;
+ break;
+ }
+ }
+ if (found_entry != NULL) {
+ if (vm_start != NULL)
+ *vm_start = found_entry->vm_start;
+ if (vm_end != NULL)
+ *vm_end = found_entry->vm_end;
+ if (vm_pgoff != NULL)
+ *vm_pgoff = found_entry->vm_pgoff;
+ rc = 0;
+ }
+ mutex_unlock(&__stp_tf_vma_mutex);
+ return rc;
+}
diff --git a/stap-find-servers b/stap-find-servers
index 9e7b633d..fea645bd 100755
--- a/stap-find-servers
+++ b/stap-find-servers
@@ -87,7 +87,7 @@ function match_server {
server_port=`expr "$service_data" : '\[\([^]]*\)\]'`
;;
txt )
- server_sysinfo=`expr "$service_data" : '\[\"\([^]]*\)\"\]'`
+ server_sysinfo=`expr "$service_data" : '\[.*\"\(sysinfo=[^]]*\)\"\]'`
;;
* )
break ;;
@@ -115,7 +115,7 @@ function client_sysinfo {
# Add some info from uname
sysinfo_client="`uname -rvm`"
fi
- echo $sysinfo_client
+ echo sysinfo=$sysinfo_client
}
#-----------------------------------------------------------------------------
diff --git a/stap-serverd b/stap-serverd
index e378f6e4..221f353f 100755
--- a/stap-serverd
+++ b/stap-serverd
@@ -26,6 +26,11 @@ function initialization {
avahi_type=_stap._tcp
port=$1
test "X$port" = "X" && port=65000
+ port2=$(($port + 1))
+ if netstat -atn | awk '{print $4}' | cut -f2 -d: | egrep -q "^($port|$port2)\$"; then
+ # Whoops, the port is busy; try another one.
+ initialization $((1024+($port + $RANDOM)%64000))
+ fi
}
# function: advertise_presence
@@ -35,7 +40,7 @@ function advertise_presence {
# Build up a string representing our server's properties.
# TODO: this needs fleshing out.
local sysinfo=`uname -rvm`
- local txt="$sysinfo"
+ local txt="sysinfo=$sysinfo"
# Call avahi-publish-service to advertise our presence.
avahi-publish-service "Systemtap Compile Server on `uname -n`" \
@@ -71,6 +76,9 @@ function listen {
first=0
fi
wait %nc
+ if [ $? -ne 0 ]; then
+ fatal "ERROR: cannot listen on port $port"
+ fi
done
}
diff --git a/staprun.8.in b/staprun.8.in
index ca976a4a..c7e77dc4 100644
--- a/staprun.8.in
+++ b/staprun.8.in
@@ -99,8 +99,7 @@ to compile a script. The
.I stap
program will report the pathname to the resulting module.
.PP
-.Vb 1
-\& $ stap \-p4 \-e 'probe begin { printf("Hello World!\\n"); exit() }'
+\& $ stap \-p4 \-e \[aq]probe begin { printf("Hello World!\\n"); exit() }\[aq]
.br
\& /home/user/.systemtap/cache/85/stap_8553d83f78c_265.ko
.PP
@@ -108,7 +107,6 @@ Run
.I staprun
with the pathname to the module as an argument.
.PP
-.Vb 1
\& $ staprun /home/user/.systemtap/cache/85/stap_8553d83f78c_265.ko
.br
\& Hello World!
@@ -161,6 +159,6 @@ user and not be world writable.
.SH BUGS
Use the Bugzilla link off of the project web page or our mailing list.
.nh
-.BR http://sources.redhat.com/systemtap/ , <systemtap@sources.redhat.com> .
+.BR http://sources.redhat.com/systemtap/ ", " <systemtap@sources.redhat.com> .
.hy
diff --git a/systemtap.spec b/systemtap.spec
index 61ccd667..da2a6fb2 100644
--- a/systemtap.spec
+++ b/systemtap.spec
@@ -137,14 +137,17 @@ make %{?_smp_mflags}
rm -rf ${RPM_BUILD_ROOT}
make DESTDIR=$RPM_BUILD_ROOT install
-# We want the examples in the special doc dir, not the generoc doc install dir.
+# We want the examples in the special doc dir, not the build install dir.
+# We build it in place and then move it away so it doesn't get installed
+# twice. rpm can specify itself where the (versioned) docs go with the
+# %doc directive.
mv $RPM_BUILD_ROOT%{_datadir}/doc/systemtap/examples examples
# Fix paths in the example & testsuite scripts
find examples testsuite -type f -name '*.stp' -print0 | xargs -0 sed -i -r -e '1s@^#!.+stap@#!%{_bindir}/stap@'
# To avoid perl dependency, make perl sample script non-executable
-chmod -x examples/samples/kmalloc-top
+#chmod -x examples/samples/kmalloc-top
# Because "make install" may install staprun with mode 04111, the
# post-processing programs rpmbuild runs won't be able to read it.
@@ -157,6 +160,9 @@ cp -rp testsuite $RPM_BUILD_ROOT%{_datadir}/systemtap
#%if %{with_docs}
# We want the manuals in the special doc dir, not the generic doc install dir.
+# We build it in place and then move it away so it doesn't get installed
+# twice. rpm can specify itself where the (versioned) docs go with the
+# %doc directive.
mkdir docs.installed
mv $RPM_BUILD_ROOT%{_datadir}/doc/systemtap/*.pdf docs.installed/
#%endif
diff --git a/tapsets.cxx b/tapsets.cxx
index ca91659b..c5679043 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -4280,6 +4280,7 @@ dwarf_var_expanding_copy_visitor::visit_target_symbol (target_symbol *e)
case DW_TAG_variable:
if (e->base_name == "$$parms")
continue;
+ break;
case DW_TAG_formal_parameter:
if (e->base_name == "$$locals")
continue;
@@ -6289,13 +6290,7 @@ utrace_derived_probe_group::emit_module_decls (systemtap_session& s)
s.op->newline() << "case UDPF_SYSCALL:";
s.op->newline() << "case UDPF_SYSCALL_RETURN:";
s.op->indent(1);
- s.op->newline() << "engine = utrace_attach(tsk, UTRACE_ATTACH_MATCH_OPS, &p->ops, 0);";
- s.op->newline() << "if (! IS_ERR(engine) && engine != NULL) {";
- s.op->indent(1);
- s.op->newline() << "utrace_detach(tsk, engine);";
- s.op->newline() << "debug_task_finder_detach();";
-
- s.op->newline(-1) << "}";
+ s.op->newline() << "stap_utrace_detach(tsk, &p->ops);";
s.op->newline() << "break;";
s.op->indent(-1);
}
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog
index f28f05d7..d74b4c73 100644
--- a/testsuite/ChangeLog
+++ b/testsuite/ChangeLog
@@ -7,6 +7,26 @@
(EXTRA_TOOL_OPTS): Removed.
* Makefile.in: Regenerated.
+2008-08-08 Stan Cox <scox@redhat.com>
+
+ * systemtap.base/stmt_rel.stp: Lower wildcard matching count.
+
+2008-08-07 David Smith <dsmith@redhat.com>
+
+ * systemtap.base/utrace_p4.exp: Uses lib/stap_compile.exp instead
+ of its own stap_compile procedure.
+ * systemtap.base/cache.exp (stap_compile): Ignores warnings.
+ * lib/stap_compile.exp: Ignores warnings.
+
+2008-08-05 Mark Wielaard <mwielaard@redhat.com>
+
+ * systemtap.examples/README: Add meta file tag descriptions.
+
+2008-08-05 Stan Cox <scox@redhat.com>
+
+ * systemtap.base/warnings.stp: Use relative instead of absolute line.
+ * systemtap.base/vars.exp: New test.
+
2008-08-03 Wenji Huang <wenji.huang@oracle.com>
* buildok/seven.stp: Correct for 2.6.27.
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index 6daef3f6..b92286b0 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -32,7 +32,14 @@ EXTRA_DIST = execrc config lib systemtap \
parseok parseko semok semko transok transko buildok buildok \
systemtap.syscall systemtap.stress systemtap.string \
systemtap.pass1-4 systemtap.samples systemtap.printf \
- systemtap.maps systemtap.base
+ systemtap.maps systemtap.base \
+ systemtap.examples/examples-index-gen.pl \
+ systemtap.examples/systemtap.css \
+ systemtap.examples/systemtapcorner.gif \
+ systemtap.examples/systemtaplogo.png \
+ systemtap.examples/html_footer.tmpl \
+ systemtap.examples/html_header.tmpl
+
# $(srcdir)/These values point the test suite to the install tree, and
# are overridden by "make check" from full source/build tree
diff --git a/testsuite/lib/stap_compile.exp b/testsuite/lib/stap_compile.exp
index 35124a44..a206b7b1 100644
--- a/testsuite/lib/stap_compile.exp
+++ b/testsuite/lib/stap_compile.exp
@@ -12,6 +12,7 @@ proc stap_compile { TEST_NAME compile script args } {
expect {
-re {^Pass\ [1234]:[^\r]*\ in\ .*\ ms.\r\n} {exp_continue}
-re {^Pass\ [34]: using cached [^\r\n]+\r\n} {exp_continue}
+ -re "^WARNING" {exp_continue}
# pass-4 output
-re {^/[^\r\n]+.ko\r\n} {exp_continue}
-re "parse error" { incr compile_errors 1; exp_continue}
diff --git a/testsuite/systemtap.base/cache.exp b/testsuite/systemtap.base/cache.exp
index f7ed2786..390af054 100644
--- a/testsuite/systemtap.base/cache.exp
+++ b/testsuite/systemtap.base/cache.exp
@@ -30,6 +30,7 @@ proc stap_compile { TEST_NAME flags script args } {
-timeout 180
-re {^Pass\ [1234]:[^\r]*\ in\ [^\r]*\ ms\.\r\n} {exp_continue}
-re {^Pass\ [34]: using cached [^\r\n]+\r\n} {incr cached 1; exp_continue}
+ -re "^WARNING" {exp_continue}
# pass-4 output
-re {^/[^\r\n]+\.ko\r\n} {exp_continue}
-re "compilation failed" {incr compile_errors 1; exp_continue}
diff --git a/systemtap.base/itrace.exp b/testsuite/systemtap.base/itrace.exp
index 4b73ac1c..f19af977 100644
--- a/systemtap.base/itrace.exp
+++ b/testsuite/systemtap.base/itrace.exp
@@ -1,5 +1,9 @@
# itrace test
+# temporarily disabled
+return
+
+
# Initialize variables
set utrace_support_found 0
set exepath "[pwd]/ls_[pid]"
@@ -81,7 +85,7 @@ set TEST_NAME "itrace1"
if {$utrace_support_found == 0} {
untested "$TEST_NAME : no kernel utrace support found"
} elseif {![installtest_p]} {
- untested "$TEST_NAME : not installtest_p"
+ untested $TEST_NAME
} else {
set script [format $itrace1_script $exepath]
stap_run $TEST_NAME run_ls_5_sec $itrace1_script_output -e $script
@@ -92,7 +96,7 @@ set TEST_NAME "itrace2"
if {$utrace_support_found == 0} {
untested "$TEST_NAME : no kernel utrace support found"
} elseif {![installtest_p]} {
- untested "$TEST_NAME : not installtest_p"
+ untested $TEST_NAME
} else {
set script [format $itrace2_script $exepath]
stap_run $TEST_NAME run_ls_5_sec $itrace2_script_output -e $script
diff --git a/testsuite/systemtap.base/stmt_rel.stp b/testsuite/systemtap.base/stmt_rel.stp
index 13066161..cfe77317 100644
--- a/testsuite/systemtap.base/stmt_rel.stp
+++ b/testsuite/systemtap.base/stmt_rel.stp
@@ -55,11 +55,11 @@ probe kernel.statement("bio_put@fs/bio.c:*") {
# printf ("FAIL address %s %s\n", stack2, stack3)
# }
- # Did wildcard probe hit at least 5 different statements?
+ # Did wildcard probe hit at least 4 different statements?
foreach ([i] in wildcardpp) {
statement_count += 1
}
- if (statement_count >= 5) {
+ if (statement_count >= 4) {
printf ("PASS wildcard\n")
}
else
diff --git a/testsuite/systemtap.base/utrace_p4.exp b/testsuite/systemtap.base/utrace_p4.exp
index 333cff21..3083b97f 100644
--- a/testsuite/systemtap.base/utrace_p4.exp
+++ b/testsuite/systemtap.base/utrace_p4.exp
@@ -6,47 +6,6 @@
# If utrace exists in the kernel, it tries some compile tests. If
# utrace doesn't exist in the kernel, marks the tests as 'untested'.
-# stap_compile TEST_NAME flags script args
-# - TEST_NAME is the name of the current test
-# - compile indicates whether the script is supposed to compile
-# - script is the script to compile
-# Additional arguments are passed to stap as-is.
-proc stap_compile { TEST_NAME compile script args } {
- set cmd [concat {stap -v -p4 -e} $script $args]
-
- verbose -log "running $cmd"
- eval spawn $cmd
- set compile_errors 0
- expect {
- -re {^Pass\ [1234]:[^\r]*\ in\ .*\ ms.\r\n} {exp_continue}
- -re {^Pass\ [34]: using cached [^\r\n]+\r\n} {exp_continue}
- # pass-4 output
- -re {^/[^\r\n]+.ko\r\n} {exp_continue}
- -re "parse error" { incr compile_errors 1; exp_continue}
- -re "compilation failed" {incr compile_errors 1; exp_continue}
- -re "semantic error:" {incr compile_errors 1; exp_continue}
- -re "terminate called" {incr compile_errors 1; exp_continue}
- }
- catch close
- wait
-
- # If we've got compile errors and the script was supposed to
- # compile, fail.
- if {$compile_errors > 0} {
- if {$compile == 1} {
- fail "$TEST_NAME compilation failed"
- } else {
- pass "$TEST_NAME compilation failed correctly"
- }
- } else {
- if {$compile == 1} {
- pass "$TEST_NAME compilation succeeded"
- } else {
- fail "$TEST_NAME compilation succeeded unexpectedly"
- }
- }
-}
-
# Initialize variables
set utrace_support_found 0
diff --git a/testsuite/systemtap.base/vars.exp b/testsuite/systemtap.base/vars.exp
new file mode 100644
index 00000000..7541c01b
--- /dev/null
+++ b/testsuite/systemtap.base/vars.exp
@@ -0,0 +1,32 @@
+# Script for testing $$vars, $$parms, $$locals
+
+set test "vars"
+
+# grab C statement that $$vars yields
+set cmd [concat stap -p3 -e {"probe kernel.statement(\"bio_copy_user@fs/bio.c+1\") \{print (\$\$vars)\}"} 2>&1 | grep {"printf.*="} | sed -e {"s/^.*MAXSTRINGLEN, \"//"} -e {s/..\".*$//}]
+catch {eval exec $cmd} vars
+
+# grab C statement that $$parms yields
+set cmd [regsub "vars" $cmd "parms"]
+catch {eval exec $cmd} parms
+
+# grab C statement that $$locals yields
+set cmd [regsub "parms" $cmd "locals"]
+catch {eval exec $cmd} locals
+
+# syntax check of $$vars C statement
+set vars_ok [regexp "(\[a-z_\]+=%#llx *)+" $vars]
+if {!$vars_ok} {
+ fail "$test"
+} else {
+ pass "$test"
+}
+
+# $$vars should be equivalent to $$parms + $$locals
+if {![string equal [string trim $vars] \
+ [string trim [concat $parms " " $locals]]]} {
+ fail "$test parms/locals"
+} else {
+ pass "$test parms/locals"
+}
+
diff --git a/testsuite/systemtap.base/warnings.stp b/testsuite/systemtap.base/warnings.stp
index 94ed57b3..d71b3034 100644
--- a/testsuite/systemtap.base/warnings.stp
+++ b/testsuite/systemtap.base/warnings.stp
@@ -9,7 +9,7 @@ probe never { print(elide+me1) bar () }
# PR 6611
-probe probea = kernel.statement("bio_init@fs/bio.c:135")
+probe probea = kernel.statement("bio_init@fs/bio.c+3")
{ printf("%d", funca(2)); elide_me6="foo" }
probe probea { printf("%d", funcb(2,3)); printf("%s",var) }
diff --git a/testsuite/systemtap.examples/ChangeLog b/testsuite/systemtap.examples/ChangeLog
index 7cb39fb9..a7fcd069 100644
--- a/testsuite/systemtap.examples/ChangeLog
+++ b/testsuite/systemtap.examples/ChangeLog
@@ -1,3 +1,54 @@
+2008-08-08 Mark Wielaard <mwielaard@redhat.com>
+
+ * examples-index-gen.pl: Add index of subsystem and keywords at top of
+ HTML indexes.
+ * *index.html: Regenerated.
+ * *index.txt: Likewise.
+
+2008-08-08 Mark Wielaard <mwielaard@redhat.com>
+
+ * examples-index-gen.pl (add_meta_txt): Don't output output, exits,
+ status line.
+ (add_meta_html): Likewise.
+ * *index.html: Regenerated.
+ * *index.txt: Likewise.
+
+2008-08-08 Mark Wielaard <mwielaard@redhat.com>
+
+ * examples-index-gen.pl (inputdir): Make absolute.
+ (outputdir): Likewise.
+ (supportfiles): Copy from new html dir. Add README. Make sure
+ new html subdir is created in outputdir.
+
+2008-08-07 Frank Ch. Eigler <fche@elastic.org>
+
+ * *index.txt, *index.html: New generated files.
+ * .gitignore: Zap it.
+ * html/*, examples-index-gen.pl: Adapt to html/ boilerplate subdir.
+
+2008-08-07 Frank Ch. Eigler <fche@elastic.org>
+
+ * small_demos: Unique parts kept, others dropped.
+ * all other samples: Moved into new subdirectories.
+
+2008-08-07 David Smith <dsmith@redhat.com>
+
+ * .gitignore: New file.
+
+2008-08-07 Mark Wielaard <mwielaard@redhat.com>
+
+ * examples-index-gen.pl: New file.
+ * systemtap.css: Likewise.
+ * systemtapcorner.gif: Likewise.
+ * systemtaplogo.png: Likewise.
+ * html_footer.tmpl: Likewise.
+ * html_header.tmpl: Likewise.
+ * Makefile.am (EXTRA_DIST): Add new support files.
+
+2008-08-07 Mark Wielaard <mwielaard@redhat.com>
+
+ * futexes.meta: Correct name: entry.
+
2008-08-01 William Cohen <wcohen@redhat.com>
* helloworld.meta, traceio2.meta: Tweak test_installcheck.
diff --git a/testsuite/systemtap.examples/README b/testsuite/systemtap.examples/README
index 6718a55a..e505bdfb 100644
--- a/testsuite/systemtap.examples/README
+++ b/testsuite/systemtap.examples/README
@@ -5,5 +5,53 @@ Each script should be checked in as executable.
The first line should be
#! /usr/bin/env stap
-There should be an accompanying ".txt" file describing what the
-script does and how to use it.
+There should be an accompanying ".meta" file describing what the
+script does and how to use it, and how the testsuite should compile
+and run it. The meta files are also used to create a txt and html
+index (by keyword and subsystem) of all the examples by the
+examples-index-gen.pl script.
+
+The meta file contains the following elements. Each element (key and
+value) are on one line. If a key can have a list of values, the list
+elements are separated by spaces.
+
+title: Descriptive title for the script (required)
+name: the file name for the script, e.g. iotime.stp (required)
+version: versioning if any fixes and developed can be identified (required)
+author: name of author(s), "anonymous" if unknown (required)
+exclusivearch: Stated if the script can only run on some arches
+ this concept borrowed from rpm, matches types for rpm:
+ x86 i386 x86_64 ppc ppc64, s390 (optional)
+requires: Some scripts may require software to be available. In some cases
+ may need version numbering, e.g. kernel >= 2.6
+ Can have multiple "requires:" tags. (optional)
+keywords: List of likely words to categorize the script (required)
+ keywords are separated by spaces.
+ #FIXME have list of keyword
+subsystem: List what part of the kernel the instrumentation probes (required)
+ audit cpu blockio file filesystem locking memory numa network
+ process scheduler or user-space (probes are in the user-space)
+application: when user-space probing becomes available (optional)
+ a script might probe a particular application
+ this tag indicates the applicaton
+status: describes the state of development for the script (required)
+ proposed just an idea
+ experimental an implemented idea, but use at own risk
+ alpha
+ beta
+ production should be safe to use
+exit: how long do the script run? (required)
+ fixed exits in a fixed amount of time
+ user-controlled exits with "cntrl-c"
+ event-ended exits with some arbitrary event
+output: what kind of output does the script generate? (required)
+ trace histogram graph sorted batch timed
+scope: How much of the processes on the machine does the script watch?
+ system-wide or pid
+arg_[0-9]+: Describe what the arguments into the script are. (optional)
+description: A text description what the script does. (required)
+test_check: How to check that the example compiles.
+ (e.g. stap -p4 iotime.stp)
+test_installcheck: How to check that the example runs.
+ (e.g. stap iotime.stp -c "sleep 1")
+
diff --git a/testsuite/systemtap.examples/examples-index-gen.pl b/testsuite/systemtap.examples/examples-index-gen.pl
new file mode 100644
index 00000000..9bdc1174
--- /dev/null
+++ b/testsuite/systemtap.examples/examples-index-gen.pl
@@ -0,0 +1,318 @@
+#! /usr/bin/perl
+# Generates index files from examples .meta file info.
+# Copyright (C) 2008 Red Hat Inc.
+#
+# This file is part of systemtap, and is free software. You can
+# redistribute it and/or modify it under the terms of the GNU General
+# Public License (GPL); either version 2, or (at your option) any
+# later version.
+
+use strict;
+use warnings;
+
+use Cwd 'abs_path';
+use File::Copy;
+use File::Find;
+use File::Path;
+use Text::Wrap;
+
+my $inputdir;
+if ($#ARGV >= 0) {
+ $inputdir = $ARGV[0];
+} else {
+ $inputdir = ".";
+}
+$inputdir = abs_path($inputdir);
+
+my $outputdir;
+if ($#ARGV >= 1) {
+ $outputdir = $ARGV[1];
+} else {
+ $outputdir = $inputdir;
+}
+$outputdir = abs_path($outputdir);
+
+my %scripts = ();
+print "Parsing .meta files in $inputdir...\n";
+find(\&parse_meta_files, $inputdir);
+
+my $meta;
+my $subsystem;
+my %subsystems;
+my $keyword;
+my %keywords;
+
+# Adds a formatted meta entry to a given file handle as text.
+sub add_meta_txt(*;$) {
+ my($file,$meta) = @_;
+
+ print $file "$scripts{$meta}{name} - $scripts{$meta}{title}\n";
+
+ # Don't output these, the description mentions all these in general.
+ #print $file "output: $scripts{$meta}{output}, ";
+ #print $file "exits: $scripts{$meta}{exit}, ";
+ #print $file "status: $scripts{$meta}{status}\n";
+
+ print $file "subsystems: $scripts{$meta}{subsystem}, ";
+ print $file "keywords: $scripts{$meta}{keywords}\n\n";
+
+ $Text::Wrap::columns = 72;
+ my $description = wrap(' ', ' ', $scripts{$meta}{description});
+ print $file "$description\n\n\n";
+}
+
+# Adds a formatted meta entry to a given file handle as text.
+sub add_meta_html(*;$) {
+ my($file,$meta) = @_;
+
+ my $name = $scripts{$meta}{name};
+ print $file "<li><a href=\"$name\">$name</a> ";
+ print $file "- $scripts{$meta}{title}<br>\n";
+
+ # Don't output these, the description mentions all these in general.
+ #print $file "output: $scripts{$meta}{output}, ";
+ #print $file "exits: $scripts{$meta}{exit}, ";
+ #print $file "status: $scripts{$meta}{status}<br>\n";
+
+ print $file "subsystems: $scripts{$meta}{subsystem}, ";
+ print $file "keywords: $scripts{$meta}{keywords}<br>\n";
+
+ print $file "<p>$scripts{$meta}{description}";
+ print $file "</p></li>\n";
+}
+
+my $HEADER = "SYSTEMTAP EXAMPLES INDEX\n"
+ . "(see also subsystem-index.txt, keyword-index.txt)\n\n";
+
+my $header_tmpl = "$inputdir/html/html_header.tmpl";
+open(TEMPLATE, "<$header_tmpl")
+ || die "couldn't open $header_tmpl, $!";
+my $HTMLHEADER = do { local $/; <TEMPLATE> };
+close(TEMPLATE);
+my $footer_tmpl = "$inputdir/html/html_footer.tmpl";
+open(TEMPLATE, "<$footer_tmpl")
+ || die "couldn't open $footer_tmpl, $!";
+my $HTMLFOOTER = do { local $/; <TEMPLATE> };
+close(TEMPLATE);
+
+# Output full index and collect subsystems and keywords
+my $fullindex = "$outputdir/index.txt";
+open (FULLINDEX, ">$fullindex")
+ || die "couldn't open $fullindex: $!";
+print "Creating $fullindex...\n";
+print FULLINDEX $HEADER;
+
+my $fullhtml = "$outputdir/index.html";
+open (FULLHTML, ">$fullhtml")
+ || die "couldn't open $fullhtml: $!";
+print "Creating $fullhtml...\n";
+print FULLHTML $HTMLHEADER;
+print FULLHTML "<h2>All Examples</h2>\n";
+print FULLHTML "<ul>\n";
+
+foreach $meta (sort keys %scripts) {
+
+ add_meta_txt(\*FULLINDEX, $meta);
+ add_meta_html(\*FULLHTML, $meta);
+
+ # Collect subsystems
+ foreach $subsystem (split(/ /, $scripts{$meta}{subsystem})) {
+ if (defined $subsystems{$subsystem}) {
+ push(@{$subsystems{$subsystem}}, $meta);
+ } else {
+ $subsystems{$subsystem} = [ $meta ];
+ }
+ }
+
+ # Collect keywords
+ foreach $keyword (split(/ /, $scripts{$meta}{keywords})) {
+ if (defined $keywords{$keyword}) {
+ push(@{$keywords{$keyword}}, $meta);
+ } else {
+ $keywords{$keyword} = [ $meta ];
+ }
+ }
+}
+print FULLHTML "</ul>\n";
+print FULLHTML $HTMLFOOTER;
+close (FULLINDEX);
+close (FULLHTML);
+
+my $SUBHEADER = "SYSTEMTAP EXAMPLES INDEX BY SUBSYSTEM\n"
+ . "(see also index.txt, keyword-index.txt)\n\n";
+
+# Output subsystem index
+my $subindex = "$outputdir/subsystem-index.txt";
+open (SUBINDEX, ">$subindex")
+ || die "couldn't open $subindex: $!";
+print "Creating $subindex...\n";
+print SUBINDEX $SUBHEADER;
+
+my $subhtml = "$outputdir/subsystem-index.html";
+open (SUBHTML, ">$subhtml")
+ || die "couldn't open $subhtml: $!";
+print "Creating $subhtml...\n";
+print SUBHTML $HTMLHEADER;
+print SUBHTML "<h2>Examples by Subsystem</h2>\n";
+
+# On top link list
+print SUBHTML "<p><tt>";
+foreach $subsystem (sort keys %subsystems) {
+ print SUBHTML '<a href="#' . (uc $subsystem) . '">'
+ . (uc $subsystem) . "</a> ";
+}
+print SUBHTML "</tt></p>\n";
+
+foreach $subsystem (sort keys %subsystems) {
+ print SUBINDEX "= " . (uc $subsystem) . " =\n\n";
+ print SUBHTML "<h3>" . '<a name="' . (uc $subsystem) . '">'
+ . (uc $subsystem) . "</a></h3>\n";
+ print SUBHTML "<ul>\n";
+
+ foreach $meta (sort @{$subsystems{$subsystem}}) {
+ add_meta_txt(\*SUBINDEX,$meta);
+ add_meta_html(\*SUBHTML,$meta);
+ }
+ print SUBHTML "</ul>\n";
+}
+print SUBHTML $HTMLFOOTER;
+close (SUBINDEX);
+close (SUBHTML);
+
+my $KEYHEADER = "SYSTEMTAP EXAMPLES INDEX BY KEYWORD\n"
+ . "(see also index.txt, subsystem-index.txt)\n\n";
+
+# Output subsystem index
+my $keyindex = "$outputdir/keyword-index.txt";
+open (KEYINDEX, ">$keyindex")
+ || die "couldn't open $keyindex: $!";
+print "Creating $keyindex...\n";
+print KEYINDEX $KEYHEADER;
+
+my $keyhtml = "$outputdir/keyword-index.html";
+open (KEYHTML, ">$keyhtml")
+ || die "couldn't open $keyhtml: $!";
+print "Creating $keyhtml...\n";
+print KEYHTML $HTMLHEADER;
+print KEYHTML "<h2>Examples by Keyword</h2>\n";
+
+# On top link list
+print KEYHTML "<p><tt>";
+foreach $keyword (sort keys %keywords) {
+ print KEYHTML '<a href="#' . (uc $keyword) . '">'
+ . (uc $keyword) . "</a> ";
+}
+print KEYHTML "</tt></p>\n";
+
+foreach $keyword (sort keys %keywords) {
+ print KEYINDEX "= " . (uc $keyword) . " =\n\n";
+ print KEYHTML "<h3>" . '<a name="' . (uc $keyword) . '">'
+ . (uc $keyword) . "</a></h3>\n";
+ print KEYHTML "<ul>\n";
+
+ foreach $meta (sort @{$keywords{$keyword}}) {
+ add_meta_txt(\*KEYINDEX,$meta);
+ add_meta_html(\*KEYHTML,$meta);
+ }
+ print KEYHTML "</ul>\n";
+}
+print KEYHTML $HTMLFOOTER;
+close (KEYINDEX);
+close (KEYHTML);
+
+my @supportfiles
+ = ("html/systemtapcorner.gif",
+ "html/systemtap.css",
+ "html/systemtaplogo.png",
+ "README");
+if ($inputdir ne $outputdir) {
+ my $file;
+ print "Copying support files...\n";
+ if (! -d "$outputdir/html") {
+ mkpath("$outputdir/html", 1, 0711);
+ }
+ foreach $file (@supportfiles) {
+ my $orig = "$inputdir/$file";
+ my $dest = "$outputdir/$file";
+ print "Copying $file to $dest...\n";
+ copy($orig, $dest) or die "$file cannot be copied to $dest, $!";
+ }
+}
+
+sub parse_meta_files {
+ my $file = $_;
+ my $filename = $File::Find::name;
+
+ if (-f $file && $file =~ /\.meta$/) {
+ open FILE, $file or die "couldn't open '$file': $!\n";
+
+ print "Parsing $filename...\n";
+
+ my $title;
+ my $name;
+ my $keywords;
+ my $subsystem;
+ my $status;
+ my $exit;
+ my $output;
+ my $description;
+ while (<FILE>) {
+ if (/^title: (.*)/) { $title = $1; }
+ if (/^name: (.*)/) { $name = $1; }
+ if (/^keywords: (.*)/) { $keywords = $1; }
+ if (/^subsystem: (.*)/) { $subsystem = $1; }
+ if (/^status: (.*)/) { $status = $1; }
+ if (/^exit: (.*)/) { $exit = $1; }
+ if (/^output: (.*)/) { $output = $1; }
+ if (/^description: (.*)/) { $description = $1; }
+ }
+ close FILE;
+
+ # Remove extra whitespace
+ $keywords =~ s/^\s*//;
+ $keywords =~ s/\s*$//;
+ $subsystem =~ s/^\s*//;
+ $subsystem =~ s/\s*$//;
+
+ # The subdir without the inputdir prefix, nor any slashes.
+ my $subdir = substr $File::Find::dir, (length $inputdir);
+ $subdir =~ s/^\///;
+ if ($subdir ne "") {
+ $name = "$subdir/$name";
+ }
+
+ my $script = {
+ name => $name,
+ title => $title,
+ keywords => $keywords,
+ subsystem => $subsystem,
+ status => $status,
+ exit => $exit,
+ output => $output,
+ description => $description
+ };
+
+ # chop off the search dir prefix.
+ $inputdir =~ s/\/$//;
+ $meta = substr $filename, (length $inputdir) + 1;
+ $scripts{$meta} = $script;
+
+ # Put .stp script in output dir if necessary and create
+ # subdirs if they don't exist yet.
+ if ($inputdir ne $outputdir) {
+ # The subdir without the inputdir prefix, nor any slashes.
+ my $destdir = substr $File::Find::dir, (length $inputdir);
+ $destdir =~ s/^\///;
+ if ($subdir ne "") {
+ if (! -d "$outputdir/$subdir") {
+ mkpath("$outputdir/$subdir", 1, 0711);
+ }
+ }
+ my $orig = substr $name, (length $subdir);
+ $orig =~ s/^\///;
+ my $dest = "$outputdir/$name";
+ print "Copying $orig to $dest...\n";
+ copy($orig, $dest) or die "$orig cannot be copied to $dest, $!";
+ }
+ }
+}
diff --git a/testsuite/systemtap.examples/small_demos/ansi_colors.stp b/testsuite/systemtap.examples/general/ansi_colors.stp
index 0d9d7c47..0d9d7c47 100755
--- a/testsuite/systemtap.examples/small_demos/ansi_colors.stp
+++ b/testsuite/systemtap.examples/general/ansi_colors.stp
diff --git a/testsuite/systemtap.examples/small_demos/click.wav b/testsuite/systemtap.examples/general/click.wav
index 8214b229..8214b229 100644
--- a/testsuite/systemtap.examples/small_demos/click.wav
+++ b/testsuite/systemtap.examples/general/click.wav
Binary files differ
diff --git a/testsuite/systemtap.examples/graphs.meta b/testsuite/systemtap.examples/general/graphs.meta
index 60a522b3..60a522b3 100644
--- a/testsuite/systemtap.examples/graphs.meta
+++ b/testsuite/systemtap.examples/general/graphs.meta
diff --git a/testsuite/systemtap.examples/graphs.stp b/testsuite/systemtap.examples/general/graphs.stp
index 0c8e3796..0c8e3796 100644
--- a/testsuite/systemtap.examples/graphs.stp
+++ b/testsuite/systemtap.examples/general/graphs.stp
diff --git a/testsuite/systemtap.examples/helloworld.meta b/testsuite/systemtap.examples/general/helloworld.meta
index 60bc53f2..60bc53f2 100644
--- a/testsuite/systemtap.examples/helloworld.meta
+++ b/testsuite/systemtap.examples/general/helloworld.meta
diff --git a/testsuite/systemtap.examples/helloworld.stp b/testsuite/systemtap.examples/general/helloworld.stp
index efe45b79..efe45b79 100755
--- a/testsuite/systemtap.examples/helloworld.stp
+++ b/testsuite/systemtap.examples/general/helloworld.stp
diff --git a/testsuite/systemtap.examples/small_demos/key.stp b/testsuite/systemtap.examples/general/key.stp
index 6d2d6c3f..6d2d6c3f 100755
--- a/testsuite/systemtap.examples/small_demos/key.stp
+++ b/testsuite/systemtap.examples/general/key.stp
diff --git a/testsuite/systemtap.examples/small_demos/keyhack.stp b/testsuite/systemtap.examples/general/keyhack.stp
index 3137baad..3137baad 100755
--- a/testsuite/systemtap.examples/small_demos/keyhack.stp
+++ b/testsuite/systemtap.examples/general/keyhack.stp
diff --git a/testsuite/systemtap.examples/para-callgraph.meta b/testsuite/systemtap.examples/general/para-callgraph.meta
index 3ce4b648..3ce4b648 100644
--- a/testsuite/systemtap.examples/para-callgraph.meta
+++ b/testsuite/systemtap.examples/general/para-callgraph.meta
diff --git a/testsuite/systemtap.examples/para-callgraph.stp b/testsuite/systemtap.examples/general/para-callgraph.stp
index 1afb8837..1afb8837 100644
--- a/testsuite/systemtap.examples/para-callgraph.stp
+++ b/testsuite/systemtap.examples/general/para-callgraph.stp
diff --git a/testsuite/systemtap.examples/small_demos/return.wav b/testsuite/systemtap.examples/general/return.wav
index 20f978cc..20f978cc 100644
--- a/testsuite/systemtap.examples/small_demos/return.wav
+++ b/testsuite/systemtap.examples/general/return.wav
Binary files differ
diff --git a/testsuite/systemtap.examples/html/html_footer.tmpl b/testsuite/systemtap.examples/html/html_footer.tmpl
new file mode 100644
index 00000000..27eccd3c
--- /dev/null
+++ b/testsuite/systemtap.examples/html/html_footer.tmpl
@@ -0,0 +1,14 @@
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+
+ <table cellspacing="2" cellpadding="2" border="0" width="100%">
+ <tr>
+ <td align="center" class="footer"><a href=
+ "http://sourceware.org/systemtap">SystemTap</a></td>
+ </tr>
+ </table>
+</body>
+</html>
diff --git a/testsuite/systemtap.examples/html/html_header.tmpl b/testsuite/systemtap.examples/html/html_header.tmpl
new file mode 100644
index 00000000..25c7e5a0
--- /dev/null
+++ b/testsuite/systemtap.examples/html/html_header.tmpl
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+ <title>SystemTap Examples</title>
+ <link rel="stylesheet" href="html/systemtap.css" type="text/css">
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+</head>
+
+<body>
+ <table cellspacing="2" cellpadding="2" border="0" width="100%">
+ <tr>
+ <td valign="bottom" height="80"><img src="html/systemtaplogo.png"
+ alt="SystemTap logo" width="165" height="25"></td>
+ <td valign="bottom" class="topnavright" align="right">
+ <a href="http://sourceware.org/systemtap/">SystemTap</a>&nbsp;|&nbsp;
+ </td>
+ </tr>
+ </table>
+
+ <div class="mainbackground">
+ <div class="maintextregion">
+ <img src="html/systemtapcorner.gif">
+ <table cellspacing="2" cellpadding="4" border="0" width="99%"
+ style="margin-top:17;">
+ <tr>
+ <td width="200">&nbsp;</td>
+ <td valign="bottom"><h1>Examples</h1></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td valign="top">
+
+ <h2>Example Indexes</h2>
+ <ul>
+ <li><a href="index.html">All Examples</a></li>
+ <li><a href="subsystem-index.html">By Subsystem</a></li>
+ <li><a href="keyword-index.html">By Keyword</a></li>
+ </ul>
+
diff --git a/testsuite/systemtap.examples/html/systemtap.css b/testsuite/systemtap.examples/html/systemtap.css
new file mode 100644
index 00000000..445d95f4
--- /dev/null
+++ b/testsuite/systemtap.examples/html/systemtap.css
@@ -0,0 +1,164 @@
+body {
+ background-color: #cccccc;
+}
+
+.topnavright {
+ color: #787878;
+ text-align: right;
+ font-family: verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-size: 14px;
+ margin-right: 10px;
+}
+
+.topnavright a:link {
+ text-decoration: none;
+ color: #944E0F;
+}
+
+.topnavright a:visited {
+ text-decoration: none;
+ color: #944E0F;
+}
+
+div.mainbackground {
+ background-color: #ffffff;
+ padding: 17 17 17 17;
+}
+
+div.maintextregion {
+ background-color: #5b5b5b;
+ color: #ffffff;
+}
+
+div.maintextregion h1 {
+ color: #F38019;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-size: 28px
+}
+
+div.maintextregion h2 {
+ color: #F38019;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ margin-bottom: 2px;
+ font-size: 18px;
+ margin-top: 28px;
+}
+
+div.maintextregion h4 {
+ color: #ffffff;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-weight: bold;
+}
+
+div.maintextregion p {
+ color: #ffffff;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-size: 14px;
+ line-height: 150%;
+ text-align: justify;
+}
+
+div.maintextregion ul {
+ color: #ffffff;
+ list-style-type: square;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-size: 14px;
+ line-height: 150%;
+ text-align: justify;
+}
+
+div.maintextregion td ul ul {
+ color: #ffffff;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+}
+
+div.maintextregion dt {
+ color: #ffffff;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ margin-top: 10px;
+}
+
+div.maintextregion pre {
+ color: #ffffff;
+ font-size: 14px;
+}
+
+div.maintextregion td pre {
+ color: #ffffff;
+ font-size: 14px;
+}
+
+div.maintextregion dd {
+ color: #ffffff;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ font-size: 14px;
+ line-height: 150%;
+ text-align: justify;
+ margin-left: 10px;
+}
+
+div.maintextregion table {
+ margin-top: 20;
+}
+
+div.maintextregion th {
+ color: #ffffff;
+ background-color: #494949;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ text-align: left;
+}
+
+div.maintextregion tr.odd {
+ color: #ffffff;
+ background-color: #393939;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+}
+
+div.maintextregion tr.even {
+ color: #ffffff;
+ background-color: #4d4d4d;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+}
+
+div.maintextregion form {
+ color: #ffffff;
+ background-color: #4d4d4d;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+ border: thin solid #424242;
+ padding: 6;
+}
+
+div.maintextregion dd.left {
+ color: #ffffff;
+ margin-left: 0;
+}
+
+a:link {
+ color: #ff9600;
+ text-decoration: none;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+}
+
+a:visited {
+ color: #ff9600;
+ text-decoration: none;
+ font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
+}
+
+.imgholder {
+ text-align: center;
+ padding: 8;
+}
+.footer a:link {
+ text-decoration: none;
+ color: #944E0F;
+ font-size: 12px;
+ font-weight: bold;
+}
+.footer a:visited {
+ text-decoration: none;
+ color: #944E0F;
+ font-size: 12px;
+ font-weight: bold;
+}
+
diff --git a/testsuite/systemtap.examples/html/systemtapcorner.gif b/testsuite/systemtap.examples/html/systemtapcorner.gif
new file mode 100644
index 00000000..c44f2c75
--- /dev/null
+++ b/testsuite/systemtap.examples/html/systemtapcorner.gif
Binary files differ
diff --git a/testsuite/systemtap.examples/html/systemtaplogo.png b/testsuite/systemtap.examples/html/systemtaplogo.png
new file mode 100644
index 00000000..c223babd
--- /dev/null
+++ b/testsuite/systemtap.examples/html/systemtaplogo.png
Binary files differ
diff --git a/testsuite/systemtap.examples/index.html b/testsuite/systemtap.examples/index.html
new file mode 100644
index 00000000..327e9ef9
--- /dev/null
+++ b/testsuite/systemtap.examples/index.html
@@ -0,0 +1,130 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+ <title>SystemTap Examples</title>
+ <link rel="stylesheet" href="html/systemtap.css" type="text/css">
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+</head>
+
+<body>
+ <table cellspacing="2" cellpadding="2" border="0" width="100%">
+ <tr>
+ <td valign="bottom" height="80"><img src="html/systemtaplogo.png"
+ alt="SystemTap logo" width="165" height="25"></td>
+ <td valign="bottom" class="topnavright" align="right">
+ <a href="http://sourceware.org/systemtap/">SystemTap</a>&nbsp;|&nbsp;
+ </td>
+ </tr>
+ </table>
+
+ <div class="mainbackground">
+ <div class="maintextregion">
+ <img src="html/systemtapcorner.gif">
+ <table cellspacing="2" cellpadding="4" border="0" width="99%"
+ style="margin-top:17;">
+ <tr>
+ <td width="200">&nbsp;</td>
+ <td valign="bottom"><h1>Examples</h1></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td valign="top">
+
+ <h2>Example Indexes</h2>
+ <ul>
+ <li><a href="index.html">All Examples</a></li>
+ <li><a href="subsystem-index.html">By Subsystem</a></li>
+ <li><a href="keyword-index.html">By Keyword</a></li>
+ </ul>
+
+<h2>All Examples</h2>
+<ul>
+<li><a href="general/graphs.stp">general/graphs.stp</a> - Graphing Disk and CPU Utilization<br>
+subsystems: disk cpu, keywords: disk cpu use graph<br>
+<p>The script tracks the disk and CPU utilization. The resulting output of the script can be piped into gnuplot to generate a graph of disk and CPU USE.</p></li>
+<li><a href="general/helloworld.stp">general/helloworld.stp</a> - SystemTap "Hello World" Program<br>
+subsystems: none, keywords: simple<br>
+<p>A basic "Hello World" program implemented in SystemTap script. It prints out "hello world" message and then immediately exits.</p></li>
+<li><a href="general/para-callgraph.stp">general/para-callgraph.stp</a> - Tracing Calls for Sections of Code<br>
+subsystems: kernel, keywords: trace callgraph<br>
+<p>The script takes two arguments: the first argument is the function to starts/stops the per thread call graph traces and the second argument is the list of functions to generate trace information on. The script prints out a timestap for the thread, the function name and pid, followed by entry or exit symboly and function name.</p></li>
+<li><a href="io/disktop.stp">io/disktop.stp</a> - Summarize Disk Read/Write Traffic<br>
+subsystems: disk, keywords: disk<br>
+<p>Get the status of reading/writing disk every 5 seconds, output top ten entries during that period.</p></li>
+<li><a href="io/io_submit.stp">io/io_submit.stp</a> - Tally Reschedule Reason During AIO io_submit Call<br>
+subsystems: io, keywords: io backtrace<br>
+<p>When a reschedule occurs during an AIO io_submit call, accumulate the traceback in a histogram. When the script exits prints out a sorted list from most common to least common backtrace.</p></li>
+<li><a href="io/iotime.stp">io/iotime.stp</a> - Trace Time Spent in Read and Write for Files <br>
+subsystems: syscall, keywords: syscall read write time io<br>
+<p>The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spend in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parenthesese. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls.</p></li>
+<li><a href="io/iotop.stp">io/iotop.stp</a> - Periodically Print I/O Activity by Process Name<br>
+subsystems: io, keywords: io<br>
+<p>Every five seconds print out the top ten executables generating I/O traffic during that interval sorted in descending order.</p></li>
+<li><a href="io/traceio.stp">io/traceio.stp</a> - Track Cumulative I/O Activity by Process Name<br>
+subsystems: io, keywords: io<br>
+<p>Every second print out the top ten executables sorted in descending order based on cumulative I/O traffic observed.</p></li>
+<li><a href="io/traceio2.stp">io/traceio2.stp</a> - Watch I/O Activity on a Particular Device<br>
+subsystems: io, keywords: io<br>
+<p>Print out the executable name and process number as reads and writes to the specified device occur.</p></li>
+<li><a href="network/nettop.stp">network/nettop.stp</a> - Periodic Listing of Processes Using Network Interfaces<br>
+subsystems: network, keywords: network traffic per-process<br>
+<p>Every five seconds the nettop.stp script prints out a list of processed (PID and command) with the number of packets sent/received and the amount of data sent/received by the process during that interval.</p></li>
+<li><a href="network/socket-trace.stp">network/socket-trace.stp</a> - Trace Functions called in Network Socket Code<br>
+subsystems: network, keywords: network socket<br>
+<p>The script instrument each of the functions inn the Linux kernel's net/socket.c file. The script prints out trace. The first element of a line is time delta in microseconds from the previous entry. This is followed by the command name and the PID. The "->" and "<-" indicates function entry and function exit, respectively. The last element of the line is the function name.</p></li>
+<li><a href="process/futexes.stp">process/futexes.stp</a> - System-Wide Futex Contention<br>
+subsystems: locking, keywords: syscall locking futex<br>
+<p>The script watches the futex syscall on the system. On exit the futexes address, the number of contentions, and the average time for each contention on the futex are printed from lowest pid number to highest.</p></li>
+<li><a href="process/pf2.stp">process/pf2.stp</a> - Profile kernel functions<br>
+subsystems: kernel, keywords: profiling<br>
+<p>The pf2.stp script sets up time-based sampling. Every five seconds it prints out a sorted list with the top ten kernel functions with samples.</p></li>
+<li><a href="process/sig_by_pid.stp">process/sig_by_pid.stp</a> - Signal Counts by Process ID<br>
+subsystems: signals, keywords: signals<br>
+<p>Print signal counts by process ID in descending order.</p></li>
+<li><a href="process/sig_by_proc.stp">process/sig_by_proc.stp</a> - Signal Counts by Process Name<br>
+subsystems: signals, keywords: signals<br>
+<p>Print signal counts by process name in descending order.</p></li>
+<li><a href="process/sigkill.stp">process/sigkill.stp</a> - Track SIGKILL Signals<br>
+subsystems: signals, keywords: signals<br>
+<p>The script traces any SIGKILL signals. When that SIGKILL signal is sent to a process, the script prints out the signal name, the desination executable and process ID, the executable name user ID that sent the signal.</p></li>
+<li><a href="process/syscalls_by_pid.stp">process/syscalls_by_pid.stp</a> - System-Wide Count of Syscalls by PID<br>
+subsystems: signals, keywords: signals<br>
+<p>The script watches for a particular signal sent to a specific process. When that signal is sent to the specified process, the script prints out the PID and executable of the process sending the signal, the PID and executable name of the process receiving the signal, and the signal number and name.</p></li>
+<li><a href="process/sleepingBeauties.stp">process/sleepingBeauties.stp</a> - Generating Backtraces of Threads Waiting for IO Operations<br>
+subsystems: scheduler, keywords: io scheduler<br>
+<p>The script monitor time threads spend waiting for IO operations (in "D" state) in the wait_for_completion function. If a thread spends over 10ms wall-clock time waiting, information is printed out describing the thread number and executable name. When slow the wait_for_completion function complete, backtraces for the long duration calls are printed out.</p></li>
+<li><a href="process/sleeptime.stp">process/sleeptime.stp</a> - Trace Time Spent in nanosleep Syscalls<br>
+subsystems: syscall, keywords: syscall sleep<br>
+<p>The script watches each nanosleep syscall on the system. At the end of each nanosleep syscall the script prints out a line with a timestamp in microseconds, the pid, the executable name in paretheses, the "nanosleep:" key, and the duration of the sleep in microseconds.</p></li>
+<li><a href="process/syscalls_by_pid.stp">process/syscalls_by_pid.stp</a> - System-Wide Count of Syscalls by PID<br>
+subsystems: syscall, keywords: syscall<br>
+<p>The script watches all syscall on the system. On exit the script prints a list showing the number of systemcalls executed by each PID ordered from greatest to least number of syscalls.</p></li>
+<li><a href="process/syscalls_by_proc.stp">process/syscalls_by_proc.stp</a> - System-Wide Count of Syscalls by Executable<br>
+subsystems: syscall, keywords: syscall<br>
+<p>The script watches all syscall on the system. On exit the script prints a list showing the number of systemcalls executed by each executable ordered from greates to least number of syscalls.</p></li>
+<li><a href="process/wait4time.stp">process/wait4time.stp</a> - Trace Time Spent in wait4 Syscalls<br>
+subsystems: syscall, keywords: syscall wait4<br>
+<p>The script watches each wait4 syscall on the system. At the end of each wait4 syscall the script prints out a line with a timestamp in microseconds, the pid, the executable name in paretheses, the "wait4:" key, the duration of the wait and the PID that the wait4 was waiting for. If the waited for PID is not specified , it is "-1".</p></li>
+<li><a href="profiling/functioncallcount.stp">profiling/functioncallcount.stp</a> - Count Times Functions Called<br>
+subsystems: kernel, keywords: profiling functions<br>
+<p>The functioncallcount.stp script takes one argument, a list of functions to probe. The script will run and count the number of times that each of the functions on the list is called. On exit the script will print a sorted list from most frequently to least frequently called function.</p></li>
+<li><a href="profiling/thread-times.stp">profiling/thread-times.stp</a> - Profile kernel functions<br>
+subsystems: kernel, keywords: profiling<br>
+<p>The thread-times.stp script sets up time-based sampling. Every five seconds it prints out a sorted list with the top twenty processes with samples broken down into percentage total time spent in user-space and kernel-space.</p></li>
+</ul>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+
+ <table cellspacing="2" cellpadding="2" border="0" width="100%">
+ <tr>
+ <td align="center" class="footer"><a href=
+ "http://sourceware.org/systemtap">SystemTap</a></td>
+ </tr>
+ </table>
+</body>
+</html>
diff --git a/testsuite/systemtap.examples/index.txt b/testsuite/systemtap.examples/index.txt
new file mode 100644
index 00000000..aed6f457
--- /dev/null
+++ b/testsuite/systemtap.examples/index.txt
@@ -0,0 +1,214 @@
+SYSTEMTAP EXAMPLES INDEX
+(see also subsystem-index.txt, keyword-index.txt)
+
+general/graphs.stp - Graphing Disk and CPU Utilization
+subsystems: disk cpu, keywords: disk cpu use graph
+
+ The script tracks the disk and CPU utilization. The resulting output
+ of the script can be piped into gnuplot to generate a graph of disk
+ and CPU USE.
+
+
+general/helloworld.stp - SystemTap "Hello World" Program
+subsystems: none, keywords: simple
+
+ A basic "Hello World" program implemented in SystemTap script. It
+ prints out "hello world" message and then immediately exits.
+
+
+general/para-callgraph.stp - Tracing Calls for Sections of Code
+subsystems: kernel, keywords: trace callgraph
+
+ The script takes two arguments: the first argument is the function to
+ starts/stops the per thread call graph traces and the second argument
+ is the list of functions to generate trace information on. The script
+ prints out a timestap for the thread, the function name and pid,
+ followed by entry or exit symboly and function name.
+
+
+io/disktop.stp - Summarize Disk Read/Write Traffic
+subsystems: disk, keywords: disk
+
+ Get the status of reading/writing disk every 5 seconds, output top
+ ten entries during that period.
+
+
+io/io_submit.stp - Tally Reschedule Reason During AIO io_submit Call
+subsystems: io, keywords: io backtrace
+
+ When a reschedule occurs during an AIO io_submit call, accumulate the
+ traceback in a histogram. When the script exits prints out a sorted
+ list from most common to least common backtrace.
+
+
+io/iotime.stp - Trace Time Spent in Read and Write for Files
+subsystems: syscall, keywords: syscall read write time io
+
+ The script watches each open, close, read, and write syscalls on the
+ system. For each file the scripts observes opened it accumulates the
+ amount of wall clock time spend in read and write operations and the
+ number of bytes read and written. When a file is closed the script
+ prints out a pair of lines for the file. Both lines begin with a
+ timestamp in microseconds, the PID number, and the executable name in
+ parenthesese. The first line with the "access" keyword lists the file
+ name, the attempted number of bytes for the read and write
+ operations. The second line with the "iotime" keyword list the file
+ name and the number of microseconds accumulated in the read and write
+ syscalls.
+
+
+io/iotop.stp - Periodically Print I/O Activity by Process Name
+subsystems: io, keywords: io
+
+ Every five seconds print out the top ten executables generating I/O
+ traffic during that interval sorted in descending order.
+
+
+io/traceio.stp - Track Cumulative I/O Activity by Process Name
+subsystems: io, keywords: io
+
+ Every second print out the top ten executables sorted in descending
+ order based on cumulative I/O traffic observed.
+
+
+io/traceio2.stp - Watch I/O Activity on a Particular Device
+subsystems: io, keywords: io
+
+ Print out the executable name and process number as reads and writes
+ to the specified device occur.
+
+
+network/nettop.stp - Periodic Listing of Processes Using Network Interfaces
+subsystems: network, keywords: network traffic per-process
+
+ Every five seconds the nettop.stp script prints out a list of
+ processed (PID and command) with the number of packets sent/received
+ and the amount of data sent/received by the process during that
+ interval.
+
+
+network/socket-trace.stp - Trace Functions called in Network Socket Code
+subsystems: network, keywords: network socket
+
+ The script instrument each of the functions inn the Linux kernel's
+ net/socket.c file. The script prints out trace. The first element of
+ a line is time delta in microseconds from the previous entry. This
+ is followed by the command name and the PID. The "->" and "<-"
+ indicates function entry and function exit, respectively. The last
+ element of the line is the function name.
+
+
+process/futexes.stp - System-Wide Futex Contention
+subsystems: locking, keywords: syscall locking futex
+
+ The script watches the futex syscall on the system. On exit the
+ futexes address, the number of contentions, and the average time for
+ each contention on the futex are printed from lowest pid number to
+ highest.
+
+
+process/pf2.stp - Profile kernel functions
+subsystems: kernel, keywords: profiling
+
+ The pf2.stp script sets up time-based sampling. Every five seconds it
+ prints out a sorted list with the top ten kernel functions with
+ samples.
+
+
+process/sig_by_pid.stp - Signal Counts by Process ID
+subsystems: signals, keywords: signals
+
+ Print signal counts by process ID in descending order.
+
+
+process/sig_by_proc.stp - Signal Counts by Process Name
+subsystems: signals, keywords: signals
+
+ Print signal counts by process name in descending order.
+
+
+process/sigkill.stp - Track SIGKILL Signals
+subsystems: signals, keywords: signals
+
+ The script traces any SIGKILL signals. When that SIGKILL signal is
+ sent to a process, the script prints out the signal name, the
+ desination executable and process ID, the executable name user ID
+ that sent the signal.
+
+
+process/syscalls_by_pid.stp - System-Wide Count of Syscalls by PID
+subsystems: signals, keywords: signals
+
+ The script watches for a particular signal sent to a specific
+ process. When that signal is sent to the specified process, the
+ script prints out the PID and executable of the process sending the
+ signal, the PID and executable name of the process receiving the
+ signal, and the signal number and name.
+
+
+process/sleepingBeauties.stp - Generating Backtraces of Threads Waiting for IO Operations
+subsystems: scheduler, keywords: io scheduler
+
+ The script monitor time threads spend waiting for IO operations (in
+ "D" state) in the wait_for_completion function. If a thread spends
+ over 10ms wall-clock time waiting, information is printed out
+ describing the thread number and executable name. When slow the
+ wait_for_completion function complete, backtraces for the long
+ duration calls are printed out.
+
+
+process/sleeptime.stp - Trace Time Spent in nanosleep Syscalls
+subsystems: syscall, keywords: syscall sleep
+
+ The script watches each nanosleep syscall on the system. At the end
+ of each nanosleep syscall the script prints out a line with a
+ timestamp in microseconds, the pid, the executable name in
+ paretheses, the "nanosleep:" key, and the duration of the sleep in
+ microseconds.
+
+
+process/syscalls_by_pid.stp - System-Wide Count of Syscalls by PID
+subsystems: syscall, keywords: syscall
+
+ The script watches all syscall on the system. On exit the script
+ prints a list showing the number of systemcalls executed by each PID
+ ordered from greatest to least number of syscalls.
+
+
+process/syscalls_by_proc.stp - System-Wide Count of Syscalls by Executable
+subsystems: syscall, keywords: syscall
+
+ The script watches all syscall on the system. On exit the script
+ prints a list showing the number of systemcalls executed by each
+ executable ordered from greates to least number of syscalls.
+
+
+process/wait4time.stp - Trace Time Spent in wait4 Syscalls
+subsystems: syscall, keywords: syscall wait4
+
+ The script watches each wait4 syscall on the system. At the end of
+ each wait4 syscall the script prints out a line with a timestamp in
+ microseconds, the pid, the executable name in paretheses, the
+ "wait4:" key, the duration of the wait and the PID that the wait4 was
+ waiting for. If the waited for PID is not specified , it is "-1".
+
+
+profiling/functioncallcount.stp - Count Times Functions Called
+subsystems: kernel, keywords: profiling functions
+
+ The functioncallcount.stp script takes one argument, a list of
+ functions to probe. The script will run and count the number of times
+ that each of the functions on the list is called. On exit the script
+ will print a sorted list from most frequently to least frequently
+ called function.
+
+
+profiling/thread-times.stp - Profile kernel functions
+subsystems: kernel, keywords: profiling
+
+ The thread-times.stp script sets up time-based sampling. Every five
+ seconds it prints out a sorted list with the top twenty processes
+ with samples broken down into percentage total time spent in
+ user-space and kernel-space.
+
+
diff --git a/testsuite/systemtap.examples/disktop.meta b/testsuite/systemtap.examples/io/disktop.meta
index b063075b..b063075b 100644
--- a/testsuite/systemtap.examples/disktop.meta
+++ b/testsuite/systemtap.examples/io/disktop.meta
diff --git a/testsuite/systemtap.examples/disktop.stp b/testsuite/systemtap.examples/io/disktop.stp
index 2637d735..2637d735 100644
--- a/testsuite/systemtap.examples/disktop.stp
+++ b/testsuite/systemtap.examples/io/disktop.stp
diff --git a/testsuite/systemtap.examples/io_submit.meta b/testsuite/systemtap.examples/io/io_submit.meta
index 911cb837..911cb837 100644
--- a/testsuite/systemtap.examples/io_submit.meta
+++ b/testsuite/systemtap.examples/io/io_submit.meta
diff --git a/testsuite/systemtap.examples/io_submit.stp b/testsuite/systemtap.examples/io/io_submit.stp
index 735dd6f9..735dd6f9 100644
--- a/testsuite/systemtap.examples/io_submit.stp
+++ b/testsuite/systemtap.examples/io/io_submit.stp
diff --git a/testsuite/systemtap.examples/iostat-scsi.stp b/testsuite/systemtap.examples/io/iostat-scsi.stp
index ef778e53..ef778e53 100755
--- a/testsuite/systemtap.examples/iostat-scsi.stp
+++ b/testsuite/systemtap.examples/io/iostat-scsi.stp
diff --git a/testsuite/systemtap.examples/iostat-scsi.txt b/testsuite/systemtap.examples/io/iostat-scsi.txt
index 8222f659..8222f659 100644
--- a/testsuite/systemtap.examples/iostat-scsi.txt
+++ b/testsuite/systemtap.examples/io/iostat-scsi.txt
diff --git a/testsuite/systemtap.examples/iotime.meta b/testsuite/systemtap.examples/io/iotime.meta
index f656ff85..f656ff85 100644
--- a/testsuite/systemtap.examples/iotime.meta
+++ b/testsuite/systemtap.examples/io/iotime.meta
diff --git a/testsuite/systemtap.examples/iotime.stp b/testsuite/systemtap.examples/io/iotime.stp
index 4fbd6b6e..4fbd6b6e 100755
--- a/testsuite/systemtap.examples/iotime.stp
+++ b/testsuite/systemtap.examples/io/iotime.stp
diff --git a/testsuite/systemtap.examples/iotop.meta b/testsuite/systemtap.examples/io/iotop.meta
index d5331eda..d5331eda 100644
--- a/testsuite/systemtap.examples/iotop.meta
+++ b/testsuite/systemtap.examples/io/iotop.meta
diff --git a/testsuite/systemtap.examples/iotop.stp b/testsuite/systemtap.examples/io/iotop.stp
index 6050343c..6050343c 100644
--- a/testsuite/systemtap.examples/iotop.stp
+++ b/testsuite/systemtap.examples/io/iotop.stp
diff --git a/testsuite/systemtap.examples/traceio.meta b/testsuite/systemtap.examples/io/traceio.meta
index da0b99f3..da0b99f3 100644
--- a/testsuite/systemtap.examples/traceio.meta
+++ b/testsuite/systemtap.examples/io/traceio.meta
diff --git a/testsuite/systemtap.examples/traceio.stp b/testsuite/systemtap.examples/io/traceio.stp
index d3757c23..d3757c23 100644
--- a/testsuite/systemtap.examples/traceio.stp
+++ b/testsuite/systemtap.examples/io/traceio.stp
diff --git a/testsuite/systemtap.examples/traceio2.meta b/testsuite/systemtap.examples/io/traceio2.meta
index 4b63108c..4b63108c 100644
--- a/testsuite/systemtap.examples/traceio2.meta
+++ b/testsuite/systemtap.examples/io/traceio2.meta
diff --git a/testsuite/systemtap.examples/traceio2.stp b/testsuite/systemtap.examples/io/traceio2.stp
index 656c38b3..656c38b3 100644
--- a/testsuite/systemtap.examples/traceio2.stp
+++ b/testsuite/systemtap.examples/io/traceio2.stp
diff --git a/testsuite/systemtap.examples/keyword-index.html b/testsuite/systemtap.examples/keyword-index.html
new file mode 100644
index 00000000..5d1c79e0
--- /dev/null
+++ b/testsuite/systemtap.examples/keyword-index.html
@@ -0,0 +1,258 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+ <title>SystemTap Examples</title>
+ <link rel="stylesheet" href="html/systemtap.css" type="text/css">
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+</head>
+
+<body>
+ <table cellspacing="2" cellpadding="2" border="0" width="100%">
+ <tr>
+ <td valign="bottom" height="80"><img src="html/systemtaplogo.png"
+ alt="SystemTap logo" width="165" height="25"></td>
+ <td valign="bottom" class="topnavright" align="right">
+ <a href="http://sourceware.org/systemtap/">SystemTap</a>&nbsp;|&nbsp;
+ </td>
+ </tr>
+ </table>
+
+ <div class="mainbackground">
+ <div class="maintextregion">
+ <img src="html/systemtapcorner.gif">
+ <table cellspacing="2" cellpadding="4" border="0" width="99%"
+ style="margin-top:17;">
+ <tr>
+ <td width="200">&nbsp;</td>
+ <td valign="bottom"><h1>Examples</h1></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td valign="top">
+
+ <h2>Example Indexes</h2>
+ <ul>
+ <li><a href="index.html">All Examples</a></li>
+ <li><a href="subsystem-index.html">By Subsystem</a></li>
+ <li><a href="keyword-index.html">By Keyword</a></li>
+ </ul>
+
+<h2>Examples by Keyword</h2>
+<p><tt><a href="#BACKTRACE">BACKTRACE</a> <a href="#CALLGRAPH">CALLGRAPH</a> <a href="#CPU">CPU</a> <a href="#DISK">DISK</a> <a href="#FUNCTIONS">FUNCTIONS</a> <a href="#FUTEX">FUTEX</a> <a href="#GRAPH">GRAPH</a> <a href="#IO">IO</a> <a href="#LOCKING">LOCKING</a> <a href="#NETWORK">NETWORK</a> <a href="#PER-PROCESS">PER-PROCESS</a> <a href="#PROFILING">PROFILING</a> <a href="#READ">READ</a> <a href="#SCHEDULER">SCHEDULER</a> <a href="#SIGNALS">SIGNALS</a> <a href="#SIMPLE">SIMPLE</a> <a href="#SLEEP">SLEEP</a> <a href="#SOCKET">SOCKET</a> <a href="#SYSCALL">SYSCALL</a> <a href="#TIME">TIME</a> <a href="#TRACE">TRACE</a> <a href="#TRAFFIC">TRAFFIC</a> <a href="#USE">USE</a> <a href="#WAIT4">WAIT4</a> <a href="#WRITE">WRITE</a> </tt></p>
+<h3><a name="BACKTRACE">BACKTRACE</a></h3>
+<ul>
+<li><a href="io/io_submit.stp">io/io_submit.stp</a> - Tally Reschedule Reason During AIO io_submit Call<br>
+subsystems: io, keywords: io backtrace<br>
+<p>When a reschedule occurs during an AIO io_submit call, accumulate the traceback in a histogram. When the script exits prints out a sorted list from most common to least common backtrace.</p></li>
+</ul>
+<h3><a name="CALLGRAPH">CALLGRAPH</a></h3>
+<ul>
+<li><a href="general/para-callgraph.stp">general/para-callgraph.stp</a> - Tracing Calls for Sections of Code<br>
+subsystems: kernel, keywords: trace callgraph<br>
+<p>The script takes two arguments: the first argument is the function to starts/stops the per thread call graph traces and the second argument is the list of functions to generate trace information on. The script prints out a timestap for the thread, the function name and pid, followed by entry or exit symboly and function name.</p></li>
+</ul>
+<h3><a name="CPU">CPU</a></h3>
+<ul>
+<li><a href="general/graphs.stp">general/graphs.stp</a> - Graphing Disk and CPU Utilization<br>
+subsystems: disk cpu, keywords: disk cpu use graph<br>
+<p>The script tracks the disk and CPU utilization. The resulting output of the script can be piped into gnuplot to generate a graph of disk and CPU USE.</p></li>
+</ul>
+<h3><a name="DISK">DISK</a></h3>
+<ul>
+<li><a href="general/graphs.stp">general/graphs.stp</a> - Graphing Disk and CPU Utilization<br>
+subsystems: disk cpu, keywords: disk cpu use graph<br>
+<p>The script tracks the disk and CPU utilization. The resulting output of the script can be piped into gnuplot to generate a graph of disk and CPU USE.</p></li>
+<li><a href="io/disktop.stp">io/disktop.stp</a> - Summarize Disk Read/Write Traffic<br>
+subsystems: disk, keywords: disk<br>
+<p>Get the status of reading/writing disk every 5 seconds, output top ten entries during that period.</p></li>
+</ul>
+<h3><a name="FUNCTIONS">FUNCTIONS</a></h3>
+<ul>
+<li><a href="profiling/functioncallcount.stp">profiling/functioncallcount.stp</a> - Count Times Functions Called<br>
+subsystems: kernel, keywords: profiling functions<br>
+<p>The functioncallcount.stp script takes one argument, a list of functions to probe. The script will run and count the number of times that each of the functions on the list is called. On exit the script will print a sorted list from most frequently to least frequently called function.</p></li>
+</ul>
+<h3><a name="FUTEX">FUTEX</a></h3>
+<ul>
+<li><a href="process/futexes.stp">process/futexes.stp</a> - System-Wide Futex Contention<br>
+subsystems: locking, keywords: syscall locking futex<br>
+<p>The script watches the futex syscall on the system. On exit the futexes address, the number of contentions, and the average time for each contention on the futex are printed from lowest pid number to highest.</p></li>
+</ul>
+<h3><a name="GRAPH">GRAPH</a></h3>
+<ul>
+<li><a href="general/graphs.stp">general/graphs.stp</a> - Graphing Disk and CPU Utilization<br>
+subsystems: disk cpu, keywords: disk cpu use graph<br>
+<p>The script tracks the disk and CPU utilization. The resulting output of the script can be piped into gnuplot to generate a graph of disk and CPU USE.</p></li>
+</ul>
+<h3><a name="IO">IO</a></h3>
+<ul>
+<li><a href="io/io_submit.stp">io/io_submit.stp</a> - Tally Reschedule Reason During AIO io_submit Call<br>
+subsystems: io, keywords: io backtrace<br>
+<p>When a reschedule occurs during an AIO io_submit call, accumulate the traceback in a histogram. When the script exits prints out a sorted list from most common to least common backtrace.</p></li>
+<li><a href="io/iotime.stp">io/iotime.stp</a> - Trace Time Spent in Read and Write for Files <br>
+subsystems: syscall, keywords: syscall read write time io<br>
+<p>The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spend in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parenthesese. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls.</p></li>
+<li><a href="io/iotop.stp">io/iotop.stp</a> - Periodically Print I/O Activity by Process Name<br>
+subsystems: io, keywords: io<br>
+<p>Every five seconds print out the top ten executables generating I/O traffic during that interval sorted in descending order.</p></li>
+<li><a href="io/traceio.stp">io/traceio.stp</a> - Track Cumulative I/O Activity by Process Name<br>
+subsystems: io, keywords: io<br>
+<p>Every second print out the top ten executables sorted in descending order based on cumulative I/O traffic observed.</p></li>
+<li><a href="io/traceio2.stp">io/traceio2.stp</a> - Watch I/O Activity on a Particular Device<br>
+subsystems: io, keywords: io<br>
+<p>Print out the executable name and process number as reads and writes to the specified device occur.</p></li>
+<li><a href="process/sleepingBeauties.stp">process/sleepingBeauties.stp</a> - Generating Backtraces of Threads Waiting for IO Operations<br>
+subsystems: scheduler, keywords: io scheduler<br>
+<p>The script monitor time threads spend waiting for IO operations (in "D" state) in the wait_for_completion function. If a thread spends over 10ms wall-clock time waiting, information is printed out describing the thread number and executable name. When slow the wait_for_completion function complete, backtraces for the long duration calls are printed out.</p></li>
+</ul>
+<h3><a name="LOCKING">LOCKING</a></h3>
+<ul>
+<li><a href="process/futexes.stp">process/futexes.stp</a> - System-Wide Futex Contention<br>
+subsystems: locking, keywords: syscall locking futex<br>
+<p>The script watches the futex syscall on the system. On exit the futexes address, the number of contentions, and the average time for each contention on the futex are printed from lowest pid number to highest.</p></li>
+</ul>
+<h3><a name="NETWORK">NETWORK</a></h3>
+<ul>
+<li><a href="network/nettop.stp">network/nettop.stp</a> - Periodic Listing of Processes Using Network Interfaces<br>
+subsystems: network, keywords: network traffic per-process<br>
+<p>Every five seconds the nettop.stp script prints out a list of processed (PID and command) with the number of packets sent/received and the amount of data sent/received by the process during that interval.</p></li>
+<li><a href="network/socket-trace.stp">network/socket-trace.stp</a> - Trace Functions called in Network Socket Code<br>
+subsystems: network, keywords: network socket<br>
+<p>The script instrument each of the functions inn the Linux kernel's net/socket.c file. The script prints out trace. The first element of a line is time delta in microseconds from the previous entry. This is followed by the command name and the PID. The "->" and "<-" indicates function entry and function exit, respectively. The last element of the line is the function name.</p></li>
+</ul>
+<h3><a name="PER-PROCESS">PER-PROCESS</a></h3>
+<ul>
+<li><a href="network/nettop.stp">network/nettop.stp</a> - Periodic Listing of Processes Using Network Interfaces<br>
+subsystems: network, keywords: network traffic per-process<br>
+<p>Every five seconds the nettop.stp script prints out a list of processed (PID and command) with the number of packets sent/received and the amount of data sent/received by the process during that interval.</p></li>
+</ul>
+<h3><a name="PROFILING">PROFILING</a></h3>
+<ul>
+<li><a href="process/pf2.stp">process/pf2.stp</a> - Profile kernel functions<br>
+subsystems: kernel, keywords: profiling<br>
+<p>The pf2.stp script sets up time-based sampling. Every five seconds it prints out a sorted list with the top ten kernel functions with samples.</p></li>
+<li><a href="profiling/functioncallcount.stp">profiling/functioncallcount.stp</a> - Count Times Functions Called<br>
+subsystems: kernel, keywords: profiling functions<br>
+<p>The functioncallcount.stp script takes one argument, a list of functions to probe. The script will run and count the number of times that each of the functions on the list is called. On exit the script will print a sorted list from most frequently to least frequently called function.</p></li>
+<li><a href="profiling/thread-times.stp">profiling/thread-times.stp</a> - Profile kernel functions<br>
+subsystems: kernel, keywords: profiling<br>
+<p>The thread-times.stp script sets up time-based sampling. Every five seconds it prints out a sorted list with the top twenty processes with samples broken down into percentage total time spent in user-space and kernel-space.</p></li>
+</ul>
+<h3><a name="READ">READ</a></h3>
+<ul>
+<li><a href="io/iotime.stp">io/iotime.stp</a> - Trace Time Spent in Read and Write for Files <br>
+subsystems: syscall, keywords: syscall read write time io<br>
+<p>The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spend in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parenthesese. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls.</p></li>
+</ul>
+<h3><a name="SCHEDULER">SCHEDULER</a></h3>
+<ul>
+<li><a href="process/sleepingBeauties.stp">process/sleepingBeauties.stp</a> - Generating Backtraces of Threads Waiting for IO Operations<br>
+subsystems: scheduler, keywords: io scheduler<br>
+<p>The script monitor time threads spend waiting for IO operations (in "D" state) in the wait_for_completion function. If a thread spends over 10ms wall-clock time waiting, information is printed out describing the thread number and executable name. When slow the wait_for_completion function complete, backtraces for the long duration calls are printed out.</p></li>
+</ul>
+<h3><a name="SIGNALS">SIGNALS</a></h3>
+<ul>
+<li><a href="process/sig_by_pid.stp">process/sig_by_pid.stp</a> - Signal Counts by Process ID<br>
+subsystems: signals, keywords: signals<br>
+<p>Print signal counts by process ID in descending order.</p></li>
+<li><a href="process/sig_by_proc.stp">process/sig_by_proc.stp</a> - Signal Counts by Process Name<br>
+subsystems: signals, keywords: signals<br>
+<p>Print signal counts by process name in descending order.</p></li>
+<li><a href="process/sigkill.stp">process/sigkill.stp</a> - Track SIGKILL Signals<br>
+subsystems: signals, keywords: signals<br>
+<p>The script traces any SIGKILL signals. When that SIGKILL signal is sent to a process, the script prints out the signal name, the desination executable and process ID, the executable name user ID that sent the signal.</p></li>
+<li><a href="process/syscalls_by_pid.stp">process/syscalls_by_pid.stp</a> - System-Wide Count of Syscalls by PID<br>
+subsystems: signals, keywords: signals<br>
+<p>The script watches for a particular signal sent to a specific process. When that signal is sent to the specified process, the script prints out the PID and executable of the process sending the signal, the PID and executable name of the process receiving the signal, and the signal number and name.</p></li>
+</ul>
+<h3><a name="SIMPLE">SIMPLE</a></h3>
+<ul>
+<li><a href="general/helloworld.stp">general/helloworld.stp</a> - SystemTap "Hello World" Program<br>
+subsystems: none, keywords: simple<br>
+<p>A basic "Hello World" program implemented in SystemTap script. It prints out "hello world" message and then immediately exits.</p></li>
+</ul>
+<h3><a name="SLEEP">SLEEP</a></h3>
+<ul>
+<li><a href="process/sleeptime.stp">process/sleeptime.stp</a> - Trace Time Spent in nanosleep Syscalls<br>
+subsystems: syscall, keywords: syscall sleep<br>
+<p>The script watches each nanosleep syscall on the system. At the end of each nanosleep syscall the script prints out a line with a timestamp in microseconds, the pid, the executable name in paretheses, the "nanosleep:" key, and the duration of the sleep in microseconds.</p></li>
+</ul>
+<h3><a name="SOCKET">SOCKET</a></h3>
+<ul>
+<li><a href="network/socket-trace.stp">network/socket-trace.stp</a> - Trace Functions called in Network Socket Code<br>
+subsystems: network, keywords: network socket<br>
+<p>The script instrument each of the functions inn the Linux kernel's net/socket.c file. The script prints out trace. The first element of a line is time delta in microseconds from the previous entry. This is followed by the command name and the PID. The "->" and "<-" indicates function entry and function exit, respectively. The last element of the line is the function name.</p></li>
+</ul>
+<h3><a name="SYSCALL">SYSCALL</a></h3>
+<ul>
+<li><a href="io/iotime.stp">io/iotime.stp</a> - Trace Time Spent in Read and Write for Files <br>
+subsystems: syscall, keywords: syscall read write time io<br>
+<p>The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spend in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parenthesese. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls.</p></li>
+<li><a href="process/futexes.stp">process/futexes.stp</a> - System-Wide Futex Contention<br>
+subsystems: locking, keywords: syscall locking futex<br>
+<p>The script watches the futex syscall on the system. On exit the futexes address, the number of contentions, and the average time for each contention on the futex are printed from lowest pid number to highest.</p></li>
+<li><a href="process/sleeptime.stp">process/sleeptime.stp</a> - Trace Time Spent in nanosleep Syscalls<br>
+subsystems: syscall, keywords: syscall sleep<br>
+<p>The script watches each nanosleep syscall on the system. At the end of each nanosleep syscall the script prints out a line with a timestamp in microseconds, the pid, the executable name in paretheses, the "nanosleep:" key, and the duration of the sleep in microseconds.</p></li>
+<li><a href="process/syscalls_by_pid.stp">process/syscalls_by_pid.stp</a> - System-Wide Count of Syscalls by PID<br>
+subsystems: syscall, keywords: syscall<br>
+<p>The script watches all syscall on the system. On exit the script prints a list showing the number of systemcalls executed by each PID ordered from greatest to least number of syscalls.</p></li>
+<li><a href="process/syscalls_by_proc.stp">process/syscalls_by_proc.stp</a> - System-Wide Count of Syscalls by Executable<br>
+subsystems: syscall, keywords: syscall<br>
+<p>The script watches all syscall on the system. On exit the script prints a list showing the number of systemcalls executed by each executable ordered from greates to least number of syscalls.</p></li>
+<li><a href="process/wait4time.stp">process/wait4time.stp</a> - Trace Time Spent in wait4 Syscalls<br>
+subsystems: syscall, keywords: syscall wait4<br>
+<p>The script watches each wait4 syscall on the system. At the end of each wait4 syscall the script prints out a line with a timestamp in microseconds, the pid, the executable name in paretheses, the "wait4:" key, the duration of the wait and the PID that the wait4 was waiting for. If the waited for PID is not specified , it is "-1".</p></li>
+</ul>
+<h3><a name="TIME">TIME</a></h3>
+<ul>
+<li><a href="io/iotime.stp">io/iotime.stp</a> - Trace Time Spent in Read and Write for Files <br>
+subsystems: syscall, keywords: syscall read write time io<br>
+<p>The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spend in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parenthesese. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls.</p></li>
+</ul>
+<h3><a name="TRACE">TRACE</a></h3>
+<ul>
+<li><a href="general/para-callgraph.stp">general/para-callgraph.stp</a> - Tracing Calls for Sections of Code<br>
+subsystems: kernel, keywords: trace callgraph<br>
+<p>The script takes two arguments: the first argument is the function to starts/stops the per thread call graph traces and the second argument is the list of functions to generate trace information on. The script prints out a timestap for the thread, the function name and pid, followed by entry or exit symboly and function name.</p></li>
+</ul>
+<h3><a name="TRAFFIC">TRAFFIC</a></h3>
+<ul>
+<li><a href="network/nettop.stp">network/nettop.stp</a> - Periodic Listing of Processes Using Network Interfaces<br>
+subsystems: network, keywords: network traffic per-process<br>
+<p>Every five seconds the nettop.stp script prints out a list of processed (PID and command) with the number of packets sent/received and the amount of data sent/received by the process during that interval.</p></li>
+</ul>
+<h3><a name="USE">USE</a></h3>
+<ul>
+<li><a href="general/graphs.stp">general/graphs.stp</a> - Graphing Disk and CPU Utilization<br>
+subsystems: disk cpu, keywords: disk cpu use graph<br>
+<p>The script tracks the disk and CPU utilization. The resulting output of the script can be piped into gnuplot to generate a graph of disk and CPU USE.</p></li>
+</ul>
+<h3><a name="WAIT4">WAIT4</a></h3>
+<ul>
+<li><a href="process/wait4time.stp">process/wait4time.stp</a> - Trace Time Spent in wait4 Syscalls<br>
+subsystems: syscall, keywords: syscall wait4<br>
+<p>The script watches each wait4 syscall on the system. At the end of each wait4 syscall the script prints out a line with a timestamp in microseconds, the pid, the executable name in paretheses, the "wait4:" key, the duration of the wait and the PID that the wait4 was waiting for. If the waited for PID is not specified , it is "-1".</p></li>
+</ul>
+<h3><a name="WRITE">WRITE</a></h3>
+<ul>
+<li><a href="io/iotime.stp">io/iotime.stp</a> - Trace Time Spent in Read and Write for Files <br>
+subsystems: syscall, keywords: syscall read write time io<br>
+<p>The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spend in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parenthesese. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls.</p></li>
+</ul>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+
+ <table cellspacing="2" cellpadding="2" border="0" width="100%">
+ <tr>
+ <td align="center" class="footer"><a href=
+ "http://sourceware.org/systemtap">SystemTap</a></td>
+ </tr>
+ </table>
+</body>
+</html>
diff --git a/testsuite/systemtap.examples/keyword-index.txt b/testsuite/systemtap.examples/keyword-index.txt
new file mode 100644
index 00000000..d2e20148
--- /dev/null
+++ b/testsuite/systemtap.examples/keyword-index.txt
@@ -0,0 +1,458 @@
+SYSTEMTAP EXAMPLES INDEX BY KEYWORD
+(see also index.txt, subsystem-index.txt)
+
+= BACKTRACE =
+
+io/io_submit.stp - Tally Reschedule Reason During AIO io_submit Call
+subsystems: io, keywords: io backtrace
+
+ When a reschedule occurs during an AIO io_submit call, accumulate the
+ traceback in a histogram. When the script exits prints out a sorted
+ list from most common to least common backtrace.
+
+
+= CALLGRAPH =
+
+general/para-callgraph.stp - Tracing Calls for Sections of Code
+subsystems: kernel, keywords: trace callgraph
+
+ The script takes two arguments: the first argument is the function to
+ starts/stops the per thread call graph traces and the second argument
+ is the list of functions to generate trace information on. The script
+ prints out a timestap for the thread, the function name and pid,
+ followed by entry or exit symboly and function name.
+
+
+= CPU =
+
+general/graphs.stp - Graphing Disk and CPU Utilization
+subsystems: disk cpu, keywords: disk cpu use graph
+
+ The script tracks the disk and CPU utilization. The resulting output
+ of the script can be piped into gnuplot to generate a graph of disk
+ and CPU USE.
+
+
+= DISK =
+
+general/graphs.stp - Graphing Disk and CPU Utilization
+subsystems: disk cpu, keywords: disk cpu use graph
+
+ The script tracks the disk and CPU utilization. The resulting output
+ of the script can be piped into gnuplot to generate a graph of disk
+ and CPU USE.
+
+
+io/disktop.stp - Summarize Disk Read/Write Traffic
+subsystems: disk, keywords: disk
+
+ Get the status of reading/writing disk every 5 seconds, output top
+ ten entries during that period.
+
+
+= FUNCTIONS =
+
+profiling/functioncallcount.stp - Count Times Functions Called
+subsystems: kernel, keywords: profiling functions
+
+ The functioncallcount.stp script takes one argument, a list of
+ functions to probe. The script will run and count the number of times
+ that each of the functions on the list is called. On exit the script
+ will print a sorted list from most frequently to least frequently
+ called function.
+
+
+= FUTEX =
+
+process/futexes.stp - System-Wide Futex Contention
+subsystems: locking, keywords: syscall locking futex
+
+ The script watches the futex syscall on the system. On exit the
+ futexes address, the number of contentions, and the average time for
+ each contention on the futex are printed from lowest pid number to
+ highest.
+
+
+= GRAPH =
+
+general/graphs.stp - Graphing Disk and CPU Utilization
+subsystems: disk cpu, keywords: disk cpu use graph
+
+ The script tracks the disk and CPU utilization. The resulting output
+ of the script can be piped into gnuplot to generate a graph of disk
+ and CPU USE.
+
+
+= IO =
+
+io/io_submit.stp - Tally Reschedule Reason During AIO io_submit Call
+subsystems: io, keywords: io backtrace
+
+ When a reschedule occurs during an AIO io_submit call, accumulate the
+ traceback in a histogram. When the script exits prints out a sorted
+ list from most common to least common backtrace.
+
+
+io/iotime.stp - Trace Time Spent in Read and Write for Files
+subsystems: syscall, keywords: syscall read write time io
+
+ The script watches each open, close, read, and write syscalls on the
+ system. For each file the scripts observes opened it accumulates the
+ amount of wall clock time spend in read and write operations and the
+ number of bytes read and written. When a file is closed the script
+ prints out a pair of lines for the file. Both lines begin with a
+ timestamp in microseconds, the PID number, and the executable name in
+ parenthesese. The first line with the "access" keyword lists the file
+ name, the attempted number of bytes for the read and write
+ operations. The second line with the "iotime" keyword list the file
+ name and the number of microseconds accumulated in the read and write
+ syscalls.
+
+
+io/iotop.stp - Periodically Print I/O Activity by Process Name
+subsystems: io, keywords: io
+
+ Every five seconds print out the top ten executables generating I/O
+ traffic during that interval sorted in descending order.
+
+
+io/traceio.stp - Track Cumulative I/O Activity by Process Name
+subsystems: io, keywords: io
+
+ Every second print out the top ten executables sorted in descending
+ order based on cumulative I/O traffic observed.
+
+
+io/traceio2.stp - Watch I/O Activity on a Particular Device
+subsystems: io, keywords: io
+
+ Print out the executable name and process number as reads and writes
+ to the specified device occur.
+
+
+process/sleepingBeauties.stp - Generating Backtraces of Threads Waiting for IO Operations
+subsystems: scheduler, keywords: io scheduler
+
+ The script monitor time threads spend waiting for IO operations (in
+ "D" state) in the wait_for_completion function. If a thread spends
+ over 10ms wall-clock time waiting, information is printed out
+ describing the thread number and executable name. When slow the
+ wait_for_completion function complete, backtraces for the long
+ duration calls are printed out.
+
+
+= LOCKING =
+
+process/futexes.stp - System-Wide Futex Contention
+subsystems: locking, keywords: syscall locking futex
+
+ The script watches the futex syscall on the system. On exit the
+ futexes address, the number of contentions, and the average time for
+ each contention on the futex are printed from lowest pid number to
+ highest.
+
+
+= NETWORK =
+
+network/nettop.stp - Periodic Listing of Processes Using Network Interfaces
+subsystems: network, keywords: network traffic per-process
+
+ Every five seconds the nettop.stp script prints out a list of
+ processed (PID and command) with the number of packets sent/received
+ and the amount of data sent/received by the process during that
+ interval.
+
+
+network/socket-trace.stp - Trace Functions called in Network Socket Code
+subsystems: network, keywords: network socket
+
+ The script instrument each of the functions inn the Linux kernel's
+ net/socket.c file. The script prints out trace. The first element of
+ a line is time delta in microseconds from the previous entry. This
+ is followed by the command name and the PID. The "->" and "<-"
+ indicates function entry and function exit, respectively. The last
+ element of the line is the function name.
+
+
+= PER-PROCESS =
+
+network/nettop.stp - Periodic Listing of Processes Using Network Interfaces
+subsystems: network, keywords: network traffic per-process
+
+ Every five seconds the nettop.stp script prints out a list of
+ processed (PID and command) with the number of packets sent/received
+ and the amount of data sent/received by the process during that
+ interval.
+
+
+= PROFILING =
+
+process/pf2.stp - Profile kernel functions
+subsystems: kernel, keywords: profiling
+
+ The pf2.stp script sets up time-based sampling. Every five seconds it
+ prints out a sorted list with the top ten kernel functions with
+ samples.
+
+
+profiling/functioncallcount.stp - Count Times Functions Called
+subsystems: kernel, keywords: profiling functions
+
+ The functioncallcount.stp script takes one argument, a list of
+ functions to probe. The script will run and count the number of times
+ that each of the functions on the list is called. On exit the script
+ will print a sorted list from most frequently to least frequently
+ called function.
+
+
+profiling/thread-times.stp - Profile kernel functions
+subsystems: kernel, keywords: profiling
+
+ The thread-times.stp script sets up time-based sampling. Every five
+ seconds it prints out a sorted list with the top twenty processes
+ with samples broken down into percentage total time spent in
+ user-space and kernel-space.
+
+
+= READ =
+
+io/iotime.stp - Trace Time Spent in Read and Write for Files
+subsystems: syscall, keywords: syscall read write time io
+
+ The script watches each open, close, read, and write syscalls on the
+ system. For each file the scripts observes opened it accumulates the
+ amount of wall clock time spend in read and write operations and the
+ number of bytes read and written. When a file is closed the script
+ prints out a pair of lines for the file. Both lines begin with a
+ timestamp in microseconds, the PID number, and the executable name in
+ parenthesese. The first line with the "access" keyword lists the file
+ name, the attempted number of bytes for the read and write
+ operations. The second line with the "iotime" keyword list the file
+ name and the number of microseconds accumulated in the read and write
+ syscalls.
+
+
+= SCHEDULER =
+
+process/sleepingBeauties.stp - Generating Backtraces of Threads Waiting for IO Operations
+subsystems: scheduler, keywords: io scheduler
+
+ The script monitor time threads spend waiting for IO operations (in
+ "D" state) in the wait_for_completion function. If a thread spends
+ over 10ms wall-clock time waiting, information is printed out
+ describing the thread number and executable name. When slow the
+ wait_for_completion function complete, backtraces for the long
+ duration calls are printed out.
+
+
+= SIGNALS =
+
+process/sig_by_pid.stp - Signal Counts by Process ID
+subsystems: signals, keywords: signals
+
+ Print signal counts by process ID in descending order.
+
+
+process/sig_by_proc.stp - Signal Counts by Process Name
+subsystems: signals, keywords: signals
+
+ Print signal counts by process name in descending order.
+
+
+process/sigkill.stp - Track SIGKILL Signals
+subsystems: signals, keywords: signals
+
+ The script traces any SIGKILL signals. When that SIGKILL signal is
+ sent to a process, the script prints out the signal name, the
+ desination executable and process ID, the executable name user ID
+ that sent the signal.
+
+
+process/syscalls_by_pid.stp - System-Wide Count of Syscalls by PID
+subsystems: signals, keywords: signals
+
+ The script watches for a particular signal sent to a specific
+ process. When that signal is sent to the specified process, the
+ script prints out the PID and executable of the process sending the
+ signal, the PID and executable name of the process receiving the
+ signal, and the signal number and name.
+
+
+= SIMPLE =
+
+general/helloworld.stp - SystemTap "Hello World" Program
+subsystems: none, keywords: simple
+
+ A basic "Hello World" program implemented in SystemTap script. It
+ prints out "hello world" message and then immediately exits.
+
+
+= SLEEP =
+
+process/sleeptime.stp - Trace Time Spent in nanosleep Syscalls
+subsystems: syscall, keywords: syscall sleep
+
+ The script watches each nanosleep syscall on the system. At the end
+ of each nanosleep syscall the script prints out a line with a
+ timestamp in microseconds, the pid, the executable name in
+ paretheses, the "nanosleep:" key, and the duration of the sleep in
+ microseconds.
+
+
+= SOCKET =
+
+network/socket-trace.stp - Trace Functions called in Network Socket Code
+subsystems: network, keywords: network socket
+
+ The script instrument each of the functions inn the Linux kernel's
+ net/socket.c file. The script prints out trace. The first element of
+ a line is time delta in microseconds from the previous entry. This
+ is followed by the command name and the PID. The "->" and "<-"
+ indicates function entry and function exit, respectively. The last
+ element of the line is the function name.
+
+
+= SYSCALL =
+
+io/iotime.stp - Trace Time Spent in Read and Write for Files
+subsystems: syscall, keywords: syscall read write time io
+
+ The script watches each open, close, read, and write syscalls on the
+ system. For each file the scripts observes opened it accumulates the
+ amount of wall clock time spend in read and write operations and the
+ number of bytes read and written. When a file is closed the script
+ prints out a pair of lines for the file. Both lines begin with a
+ timestamp in microseconds, the PID number, and the executable name in
+ parenthesese. The first line with the "access" keyword lists the file
+ name, the attempted number of bytes for the read and write
+ operations. The second line with the "iotime" keyword list the file
+ name and the number of microseconds accumulated in the read and write
+ syscalls.
+
+
+process/futexes.stp - System-Wide Futex Contention
+subsystems: locking, keywords: syscall locking futex
+
+ The script watches the futex syscall on the system. On exit the
+ futexes address, the number of contentions, and the average time for
+ each contention on the futex are printed from lowest pid number to
+ highest.
+
+
+process/sleeptime.stp - Trace Time Spent in nanosleep Syscalls
+subsystems: syscall, keywords: syscall sleep
+
+ The script watches each nanosleep syscall on the system. At the end
+ of each nanosleep syscall the script prints out a line with a
+ timestamp in microseconds, the pid, the executable name in
+ paretheses, the "nanosleep:" key, and the duration of the sleep in
+ microseconds.
+
+
+process/syscalls_by_pid.stp - System-Wide Count of Syscalls by PID
+subsystems: syscall, keywords: syscall
+
+ The script watches all syscall on the system. On exit the script
+ prints a list showing the number of systemcalls executed by each PID
+ ordered from greatest to least number of syscalls.
+
+
+process/syscalls_by_proc.stp - System-Wide Count of Syscalls by Executable
+subsystems: syscall, keywords: syscall
+
+ The script watches all syscall on the system. On exit the script
+ prints a list showing the number of systemcalls executed by each
+ executable ordered from greates to least number of syscalls.
+
+
+process/wait4time.stp - Trace Time Spent in wait4 Syscalls
+subsystems: syscall, keywords: syscall wait4
+
+ The script watches each wait4 syscall on the system. At the end of
+ each wait4 syscall the script prints out a line with a timestamp in
+ microseconds, the pid, the executable name in paretheses, the
+ "wait4:" key, the duration of the wait and the PID that the wait4 was
+ waiting for. If the waited for PID is not specified , it is "-1".
+
+
+= TIME =
+
+io/iotime.stp - Trace Time Spent in Read and Write for Files
+subsystems: syscall, keywords: syscall read write time io
+
+ The script watches each open, close, read, and write syscalls on the
+ system. For each file the scripts observes opened it accumulates the
+ amount of wall clock time spend in read and write operations and the
+ number of bytes read and written. When a file is closed the script
+ prints out a pair of lines for the file. Both lines begin with a
+ timestamp in microseconds, the PID number, and the executable name in
+ parenthesese. The first line with the "access" keyword lists the file
+ name, the attempted number of bytes for the read and write
+ operations. The second line with the "iotime" keyword list the file
+ name and the number of microseconds accumulated in the read and write
+ syscalls.
+
+
+= TRACE =
+
+general/para-callgraph.stp - Tracing Calls for Sections of Code
+subsystems: kernel, keywords: trace callgraph
+
+ The script takes two arguments: the first argument is the function to
+ starts/stops the per thread call graph traces and the second argument
+ is the list of functions to generate trace information on. The script
+ prints out a timestap for the thread, the function name and pid,
+ followed by entry or exit symboly and function name.
+
+
+= TRAFFIC =
+
+network/nettop.stp - Periodic Listing of Processes Using Network Interfaces
+subsystems: network, keywords: network traffic per-process
+
+ Every five seconds the nettop.stp script prints out a list of
+ processed (PID and command) with the number of packets sent/received
+ and the amount of data sent/received by the process during that
+ interval.
+
+
+= USE =
+
+general/graphs.stp - Graphing Disk and CPU Utilization
+subsystems: disk cpu, keywords: disk cpu use graph
+
+ The script tracks the disk and CPU utilization. The resulting output
+ of the script can be piped into gnuplot to generate a graph of disk
+ and CPU USE.
+
+
+= WAIT4 =
+
+process/wait4time.stp - Trace Time Spent in wait4 Syscalls
+subsystems: syscall, keywords: syscall wait4
+
+ The script watches each wait4 syscall on the system. At the end of
+ each wait4 syscall the script prints out a line with a timestamp in
+ microseconds, the pid, the executable name in paretheses, the
+ "wait4:" key, the duration of the wait and the PID that the wait4 was
+ waiting for. If the waited for PID is not specified , it is "-1".
+
+
+= WRITE =
+
+io/iotime.stp - Trace Time Spent in Read and Write for Files
+subsystems: syscall, keywords: syscall read write time io
+
+ The script watches each open, close, read, and write syscalls on the
+ system. For each file the scripts observes opened it accumulates the
+ amount of wall clock time spend in read and write operations and the
+ number of bytes read and written. When a file is closed the script
+ prints out a pair of lines for the file. Both lines begin with a
+ timestamp in microseconds, the PID number, and the executable name in
+ parenthesese. The first line with the "access" keyword lists the file
+ name, the attempted number of bytes for the read and write
+ operations. The second line with the "iotime" keyword list the file
+ name and the number of microseconds accumulated in the read and write
+ syscalls.
+
+
diff --git a/testsuite/systemtap.examples/nettop.meta b/testsuite/systemtap.examples/network/nettop.meta
index 61d1c153..61d1c153 100644
--- a/testsuite/systemtap.examples/nettop.meta
+++ b/testsuite/systemtap.examples/network/nettop.meta
diff --git a/testsuite/systemtap.examples/nettop.stp b/testsuite/systemtap.examples/network/nettop.stp
index 96db413a..96db413a 100755
--- a/testsuite/systemtap.examples/nettop.stp
+++ b/testsuite/systemtap.examples/network/nettop.stp
diff --git a/testsuite/systemtap.examples/nettop.txt b/testsuite/systemtap.examples/network/nettop.txt
index 2bfd4967..2bfd4967 100644
--- a/testsuite/systemtap.examples/nettop.txt
+++ b/testsuite/systemtap.examples/network/nettop.txt
diff --git a/testsuite/systemtap.examples/socket-trace.meta b/testsuite/systemtap.examples/network/socket-trace.meta
index 0b26f2fe..0b26f2fe 100644
--- a/testsuite/systemtap.examples/socket-trace.meta
+++ b/testsuite/systemtap.examples/network/socket-trace.meta
diff --git a/testsuite/systemtap.examples/socket-trace.stp b/testsuite/systemtap.examples/network/socket-trace.stp
index 13ab8e06..13ab8e06 100755
--- a/testsuite/systemtap.examples/socket-trace.stp
+++ b/testsuite/systemtap.examples/network/socket-trace.stp
diff --git a/testsuite/systemtap.examples/socktop b/testsuite/systemtap.examples/network/socktop
index 123e37e9..123e37e9 100755
--- a/testsuite/systemtap.examples/socktop
+++ b/testsuite/systemtap.examples/network/socktop
diff --git a/testsuite/systemtap.examples/socktop.txt b/testsuite/systemtap.examples/network/socktop.txt
index 0ebce003..0ebce003 100644
--- a/testsuite/systemtap.examples/socktop.txt
+++ b/testsuite/systemtap.examples/network/socktop.txt
diff --git a/testsuite/systemtap.examples/futexes.meta b/testsuite/systemtap.examples/process/futexes.meta
index 0a34b2d8..ff303122 100644
--- a/testsuite/systemtap.examples/futexes.meta
+++ b/testsuite/systemtap.examples/process/futexes.meta
@@ -1,5 +1,5 @@
title: System-Wide Futex Contention
-name: futex.stp
+name: futexes.stp
version: 1.0
author: anonymous
keywords: syscall locking futex
diff --git a/testsuite/systemtap.examples/futexes.stp b/testsuite/systemtap.examples/process/futexes.stp
index 16c62937..16c62937 100755
--- a/testsuite/systemtap.examples/futexes.stp
+++ b/testsuite/systemtap.examples/process/futexes.stp
diff --git a/testsuite/systemtap.examples/futexes.txt b/testsuite/systemtap.examples/process/futexes.txt
index 51de4352..51de4352 100644
--- a/testsuite/systemtap.examples/futexes.txt
+++ b/testsuite/systemtap.examples/process/futexes.txt
diff --git a/testsuite/systemtap.examples/pf2.meta b/testsuite/systemtap.examples/process/pf2.meta
index d0a534bd..d0a534bd 100644
--- a/testsuite/systemtap.examples/pf2.meta
+++ b/testsuite/systemtap.examples/process/pf2.meta
diff --git a/testsuite/systemtap.examples/pf2.stp b/testsuite/systemtap.examples/process/pf2.stp
index a804c3ff..a804c3ff 100755
--- a/testsuite/systemtap.examples/pf2.stp
+++ b/testsuite/systemtap.examples/process/pf2.stp
diff --git a/testsuite/systemtap.examples/pf2.txt b/testsuite/systemtap.examples/process/pf2.txt
index 0fafe17e..0fafe17e 100644
--- a/testsuite/systemtap.examples/pf2.txt
+++ b/testsuite/systemtap.examples/process/pf2.txt
diff --git a/testsuite/systemtap.examples/small_demos/proc_snoop.stp b/testsuite/systemtap.examples/process/proc_snoop.stp
index 24499b4b..24499b4b 100755
--- a/testsuite/systemtap.examples/small_demos/proc_snoop.stp
+++ b/testsuite/systemtap.examples/process/proc_snoop.stp
diff --git a/testsuite/systemtap.examples/sig_by_pid.meta b/testsuite/systemtap.examples/process/sig_by_pid.meta
index 03b02fba..03b02fba 100644
--- a/testsuite/systemtap.examples/sig_by_pid.meta
+++ b/testsuite/systemtap.examples/process/sig_by_pid.meta
diff --git a/testsuite/systemtap.examples/sig_by_pid.stp b/testsuite/systemtap.examples/process/sig_by_pid.stp
index 9c1493f5..9c1493f5 100755
--- a/testsuite/systemtap.examples/sig_by_pid.stp
+++ b/testsuite/systemtap.examples/process/sig_by_pid.stp
diff --git a/testsuite/systemtap.examples/sig_by_pid.txt b/testsuite/systemtap.examples/process/sig_by_pid.txt
index 927b4607..927b4607 100644
--- a/testsuite/systemtap.examples/sig_by_pid.txt
+++ b/testsuite/systemtap.examples/process/sig_by_pid.txt
diff --git a/testsuite/systemtap.examples/sig_by_proc.meta b/testsuite/systemtap.examples/process/sig_by_proc.meta
index eea42be4..eea42be4 100644
--- a/testsuite/systemtap.examples/sig_by_proc.meta
+++ b/testsuite/systemtap.examples/process/sig_by_proc.meta
diff --git a/testsuite/systemtap.examples/sig_by_proc.stp b/testsuite/systemtap.examples/process/sig_by_proc.stp
index ce845aed..ce845aed 100755
--- a/testsuite/systemtap.examples/sig_by_proc.stp
+++ b/testsuite/systemtap.examples/process/sig_by_proc.stp
diff --git a/testsuite/systemtap.examples/sig_by_proc.txt b/testsuite/systemtap.examples/process/sig_by_proc.txt
index d09da9fe..d09da9fe 100644
--- a/testsuite/systemtap.examples/sig_by_proc.txt
+++ b/testsuite/systemtap.examples/process/sig_by_proc.txt
diff --git a/testsuite/systemtap.examples/sigkill.meta b/testsuite/systemtap.examples/process/sigkill.meta
index 57032224..57032224 100644
--- a/testsuite/systemtap.examples/sigkill.meta
+++ b/testsuite/systemtap.examples/process/sigkill.meta
diff --git a/testsuite/systemtap.examples/sigkill.stp b/testsuite/systemtap.examples/process/sigkill.stp
index 8f754219..8f754219 100644
--- a/testsuite/systemtap.examples/sigkill.stp
+++ b/testsuite/systemtap.examples/process/sigkill.stp
diff --git a/testsuite/systemtap.examples/sigmon.meta b/testsuite/systemtap.examples/process/sigmon.meta
index 18834997..18834997 100644
--- a/testsuite/systemtap.examples/sigmon.meta
+++ b/testsuite/systemtap.examples/process/sigmon.meta
diff --git a/testsuite/systemtap.examples/sigmon.stp b/testsuite/systemtap.examples/process/sigmon.stp
index 31d7822e..31d7822e 100755
--- a/testsuite/systemtap.examples/sigmon.stp
+++ b/testsuite/systemtap.examples/process/sigmon.stp
diff --git a/testsuite/systemtap.examples/sleepingBeauties.meta b/testsuite/systemtap.examples/process/sleepingBeauties.meta
index 95e08361..95e08361 100644
--- a/testsuite/systemtap.examples/sleepingBeauties.meta
+++ b/testsuite/systemtap.examples/process/sleepingBeauties.meta
diff --git a/testsuite/systemtap.examples/sleepingBeauties.stp b/testsuite/systemtap.examples/process/sleepingBeauties.stp
index 64c563a3..64c563a3 100644
--- a/testsuite/systemtap.examples/sleepingBeauties.stp
+++ b/testsuite/systemtap.examples/process/sleepingBeauties.stp
diff --git a/testsuite/systemtap.examples/sleeptime.meta b/testsuite/systemtap.examples/process/sleeptime.meta
index d6c59345..d6c59345 100644
--- a/testsuite/systemtap.examples/sleeptime.meta
+++ b/testsuite/systemtap.examples/process/sleeptime.meta
diff --git a/testsuite/systemtap.examples/sleeptime.stp b/testsuite/systemtap.examples/process/sleeptime.stp
index b5729ceb..b5729ceb 100755
--- a/testsuite/systemtap.examples/sleeptime.stp
+++ b/testsuite/systemtap.examples/process/sleeptime.stp
diff --git a/testsuite/systemtap.examples/syscalls_by_pid.meta b/testsuite/systemtap.examples/process/syscalls_by_pid.meta
index 590652b3..590652b3 100644
--- a/testsuite/systemtap.examples/syscalls_by_pid.meta
+++ b/testsuite/systemtap.examples/process/syscalls_by_pid.meta
diff --git a/testsuite/systemtap.examples/syscalls_by_pid.stp b/testsuite/systemtap.examples/process/syscalls_by_pid.stp
index 47aa4955..47aa4955 100755
--- a/testsuite/systemtap.examples/syscalls_by_pid.stp
+++ b/testsuite/systemtap.examples/process/syscalls_by_pid.stp
diff --git a/testsuite/systemtap.examples/syscalls_by_pid.txt b/testsuite/systemtap.examples/process/syscalls_by_pid.txt
index 4943a139..4943a139 100644
--- a/testsuite/systemtap.examples/syscalls_by_pid.txt
+++ b/testsuite/systemtap.examples/process/syscalls_by_pid.txt
diff --git a/testsuite/systemtap.examples/syscalls_by_proc.meta b/testsuite/systemtap.examples/process/syscalls_by_proc.meta
index 79aa3e87..79aa3e87 100644
--- a/testsuite/systemtap.examples/syscalls_by_proc.meta
+++ b/testsuite/systemtap.examples/process/syscalls_by_proc.meta
diff --git a/testsuite/systemtap.examples/syscalls_by_proc.stp b/testsuite/systemtap.examples/process/syscalls_by_proc.stp
index af7d6932..af7d6932 100755
--- a/testsuite/systemtap.examples/syscalls_by_proc.stp
+++ b/testsuite/systemtap.examples/process/syscalls_by_proc.stp
diff --git a/testsuite/systemtap.examples/syscalls_by_proc.txt b/testsuite/systemtap.examples/process/syscalls_by_proc.txt
index dd554083..dd554083 100644
--- a/testsuite/systemtap.examples/syscalls_by_proc.txt
+++ b/testsuite/systemtap.examples/process/syscalls_by_proc.txt
diff --git a/testsuite/systemtap.examples/syscalltimes b/testsuite/systemtap.examples/process/syscalltimes
index 84ca77a9..84ca77a9 100755
--- a/testsuite/systemtap.examples/syscalltimes
+++ b/testsuite/systemtap.examples/process/syscalltimes
diff --git a/testsuite/systemtap.examples/syscalltimes.txt b/testsuite/systemtap.examples/process/syscalltimes.txt
index d50f73ad..d50f73ad 100644
--- a/testsuite/systemtap.examples/syscalltimes.txt
+++ b/testsuite/systemtap.examples/process/syscalltimes.txt
diff --git a/testsuite/systemtap.examples/wait4time.meta b/testsuite/systemtap.examples/process/wait4time.meta
index a939d466..a939d466 100644
--- a/testsuite/systemtap.examples/wait4time.meta
+++ b/testsuite/systemtap.examples/process/wait4time.meta
diff --git a/testsuite/systemtap.examples/wait4time.stp b/testsuite/systemtap.examples/process/wait4time.stp
index ba300ea7..ba300ea7 100755
--- a/testsuite/systemtap.examples/wait4time.stp
+++ b/testsuite/systemtap.examples/process/wait4time.stp
diff --git a/testsuite/systemtap.examples/functioncallcount.meta b/testsuite/systemtap.examples/profiling/functioncallcount.meta
index 4d419528..4d419528 100644
--- a/testsuite/systemtap.examples/functioncallcount.meta
+++ b/testsuite/systemtap.examples/profiling/functioncallcount.meta
diff --git a/testsuite/systemtap.examples/functioncallcount.stp b/testsuite/systemtap.examples/profiling/functioncallcount.stp
index e393b612..e393b612 100644
--- a/testsuite/systemtap.examples/functioncallcount.stp
+++ b/testsuite/systemtap.examples/profiling/functioncallcount.stp
diff --git a/testsuite/systemtap.examples/thread-times.meta b/testsuite/systemtap.examples/profiling/thread-times.meta
index fcbf062e..fcbf062e 100644
--- a/testsuite/systemtap.examples/thread-times.meta
+++ b/testsuite/systemtap.examples/profiling/thread-times.meta
diff --git a/testsuite/systemtap.examples/thread-times.stp b/testsuite/systemtap.examples/profiling/thread-times.stp
index 1aeb2037..1aeb2037 100644
--- a/testsuite/systemtap.examples/thread-times.stp
+++ b/testsuite/systemtap.examples/profiling/thread-times.stp
diff --git a/testsuite/systemtap.examples/small_demos/close.stp b/testsuite/systemtap.examples/small_demos/close.stp
deleted file mode 100755
index 7ba2a036..00000000
--- a/testsuite/systemtap.examples/small_demos/close.stp
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env stap
-
-probe syscall.close {
- printf("%s: %s(%s) = ", execname(), name, argstr)
-}
-
-probe syscall.close.return {
- printf("%s\n", returnstr(returnp))
-}
-
-probe end {
- printf("DONE\n")
-}
-
diff --git a/testsuite/systemtap.examples/small_demos/demo_script.txt b/testsuite/systemtap.examples/small_demos/demo_script.txt
deleted file mode 100644
index f3166a49..00000000
--- a/testsuite/systemtap.examples/small_demos/demo_script.txt
+++ /dev/null
@@ -1,102 +0,0 @@
-> cd /root/systemtap
-
-A systemtap script can be as simple as a single line. For example,
-the following script places a probepoint on the kernel sys_read()
-function and prints all callers with the function's arguments.
-
->stap -e 'probe syscall.open {printf("%s: %s\n", execname(), argstr)}'
-
-Most scripts are a bit longer. (show top.stp)
-This script sets a probepoint on all kernel functions beginning with "sys_".
-When the probepoint is hit, it increments an entry in the map
-(or associative array) "syscalls" with the key "probefunc()" which returns
-the name of the function that was triggered. For example, "sys_read".
-
-There is a timer that is triggered every 5000ms or 5 seconds. That timer
-calls the function print_top(). print_top() sorts the syscalls map
-and prints the top 20 entries. Then it clears the map.
-
-> ./top.stp
-
-(after stopping "top" go ahead and enter "./sys.stp". It takes a minute
-to load this script. Diplay the source in another window and talk
-while it is loading.)
-
-The "top" script looked only at the functions called. If we want more
-detail about the functions, we can use systemtap to examine their local
-arguments and variables. However that would be difficult because each
-system call has different parameters. The Syscall Tapset solves
-this problem. To use it, we set probe points using the syntax "syscall.name"
-instead of kernel.function("sys_name"). The Syscall Tapset provides three
-defined variables we can use:
-name - the name of the function
-argstr - on function entry, a formatted string containing the arguments
-retstr - on function exit, the return value and possibly error code
-
-In this example, we filter out programs named "staprun" because this is
-part of the systemtap infrastructure. (It may be filtered out
-automatically in the future.)
-
-The next example shows how you can use systemtap to focus on
-specific programs or pids. (show prof.stp)
-
-Like the "top" example, this script places probes on all kernel
-functions starting with "sys_". Only the probepoint also checks to see
-if the tid/pid matches the one returned by "target()". We'll show how
-the target pid is set later.
-
-Unlike the previous examples, this script sets a probe point on all the
-system call returns. When triggered, this probepoint computes the elapsed
-time since the function entry.
-
-To run this script, we must give it a pid to use for the target, or a
-program to run, in which case target will be its pid.
-
-> ./prof.stp -c "top -n5"
-
---------------------------------
-
-Systemtap can also run in an unsafe mode where you can give
-it arbitrary C code to run at probepoints, or modify kernel variables
-and structures. This is very dangerous so only experts with root access will
-ever be permitted to do this.
-
-(show keyhack.stp)
-
-The next example will modify the local variable "keycode" in the "kdb_keycode"
-function in the kernel driver. We indicate it is a local variable by putting
-a dollar sign before the name.
-
-./keyhack.stp
-
-(prints error message)
-
-To tell systemtap we really want to run this script, we must use the "-g" flag.
-
-./keyhack.stp -g
-
-(type some keys. "m" should display as "b" in every window)
-
-This example is not something you would normally want to do. There are
-far better ways to remap a keyboard. What it demonstartes is that Systemtap
-can modify variables in a running kernel.
-
-(show kmalloc.stp)
-This next script shows the kind of statistics systemtap can collect.
-It collects information about kernel allocations.
-
-> ./kmalloc.stp
-
-Now we can refine this further
-(show kmalloc2.stp)
-
-Remember in some previous examples, we used maps or associative arrays. Maps can contain
-statistics too. So we have enhanced the previous script to collect statistics per
-program name. The output might be large so we'll redirect it to a file.
-
-> ./kmalloc2.stp > out
-
-(runs for 10 seconds)
-
-> more out
-
diff --git a/testsuite/systemtap.examples/small_demos/fileopen.stp b/testsuite/systemtap.examples/small_demos/fileopen.stp
deleted file mode 100755
index c1298f9c..00000000
--- a/testsuite/systemtap.examples/small_demos/fileopen.stp
+++ /dev/null
@@ -1,24 +0,0 @@
-#! /usr/bin/env stap
-
-#
-# fileopen.stp
-#
-# This is based on dtrace script from
-# http://www.gnome.org/~gman/blog/2006/Jan
-#
-# stap fileopen.stp -c "zenity --about"
-# or
-# ./fileopen.stp -c "program or script"
-
-global opens
-
-probe syscall.open {
- if (target() == pid()) opens[filename] ++
-}
-
-probe end {
- foreach([name] in opens+) {
- printf("%-70s%5d\n", name, opens[name])
- }
-}
-
diff --git a/testsuite/systemtap.examples/small_demos/kmalloc.stp b/testsuite/systemtap.examples/small_demos/kmalloc.stp
deleted file mode 100755
index 9157928d..00000000
--- a/testsuite/systemtap.examples/small_demos/kmalloc.stp
+++ /dev/null
@@ -1,22 +0,0 @@
-#! /usr/bin/env stap
-
-# Using statistics to examine kernel memory allocations
-
-global kmalloc
-
-probe kernel.function("__kmalloc") {
- kmalloc <<< $size
-}
-
-# Exit after 10 seconds
-probe timer.ms(10000) { exit () }
-
-probe end {
- printf("Count: %d allocations\n", @count(kmalloc))
- printf("Sum: %d Kbytes\n", @sum(kmalloc)/1000)
- printf("Average: %d bytes\n", @avg(kmalloc))
- printf("Min: %d bytes\n", @min(kmalloc))
- printf("Max: %d bytes\n", @max(kmalloc))
- print("\nAllocations by size in bytes\n")
- print(@hist_log(kmalloc))
-}
diff --git a/testsuite/systemtap.examples/small_demos/kmalloc2.stp b/testsuite/systemtap.examples/small_demos/kmalloc2.stp
deleted file mode 100755
index 2622dd2f..00000000
--- a/testsuite/systemtap.examples/small_demos/kmalloc2.stp
+++ /dev/null
@@ -1,26 +0,0 @@
-#! /usr/bin/env stap
-
-# Using statistics and maps to examine kernel memory allocations
-
-global kmalloc
-
-probe kernel.function("__kmalloc") {
- kmalloc[execname()] <<< $size
-}
-
-# Exit after 10 seconds
-probe timer.ms(10000) { exit () }
-
-probe end {
- foreach ([name] in kmalloc) {
- printf("Allocations for %s\n", name)
- printf("Count: %d allocations\n", @count(kmalloc[name]))
- printf("Sum: %d Kbytes\n", @sum(kmalloc[name])/1000)
- printf("Average: %d bytes\n", @avg(kmalloc[name]))
- printf("Min: %d bytes\n", @min(kmalloc[name]))
- printf("Max: %d bytes\n", @max(kmalloc[name]))
- print("\nAllocations by size in bytes\n")
- print(@hist_log(kmalloc[name]))
- printf("-------------------------------------------------------\n\n");
- }
-}
diff --git a/testsuite/systemtap.examples/small_demos/prof.stp b/testsuite/systemtap.examples/small_demos/prof.stp
deleted file mode 100755
index 389f743a..00000000
--- a/testsuite/systemtap.examples/small_demos/prof.stp
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env stap
-
-# This is an example of profiling a specific command or pid.
-# It works by recording the time when a system call is entered
-# exited.
-
-# Usage: prof.stp -c "top -n5"
-# Will start up "top" and after 5 iterations, will exit.
-#
-# Usage: prof.stp -x 3323
-# Will profile pid 3323 until it ^c is hit.
-#
-
-probe kernel.function("sys_*").call {
- if (target() == tid())
- calltime[tid()] = gettimeofday_us()
-}
-
-probe kernel.function("sys_*").return {
- if (target() != tid()) next
- now = gettimeofday_us()
- c = calltime[tid()]
- if (!c) next
- ttime[probefunc()] <<< now - c
- delete calltime[tid()]
-}
-
-probe end {
- printf("\n")
- foreach (x in ttime)
- printf("%-20s\tcalls:%6d\tavg time (us):%5d\ttotal(us):%7d\n",
- x, @count(ttime[x]), @avg(ttime[x]), @sum(ttime[x]))
-}
-
-global calltime, ttime
diff --git a/testsuite/systemtap.examples/small_demos/rwtiming.stp b/testsuite/systemtap.examples/small_demos/rwtiming.stp
deleted file mode 100755
index d570c581..00000000
--- a/testsuite/systemtap.examples/small_demos/rwtiming.stp
+++ /dev/null
@@ -1,74 +0,0 @@
-#! /usr/bin/env stap
-# rwtiming.stp
-#
-# This is a simple example to track the amount of time
-# spent doing reads and writes for the various programs running on the
-# system.
-
-probe begin { log("starting probe") }
-
-global names, opens, reads, writes
-global entry_opens, entry_reads, entry_writes
-global time_opens, time_reads, time_writes
-
-probe kernel.function("sys_open") {
- t=gettimeofday_us(); p=pid(); e=execname();
- names[e]=1
- opens[e] ++ # plain integer
- entry_opens[p] = t;
-}
-
-probe kernel.function("sys_open").return {
- t=gettimeofday_us(); p=pid(); e=execname();
- time_opens[e] <<< t - entry_opens[p];
-}
-
-probe kernel.function("sys_read") {
- t= gettimeofday_us(); p =pid(); e=execname();
- names[e]=1
- reads[e] <<< $count # statistics
- entry_reads[p] = t;
-}
-
-probe kernel.function("sys_read").return {
- t=gettimeofday_us(); p=pid(); e=execname();
- time_reads[e] <<< t - entry_reads[p];
-}
-
-probe kernel.function("sys_write") {
- t=gettimeofday_us(); p=pid(); e=execname();
- names[e]=1
- writes[e] <<< $count # statistics
- entry_writes[p] = t;
-}
-
-probe kernel.function("sys_write").return {
- t = gettimeofday_us(); p = pid(); e=execname();
- time_writes[e] <<< t - entry_writes[p];
-}
-
-probe end {
- foreach(name+ in names) { # sort by names
- printf ("process: %s\n", name)
- if (opens[name]) {
- printf ("opens n=%d\n", opens[name])
- print (@hist_log(time_opens[name]))
- }
- if (@count(reads[name])) {
- printf ("reads n=%d, sum=%d, avg=%d\n",
- @count(reads[name]), # extracting stat results
- @sum(reads[name]),
- @avg(reads[name]))
- print ("read timing distribution\n")
- print (@hist_log(time_reads[name]))
- }
- if (@count(writes[name])) {
- printf ("writes n=%d, sum=%d, avg=%d\n",
- @count(writes[name]), # extracting stat results
- @sum(writes[name]),
- @avg(writes[name]))
- print ("write timing distribution\n")
- print (@hist_log(time_writes[name]))
- }
- }
-}
diff --git a/testsuite/systemtap.examples/small_demos/sched_snoop.stp b/testsuite/systemtap.examples/small_demos/sched_snoop.stp
deleted file mode 100755
index 623643dd..00000000
--- a/testsuite/systemtap.examples/small_demos/sched_snoop.stp
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/usr/bin/env stap
-
-global start_ts
-
-probe begin {
- start_ts = gettimeofday_us()
- printf("%12s %3s %5s %5s %-16s ACTION\n",
- "TIMESTAMP", "CPU", "PID", "TID", "EXECNAME")
-}
-
-function report(action:string) {
- printf("%3d %12d %5d %5d %-16s %s\n",
- gettimeofday_us() - start_ts, cpu(),
- pid(), tid(), execname(), action)
-}
-
-probe scheduler.cpu_off {
- report(sprintf("cpu_off%s", idle? " [idle]" : ""))
-}
-
-probe scheduler.cpu_on {
- report(sprintf("cpu_on%s", idle? " [idle]" : ""))
-}
-
-probe scheduler.tick {
- report(sprintf("tick%s", idle? " [idle]" : ""))
-}
-
-probe scheduler.migrate ? {
- report("migrate")
-}
-
-probe scheduler.balance ? {
- report("balance")
-}
diff --git a/testsuite/systemtap.examples/small_demos/sys.stp b/testsuite/systemtap.examples/small_demos/sys.stp
deleted file mode 100755
index 2df20bc3..00000000
--- a/testsuite/systemtap.examples/small_demos/sys.stp
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/usr/bin/env stap
-
-# print all system calls on the system
-
-probe syscall.* {
- if (execname() != "staprun")
- printf("%s: %s (%s) = ", execname(), name, argstr)
-}
-
-probe syscall.*.return {
- if (execname() != "staprun")
- printf("%s\n", retstr)
-}
-
-probe end {
- printf("\n")
-}
diff --git a/testsuite/systemtap.examples/small_demos/top.stp b/testsuite/systemtap.examples/small_demos/top.stp
deleted file mode 100755
index b46b9940..00000000
--- a/testsuite/systemtap.examples/small_demos/top.stp
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env stap
-#
-# This script continuously lists the top 20 systemcalls on the system
-#
-
-global syscalls
-
-function print_top () {
- printf ("SYSCALL\t\t\t\tCOUNT\n")
- foreach ([name] in syscalls- limit 20)
- printf("%-20s\t\t%5d\n",name, syscalls[name])
- printf("--------------------------------------\n")
- delete syscalls
-}
-
-probe syscall.* {
- syscalls[probefunc()]++
-}
-
-# print top syscalls every 5 seconds
-probe timer.ms(5000) {
- print_top ()
-}
-
diff --git a/testsuite/systemtap.examples/subsystem-index.html b/testsuite/systemtap.examples/subsystem-index.html
new file mode 100644
index 00000000..9bdec0c8
--- /dev/null
+++ b/testsuite/systemtap.examples/subsystem-index.html
@@ -0,0 +1,162 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+<head>
+ <title>SystemTap Examples</title>
+ <link rel="stylesheet" href="html/systemtap.css" type="text/css">
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+</head>
+
+<body>
+ <table cellspacing="2" cellpadding="2" border="0" width="100%">
+ <tr>
+ <td valign="bottom" height="80"><img src="html/systemtaplogo.png"
+ alt="SystemTap logo" width="165" height="25"></td>
+ <td valign="bottom" class="topnavright" align="right">
+ <a href="http://sourceware.org/systemtap/">SystemTap</a>&nbsp;|&nbsp;
+ </td>
+ </tr>
+ </table>
+
+ <div class="mainbackground">
+ <div class="maintextregion">
+ <img src="html/systemtapcorner.gif">
+ <table cellspacing="2" cellpadding="4" border="0" width="99%"
+ style="margin-top:17;">
+ <tr>
+ <td width="200">&nbsp;</td>
+ <td valign="bottom"><h1>Examples</h1></td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td valign="top">
+
+ <h2>Example Indexes</h2>
+ <ul>
+ <li><a href="index.html">All Examples</a></li>
+ <li><a href="subsystem-index.html">By Subsystem</a></li>
+ <li><a href="keyword-index.html">By Keyword</a></li>
+ </ul>
+
+<h2>Examples by Subsystem</h2>
+<p><tt><a href="#CPU">CPU</a> <a href="#DISK">DISK</a> <a href="#IO">IO</a> <a href="#KERNEL">KERNEL</a> <a href="#LOCKING">LOCKING</a> <a href="#NETWORK">NETWORK</a> <a href="#NONE">NONE</a> <a href="#SCHEDULER">SCHEDULER</a> <a href="#SIGNALS">SIGNALS</a> <a href="#SYSCALL">SYSCALL</a> </tt></p>
+<h3><a name="CPU">CPU</a></h3>
+<ul>
+<li><a href="general/graphs.stp">general/graphs.stp</a> - Graphing Disk and CPU Utilization<br>
+subsystems: disk cpu, keywords: disk cpu use graph<br>
+<p>The script tracks the disk and CPU utilization. The resulting output of the script can be piped into gnuplot to generate a graph of disk and CPU USE.</p></li>
+</ul>
+<h3><a name="DISK">DISK</a></h3>
+<ul>
+<li><a href="general/graphs.stp">general/graphs.stp</a> - Graphing Disk and CPU Utilization<br>
+subsystems: disk cpu, keywords: disk cpu use graph<br>
+<p>The script tracks the disk and CPU utilization. The resulting output of the script can be piped into gnuplot to generate a graph of disk and CPU USE.</p></li>
+<li><a href="io/disktop.stp">io/disktop.stp</a> - Summarize Disk Read/Write Traffic<br>
+subsystems: disk, keywords: disk<br>
+<p>Get the status of reading/writing disk every 5 seconds, output top ten entries during that period.</p></li>
+</ul>
+<h3><a name="IO">IO</a></h3>
+<ul>
+<li><a href="io/io_submit.stp">io/io_submit.stp</a> - Tally Reschedule Reason During AIO io_submit Call<br>
+subsystems: io, keywords: io backtrace<br>
+<p>When a reschedule occurs during an AIO io_submit call, accumulate the traceback in a histogram. When the script exits prints out a sorted list from most common to least common backtrace.</p></li>
+<li><a href="io/iotop.stp">io/iotop.stp</a> - Periodically Print I/O Activity by Process Name<br>
+subsystems: io, keywords: io<br>
+<p>Every five seconds print out the top ten executables generating I/O traffic during that interval sorted in descending order.</p></li>
+<li><a href="io/traceio.stp">io/traceio.stp</a> - Track Cumulative I/O Activity by Process Name<br>
+subsystems: io, keywords: io<br>
+<p>Every second print out the top ten executables sorted in descending order based on cumulative I/O traffic observed.</p></li>
+<li><a href="io/traceio2.stp">io/traceio2.stp</a> - Watch I/O Activity on a Particular Device<br>
+subsystems: io, keywords: io<br>
+<p>Print out the executable name and process number as reads and writes to the specified device occur.</p></li>
+</ul>
+<h3><a name="KERNEL">KERNEL</a></h3>
+<ul>
+<li><a href="general/para-callgraph.stp">general/para-callgraph.stp</a> - Tracing Calls for Sections of Code<br>
+subsystems: kernel, keywords: trace callgraph<br>
+<p>The script takes two arguments: the first argument is the function to starts/stops the per thread call graph traces and the second argument is the list of functions to generate trace information on. The script prints out a timestap for the thread, the function name and pid, followed by entry or exit symboly and function name.</p></li>
+<li><a href="process/pf2.stp">process/pf2.stp</a> - Profile kernel functions<br>
+subsystems: kernel, keywords: profiling<br>
+<p>The pf2.stp script sets up time-based sampling. Every five seconds it prints out a sorted list with the top ten kernel functions with samples.</p></li>
+<li><a href="profiling/functioncallcount.stp">profiling/functioncallcount.stp</a> - Count Times Functions Called<br>
+subsystems: kernel, keywords: profiling functions<br>
+<p>The functioncallcount.stp script takes one argument, a list of functions to probe. The script will run and count the number of times that each of the functions on the list is called. On exit the script will print a sorted list from most frequently to least frequently called function.</p></li>
+<li><a href="profiling/thread-times.stp">profiling/thread-times.stp</a> - Profile kernel functions<br>
+subsystems: kernel, keywords: profiling<br>
+<p>The thread-times.stp script sets up time-based sampling. Every five seconds it prints out a sorted list with the top twenty processes with samples broken down into percentage total time spent in user-space and kernel-space.</p></li>
+</ul>
+<h3><a name="LOCKING">LOCKING</a></h3>
+<ul>
+<li><a href="process/futexes.stp">process/futexes.stp</a> - System-Wide Futex Contention<br>
+subsystems: locking, keywords: syscall locking futex<br>
+<p>The script watches the futex syscall on the system. On exit the futexes address, the number of contentions, and the average time for each contention on the futex are printed from lowest pid number to highest.</p></li>
+</ul>
+<h3><a name="NETWORK">NETWORK</a></h3>
+<ul>
+<li><a href="network/nettop.stp">network/nettop.stp</a> - Periodic Listing of Processes Using Network Interfaces<br>
+subsystems: network, keywords: network traffic per-process<br>
+<p>Every five seconds the nettop.stp script prints out a list of processed (PID and command) with the number of packets sent/received and the amount of data sent/received by the process during that interval.</p></li>
+<li><a href="network/socket-trace.stp">network/socket-trace.stp</a> - Trace Functions called in Network Socket Code<br>
+subsystems: network, keywords: network socket<br>
+<p>The script instrument each of the functions inn the Linux kernel's net/socket.c file. The script prints out trace. The first element of a line is time delta in microseconds from the previous entry. This is followed by the command name and the PID. The "->" and "<-" indicates function entry and function exit, respectively. The last element of the line is the function name.</p></li>
+</ul>
+<h3><a name="NONE">NONE</a></h3>
+<ul>
+<li><a href="general/helloworld.stp">general/helloworld.stp</a> - SystemTap "Hello World" Program<br>
+subsystems: none, keywords: simple<br>
+<p>A basic "Hello World" program implemented in SystemTap script. It prints out "hello world" message and then immediately exits.</p></li>
+</ul>
+<h3><a name="SCHEDULER">SCHEDULER</a></h3>
+<ul>
+<li><a href="process/sleepingBeauties.stp">process/sleepingBeauties.stp</a> - Generating Backtraces of Threads Waiting for IO Operations<br>
+subsystems: scheduler, keywords: io scheduler<br>
+<p>The script monitor time threads spend waiting for IO operations (in "D" state) in the wait_for_completion function. If a thread spends over 10ms wall-clock time waiting, information is printed out describing the thread number and executable name. When slow the wait_for_completion function complete, backtraces for the long duration calls are printed out.</p></li>
+</ul>
+<h3><a name="SIGNALS">SIGNALS</a></h3>
+<ul>
+<li><a href="process/sig_by_pid.stp">process/sig_by_pid.stp</a> - Signal Counts by Process ID<br>
+subsystems: signals, keywords: signals<br>
+<p>Print signal counts by process ID in descending order.</p></li>
+<li><a href="process/sig_by_proc.stp">process/sig_by_proc.stp</a> - Signal Counts by Process Name<br>
+subsystems: signals, keywords: signals<br>
+<p>Print signal counts by process name in descending order.</p></li>
+<li><a href="process/sigkill.stp">process/sigkill.stp</a> - Track SIGKILL Signals<br>
+subsystems: signals, keywords: signals<br>
+<p>The script traces any SIGKILL signals. When that SIGKILL signal is sent to a process, the script prints out the signal name, the desination executable and process ID, the executable name user ID that sent the signal.</p></li>
+<li><a href="process/syscalls_by_pid.stp">process/syscalls_by_pid.stp</a> - System-Wide Count of Syscalls by PID<br>
+subsystems: signals, keywords: signals<br>
+<p>The script watches for a particular signal sent to a specific process. When that signal is sent to the specified process, the script prints out the PID and executable of the process sending the signal, the PID and executable name of the process receiving the signal, and the signal number and name.</p></li>
+</ul>
+<h3><a name="SYSCALL">SYSCALL</a></h3>
+<ul>
+<li><a href="io/iotime.stp">io/iotime.stp</a> - Trace Time Spent in Read and Write for Files <br>
+subsystems: syscall, keywords: syscall read write time io<br>
+<p>The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spend in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parenthesese. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls.</p></li>
+<li><a href="process/sleeptime.stp">process/sleeptime.stp</a> - Trace Time Spent in nanosleep Syscalls<br>
+subsystems: syscall, keywords: syscall sleep<br>
+<p>The script watches each nanosleep syscall on the system. At the end of each nanosleep syscall the script prints out a line with a timestamp in microseconds, the pid, the executable name in paretheses, the "nanosleep:" key, and the duration of the sleep in microseconds.</p></li>
+<li><a href="process/syscalls_by_pid.stp">process/syscalls_by_pid.stp</a> - System-Wide Count of Syscalls by PID<br>
+subsystems: syscall, keywords: syscall<br>
+<p>The script watches all syscall on the system. On exit the script prints a list showing the number of systemcalls executed by each PID ordered from greatest to least number of syscalls.</p></li>
+<li><a href="process/syscalls_by_proc.stp">process/syscalls_by_proc.stp</a> - System-Wide Count of Syscalls by Executable<br>
+subsystems: syscall, keywords: syscall<br>
+<p>The script watches all syscall on the system. On exit the script prints a list showing the number of systemcalls executed by each executable ordered from greates to least number of syscalls.</p></li>
+<li><a href="process/wait4time.stp">process/wait4time.stp</a> - Trace Time Spent in wait4 Syscalls<br>
+subsystems: syscall, keywords: syscall wait4<br>
+<p>The script watches each wait4 syscall on the system. At the end of each wait4 syscall the script prints out a line with a timestamp in microseconds, the pid, the executable name in paretheses, the "wait4:" key, the duration of the wait and the PID that the wait4 was waiting for. If the waited for PID is not specified , it is "-1".</p></li>
+</ul>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+
+ <table cellspacing="2" cellpadding="2" border="0" width="100%">
+ <tr>
+ <td align="center" class="footer"><a href=
+ "http://sourceware.org/systemtap">SystemTap</a></td>
+ </tr>
+ </table>
+</body>
+</html>
diff --git a/testsuite/systemtap.examples/subsystem-index.txt b/testsuite/systemtap.examples/subsystem-index.txt
new file mode 100644
index 00000000..98e75e98
--- /dev/null
+++ b/testsuite/systemtap.examples/subsystem-index.txt
@@ -0,0 +1,242 @@
+SYSTEMTAP EXAMPLES INDEX BY SUBSYSTEM
+(see also index.txt, keyword-index.txt)
+
+= CPU =
+
+general/graphs.stp - Graphing Disk and CPU Utilization
+subsystems: disk cpu, keywords: disk cpu use graph
+
+ The script tracks the disk and CPU utilization. The resulting output
+ of the script can be piped into gnuplot to generate a graph of disk
+ and CPU USE.
+
+
+= DISK =
+
+general/graphs.stp - Graphing Disk and CPU Utilization
+subsystems: disk cpu, keywords: disk cpu use graph
+
+ The script tracks the disk and CPU utilization. The resulting output
+ of the script can be piped into gnuplot to generate a graph of disk
+ and CPU USE.
+
+
+io/disktop.stp - Summarize Disk Read/Write Traffic
+subsystems: disk, keywords: disk
+
+ Get the status of reading/writing disk every 5 seconds, output top
+ ten entries during that period.
+
+
+= IO =
+
+io/io_submit.stp - Tally Reschedule Reason During AIO io_submit Call
+subsystems: io, keywords: io backtrace
+
+ When a reschedule occurs during an AIO io_submit call, accumulate the
+ traceback in a histogram. When the script exits prints out a sorted
+ list from most common to least common backtrace.
+
+
+io/iotop.stp - Periodically Print I/O Activity by Process Name
+subsystems: io, keywords: io
+
+ Every five seconds print out the top ten executables generating I/O
+ traffic during that interval sorted in descending order.
+
+
+io/traceio.stp - Track Cumulative I/O Activity by Process Name
+subsystems: io, keywords: io
+
+ Every second print out the top ten executables sorted in descending
+ order based on cumulative I/O traffic observed.
+
+
+io/traceio2.stp - Watch I/O Activity on a Particular Device
+subsystems: io, keywords: io
+
+ Print out the executable name and process number as reads and writes
+ to the specified device occur.
+
+
+= KERNEL =
+
+general/para-callgraph.stp - Tracing Calls for Sections of Code
+subsystems: kernel, keywords: trace callgraph
+
+ The script takes two arguments: the first argument is the function to
+ starts/stops the per thread call graph traces and the second argument
+ is the list of functions to generate trace information on. The script
+ prints out a timestap for the thread, the function name and pid,
+ followed by entry or exit symboly and function name.
+
+
+process/pf2.stp - Profile kernel functions
+subsystems: kernel, keywords: profiling
+
+ The pf2.stp script sets up time-based sampling. Every five seconds it
+ prints out a sorted list with the top ten kernel functions with
+ samples.
+
+
+profiling/functioncallcount.stp - Count Times Functions Called
+subsystems: kernel, keywords: profiling functions
+
+ The functioncallcount.stp script takes one argument, a list of
+ functions to probe. The script will run and count the number of times
+ that each of the functions on the list is called. On exit the script
+ will print a sorted list from most frequently to least frequently
+ called function.
+
+
+profiling/thread-times.stp - Profile kernel functions
+subsystems: kernel, keywords: profiling
+
+ The thread-times.stp script sets up time-based sampling. Every five
+ seconds it prints out a sorted list with the top twenty processes
+ with samples broken down into percentage total time spent in
+ user-space and kernel-space.
+
+
+= LOCKING =
+
+process/futexes.stp - System-Wide Futex Contention
+subsystems: locking, keywords: syscall locking futex
+
+ The script watches the futex syscall on the system. On exit the
+ futexes address, the number of contentions, and the average time for
+ each contention on the futex are printed from lowest pid number to
+ highest.
+
+
+= NETWORK =
+
+network/nettop.stp - Periodic Listing of Processes Using Network Interfaces
+subsystems: network, keywords: network traffic per-process
+
+ Every five seconds the nettop.stp script prints out a list of
+ processed (PID and command) with the number of packets sent/received
+ and the amount of data sent/received by the process during that
+ interval.
+
+
+network/socket-trace.stp - Trace Functions called in Network Socket Code
+subsystems: network, keywords: network socket
+
+ The script instrument each of the functions inn the Linux kernel's
+ net/socket.c file. The script prints out trace. The first element of
+ a line is time delta in microseconds from the previous entry. This
+ is followed by the command name and the PID. The "->" and "<-"
+ indicates function entry and function exit, respectively. The last
+ element of the line is the function name.
+
+
+= NONE =
+
+general/helloworld.stp - SystemTap "Hello World" Program
+subsystems: none, keywords: simple
+
+ A basic "Hello World" program implemented in SystemTap script. It
+ prints out "hello world" message and then immediately exits.
+
+
+= SCHEDULER =
+
+process/sleepingBeauties.stp - Generating Backtraces of Threads Waiting for IO Operations
+subsystems: scheduler, keywords: io scheduler
+
+ The script monitor time threads spend waiting for IO operations (in
+ "D" state) in the wait_for_completion function. If a thread spends
+ over 10ms wall-clock time waiting, information is printed out
+ describing the thread number and executable name. When slow the
+ wait_for_completion function complete, backtraces for the long
+ duration calls are printed out.
+
+
+= SIGNALS =
+
+process/sig_by_pid.stp - Signal Counts by Process ID
+subsystems: signals, keywords: signals
+
+ Print signal counts by process ID in descending order.
+
+
+process/sig_by_proc.stp - Signal Counts by Process Name
+subsystems: signals, keywords: signals
+
+ Print signal counts by process name in descending order.
+
+
+process/sigkill.stp - Track SIGKILL Signals
+subsystems: signals, keywords: signals
+
+ The script traces any SIGKILL signals. When that SIGKILL signal is
+ sent to a process, the script prints out the signal name, the
+ desination executable and process ID, the executable name user ID
+ that sent the signal.
+
+
+process/syscalls_by_pid.stp - System-Wide Count of Syscalls by PID
+subsystems: signals, keywords: signals
+
+ The script watches for a particular signal sent to a specific
+ process. When that signal is sent to the specified process, the
+ script prints out the PID and executable of the process sending the
+ signal, the PID and executable name of the process receiving the
+ signal, and the signal number and name.
+
+
+= SYSCALL =
+
+io/iotime.stp - Trace Time Spent in Read and Write for Files
+subsystems: syscall, keywords: syscall read write time io
+
+ The script watches each open, close, read, and write syscalls on the
+ system. For each file the scripts observes opened it accumulates the
+ amount of wall clock time spend in read and write operations and the
+ number of bytes read and written. When a file is closed the script
+ prints out a pair of lines for the file. Both lines begin with a
+ timestamp in microseconds, the PID number, and the executable name in
+ parenthesese. The first line with the "access" keyword lists the file
+ name, the attempted number of bytes for the read and write
+ operations. The second line with the "iotime" keyword list the file
+ name and the number of microseconds accumulated in the read and write
+ syscalls.
+
+
+process/sleeptime.stp - Trace Time Spent in nanosleep Syscalls
+subsystems: syscall, keywords: syscall sleep
+
+ The script watches each nanosleep syscall on the system. At the end
+ of each nanosleep syscall the script prints out a line with a
+ timestamp in microseconds, the pid, the executable name in
+ paretheses, the "nanosleep:" key, and the duration of the sleep in
+ microseconds.
+
+
+process/syscalls_by_pid.stp - System-Wide Count of Syscalls by PID
+subsystems: syscall, keywords: syscall
+
+ The script watches all syscall on the system. On exit the script
+ prints a list showing the number of systemcalls executed by each PID
+ ordered from greatest to least number of syscalls.
+
+
+process/syscalls_by_proc.stp - System-Wide Count of Syscalls by Executable
+subsystems: syscall, keywords: syscall
+
+ The script watches all syscall on the system. On exit the script
+ prints a list showing the number of systemcalls executed by each
+ executable ordered from greates to least number of syscalls.
+
+
+process/wait4time.stp - Trace Time Spent in wait4 Syscalls
+subsystems: syscall, keywords: syscall wait4
+
+ The script watches each wait4 syscall on the system. At the end of
+ each wait4 syscall the script prints out a line with a timestamp in
+ microseconds, the pid, the executable name in paretheses, the
+ "wait4:" key, the duration of the wait and the PID that the wait4 was
+ waiting for. If the waited for PID is not specified , it is "-1".
+
+