summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/io/iostat-scsi.stp
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2009-09-15 18:29:45 -0400
committerFrank Ch. Eigler <fche@elastic.org>2009-09-15 18:29:45 -0400
commitda23eceb71cc70668ab9dfd80d318b3837703d9d (patch)
treedcfb85f50cf035213bde1836d2167ceca00c8205 /testsuite/systemtap.examples/io/iostat-scsi.stp
parent2260f4e32eb4c0b4cc95e4bef8ccdc5dc66261af (diff)
parent24fcff20ed7a4a9f2b772c572db28ee8df49161f (diff)
downloadsystemtap-steved-da23eceb71cc70668ab9dfd80d318b3837703d9d.tar.gz
systemtap-steved-da23eceb71cc70668ab9dfd80d318b3837703d9d.tar.xz
systemtap-steved-da23eceb71cc70668ab9dfd80d318b3837703d9d.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
* 'master' of ssh://sources.redhat.com/git/systemtap: (34 commits) Update the langref copyright notice Fix some probe examples in the language reference Remove automatic authorization of servers started by root as trusted signers. docs: add abnormal termination section to PROCESSING Remove unneeded header file Get the module to sign from -p4's stdout Move --unprivileged support news to the top. Firther updates to NEWS regarding signing and unprivileged users. Authorize new certificates created for servers started by root as authorized signers. 2009-09-14 Dave Brolley <brolley@redhat.com> Allow remaining process.* probes for unprivileged users. Use the sched_switch tracepoint if available. PR10608: mark test cases untested once compilation failed Make check.exp not sleep so much in test_installcheck. Make tracepoints.exp test more efficient by running as one giant script. Only test highest optimization for exelib.exp test. Replace small exelib.exp testcases with one jumbo testcase. Remove duplicate uprobe_derived_probe code Add semaphores for use with the forthcoming sdt marker checks. Add actual pc address to semantic error about inaccessible variables. ... Conflicts: tapsets.cxx
Diffstat (limited to 'testsuite/systemtap.examples/io/iostat-scsi.stp')
-rwxr-xr-xtestsuite/systemtap.examples/io/iostat-scsi.stp16
1 files changed, 15 insertions, 1 deletions
diff --git a/testsuite/systemtap.examples/io/iostat-scsi.stp b/testsuite/systemtap.examples/io/iostat-scsi.stp
index 8251741d..f6715a42 100755
--- a/testsuite/systemtap.examples/io/iostat-scsi.stp
+++ b/testsuite/systemtap.examples/io/iostat-scsi.stp
@@ -20,14 +20,28 @@ probe module("sd_mod").function("sd_init_command") !, kernel.function("sd_init_c
}
%:
-function get_sector_size:long (data:long) { /* pure */
+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 <linux/blkdev.h>
+%}
+
+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