summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/io/iostat-scsi.stp
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-09-14 17:47:26 -0400
committerDave Brolley <brolley@redhat.com>2009-09-14 17:47:26 -0400
commit9df741675d7e36008869dfff46ccc602875dc091 (patch)
tree1deafeacb302f9154586708ada7a240470aa6b4a /testsuite/systemtap.examples/io/iostat-scsi.stp
parentb232fab3a271c4c787462295d7ffbeca750c1092 (diff)
parent775c3771bb4a5f663a763d7c65b1571e24e4b212 (diff)
downloadsystemtap-steved-9df741675d7e36008869dfff46ccc602875dc091.tar.gz
systemtap-steved-9df741675d7e36008869dfff46ccc602875dc091.tar.xz
systemtap-steved-9df741675d7e36008869dfff46ccc602875dc091.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Conflicts: aclocal.m4 configure doc/SystemTap_Tapset_Reference/Makefile.in testsuite/aclocal.m4 testsuite/configure
Diffstat (limited to 'testsuite/systemtap.examples/io/iostat-scsi.stp')
-rwxr-xr-xtestsuite/systemtap.examples/io/iostat-scsi.stp19
1 files changed, 14 insertions, 5 deletions
diff --git a/testsuite/systemtap.examples/io/iostat-scsi.stp b/testsuite/systemtap.examples/io/iostat-scsi.stp
index 15833af8..f6715a42 100755
--- a/testsuite/systemtap.examples/io/iostat-scsi.stp
+++ b/testsuite/systemtap.examples/io/iostat-scsi.stp
@@ -19,20 +19,29 @@ probe module("sd_mod").function("sd_init_command") !, kernel.function("sd_init_c
reads[device] <<< nr_sectors * sector_size
}
%:
+
+function get_sector_size:long (data:long) {
+ return @cast(data, "scsi_device", "kernel<scsi/scsi_device.h>")->sector_size
+}
+
+%(kernel_v>="2.6.31" %?
%{
-#include <scsi/scsi_device.h>
+#include <linux/blkdev.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_nr_sectors:long(rq:long) %{ /* pure */
+ THIS->__retvalue = blk_rq_sectors((const struct request *)(long)THIS->rq);
%}
+%)
probe module("sd_mod").function("sd_prep_fn") !, kernel.function("sd_prep_fn") {
device=kernel_string($rq->rq_disk->disk_name)
sector_size=get_sector_size($q->queuedata)
+%(kernel_v>="2.6.31" %?
+ nr_sectors=get_nr_sectors($rq)
+%:
nr_sectors=$rq->nr_sectors
+%)
devices[device] = 1
if ($rq->cmd_flags & 1)
writes[device] <<< nr_sectors * sector_size