From 7dc5b46bc1ddbe3fbe6d89472f42231756a54185 Mon Sep 17 00:00:00 2001 From: William Cohen Date: Tue, 8 Sep 2009 14:17:45 -0400 Subject: Clean up iostat-scsi.stp and add to the regular testing. --- testsuite/systemtap.examples/io/iostat-scsi.meta | 13 +++++++++++++ testsuite/systemtap.examples/io/iostat-scsi.stp | 11 +++-------- 2 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 testsuite/systemtap.examples/io/iostat-scsi.meta (limited to 'testsuite/systemtap.examples/io') 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 -%} -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")->sector_size +} probe module("sd_mod").function("sd_prep_fn") !, kernel.function("sd_prep_fn") { device=kernel_string($rq->rq_disk->disk_name) -- cgit