summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2009-10-08 17:21:08 -0400
committerFrank Ch. Eigler <fche@elastic.org>2009-10-08 17:22:53 -0400
commit3620a030bc54971cc4cf85faaff7cb26710cd015 (patch)
tree24929055fb03e9547d9ef775f1e6efb61ab06ceb /testsuite
parent6987cb4306107994d06b0e653b9eac97388056bc (diff)
downloadsystemtap-steved-3620a030bc54971cc4cf85faaff7cb26710cd015.tar.gz
systemtap-steved-3620a030bc54971cc4cf85faaff7cb26710cd015.tar.xz
systemtap-steved-3620a030bc54971cc4cf85faaff7cb26710cd015.zip
examples: add mbrwatch sample
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/systemtap.examples/io/mbrwatch.meta6
-rwxr-xr-xtestsuite/systemtap.examples/io/mbrwatch.stp9
2 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/systemtap.examples/io/mbrwatch.meta b/testsuite/systemtap.examples/io/mbrwatch.meta
new file mode 100644
index 00000000..0ff88b13
--- /dev/null
+++ b/testsuite/systemtap.examples/io/mbrwatch.meta
@@ -0,0 +1,6 @@
+title: Monitor read/write of MBR (boot sector) area of block devices
+name: mbrwatch.stp
+keywords: io monitoring
+description: The mbrwatch.stp script reports any attempted reads/writes of the first few sectors of a raw block device.
+test_check: stap -p4 mbrwatch.stp
+test_installcheck: stap mbrwatch.stp -c "dd of=/dev/null count=1 if=/dev/`grep -v major /proc/partitions | grep . | awk '{print $4}' | head -1`"
diff --git a/testsuite/systemtap.examples/io/mbrwatch.stp b/testsuite/systemtap.examples/io/mbrwatch.stp
new file mode 100755
index 00000000..9d621619
--- /dev/null
+++ b/testsuite/systemtap.examples/io/mbrwatch.stp
@@ -0,0 +1,9 @@
+#! /usr/bin/env stap
+
+probe ioblock.request {
+ if (bdev==bdev_contains && sector<4) {
+ printf("device %s sector %d %s, process %s[%d]\n",
+ devname, sector, (rw==BIO_READ ? "read":"write"), execname(), pid())
+ print_backtrace()
+ }
+}