diff options
author | Dave Brolley <brolley@redhat.com> | 2009-09-08 17:03:34 -0400 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-09-08 17:03:34 -0400 |
commit | 97f8355dd72378d4fb6e8cb8cbb4fe160a21ddec (patch) | |
tree | 6956d7f9bdd460383979450c81f88bb6aa916d66 | |
parent | 0ed88eb252bdeb3dd9c5cd425d6a0e26816635b6 (diff) | |
parent | 7dc5b46bc1ddbe3fbe6d89472f42231756a54185 (diff) | |
download | systemtap-steved-97f8355dd72378d4fb6e8cb8cbb4fe160a21ddec.tar.gz systemtap-steved-97f8355dd72378d4fb6e8cb8cbb4fe160a21ddec.tar.xz systemtap-steved-97f8355dd72378d4fb6e8cb8cbb4fe160a21ddec.zip |
Merge branch 'master' of git://sources.redhat.com/git/systemtap
-rw-r--r-- | testsuite/systemtap.examples/io/iostat-scsi.meta | 13 | ||||
-rwxr-xr-x | testsuite/systemtap.examples/io/iostat-scsi.stp | 11 |
2 files changed, 16 insertions, 8 deletions
diff --git a/testsuite/systemtap.examples/io/iostat-scsi.meta b/testsuite/systemtap.examples/io/iostat-scsi.meta new file mode 100644 index 00000000..834466aa --- /dev/null +++ b/testsuite/systemtap.examples/io/iostat-scsi.meta @@ -0,0 +1,13 @@ +title: iostat for SCSI Devices +name: iostat-scsi.stp +version: 1.0 +author: anonymous +keywords: io profiling scsi +subsystem: io +status: production +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 various machines's SCSI devices. The script takes one argument which is the number of seconds between reports. +test_check: stap -p4 iostat-scsi.stp 1 +test_installcheck: stap iostat-scsi.stp 1 -c "sleep 1" diff --git a/testsuite/systemtap.examples/io/iostat-scsi.stp b/testsuite/systemtap.examples/io/iostat-scsi.stp index 15833af8..8251741d 100755 --- a/testsuite/systemtap.examples/io/iostat-scsi.stp +++ b/testsuite/systemtap.examples/io/iostat-scsi.stp @@ -19,15 +19,10 @@ probe module("sd_mod").function("sd_init_command") !, kernel.function("sd_init_c reads[device] <<< nr_sectors * sector_size } %: -%{ -#include <scsi/scsi_device.h> -%} -function get_sector_size:long (data:long) %{ /* pure */ - struct scsi_device *sdp = (struct scsi_device *)((long)THIS->data); - THIS->__retvalue = kread(&(sdp->sector_size)); - CATCH_DEREF_FAULT(); -%} +function get_sector_size:long (data:long) { /* pure */ + return @cast(data, "scsi_device", "kernel<scsi/scsi_device.h>")->sector_size +} probe module("sd_mod").function("sd_prep_fn") !, kernel.function("sd_prep_fn") { device=kernel_string($rq->rq_disk->disk_name) |