From 6987cb4306107994d06b0e653b9eac97388056bc Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 8 Oct 2009 17:18:51 -0400 Subject: testsuite: robustify check_* invocation of examples meta testsuite/systemtap.examples/ * check.exp (extract_tag): Log extracted tags. Tolerate embedded '$'. (run_command): Pass through commands to sh -c without eval quoting. * README: Document "sh -c"-ness of check_* tags. * *.meta: Fix quoting, add a few check_support predicates. --- testsuite/systemtap.examples/io/iostat-scsi.meta | 2 +- testsuite/systemtap.examples/io/ttyspy.meta | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'testsuite/systemtap.examples/io') diff --git a/testsuite/systemtap.examples/io/iostat-scsi.meta b/testsuite/systemtap.examples/io/iostat-scsi.meta index a5fe7a8f..6aa4c5d9 100644 --- a/testsuite/systemtap.examples/io/iostat-scsi.meta +++ b/testsuite/systemtap.examples/io/iostat-scsi.meta @@ -9,6 +9,6 @@ exit: user-controlled output: timed scope: system-wide description: The iostat-scsi.stp script provides a breakdown of the number of blks read and written on the machine's various SCSI devices. The script takes one argument which is the number of seconds between reports. -test_support: stap -l module("st").function("st_do_scsi")!,kernel.function("st_do_scsi") +test_support: stap -l 'module("st").function("st_do_scsi")!,kernel.function("st_do_scsi")' test_check: stap -g -p4 iostat-scsi.stp 1 test_installcheck: stap -g iostat-scsi.stp 1 -c "sleep 0.2" diff --git a/testsuite/systemtap.examples/io/ttyspy.meta b/testsuite/systemtap.examples/io/ttyspy.meta index b190eafd..ea1c9040 100644 --- a/testsuite/systemtap.examples/io/ttyspy.meta +++ b/testsuite/systemtap.examples/io/ttyspy.meta @@ -2,5 +2,6 @@ title: Monitor tty typing. name: ttyspy.stp keywords: io tty per-process monitor description: The ttyspy.stp script uses tty_audit hooks to monitor recent typing activity on the system, printing a scrolling record of recent keystrokes, on a per-tty basis. +test_support: stap -l 'kernel.function("tty_audit_add_data")' test_check: stap -gp4 ttyspy.stp test_installcheck: stap --skip-badvars -g ttyspy.stp -c "sleep 1" -- cgit From 3620a030bc54971cc4cf85faaff7cb26710cd015 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 8 Oct 2009 17:21:08 -0400 Subject: examples: add mbrwatch sample --- testsuite/systemtap.examples/io/mbrwatch.meta | 6 ++++++ testsuite/systemtap.examples/io/mbrwatch.stp | 9 +++++++++ 2 files changed, 15 insertions(+) create mode 100644 testsuite/systemtap.examples/io/mbrwatch.meta create mode 100755 testsuite/systemtap.examples/io/mbrwatch.stp (limited to 'testsuite/systemtap.examples/io') 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() + } +} -- cgit From 1beb508976ba5a79758ffe6e174f47a64225f449 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 8 Oct 2009 17:23:42 -0400 Subject: examples: regen indexes --- testsuite/systemtap.examples/io/mbrwatch.stp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testsuite/systemtap.examples/io') diff --git a/testsuite/systemtap.examples/io/mbrwatch.stp b/testsuite/systemtap.examples/io/mbrwatch.stp index 9d621619..f981073e 100755 --- a/testsuite/systemtap.examples/io/mbrwatch.stp +++ b/testsuite/systemtap.examples/io/mbrwatch.stp @@ -4,6 +4,6 @@ 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() + print_backtrace() } } -- cgit