diff options
author | dsmith <dsmith> | 2008-03-05 16:28:42 +0000 |
---|---|---|
committer | dsmith <dsmith> | 2008-03-05 16:28:42 +0000 |
commit | 979f400dad0159aab8c3aaa846db4ba312daef0a (patch) | |
tree | 225a1506066bee873fbed981bbba8cc5609353a2 /examples | |
parent | e523ec99f2243055c688041ee2adbf5bb661333b (diff) | |
download | systemtap-steved-979f400dad0159aab8c3aaa846db4ba312daef0a.tar.gz systemtap-steved-979f400dad0159aab8c3aaa846db4ba312daef0a.tar.xz systemtap-steved-979f400dad0159aab8c3aaa846db4ba312daef0a.zip |
2008-03-05 David Smith <dsmith@redhat.com>
PR5422
* iostat-scsi.stp: Updated to handle kernel versions > 2.6.24.
* iostat-scsi.txt: Updated.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/ChangeLog | 6 | ||||
-rwxr-xr-x | examples/iostat-scsi.stp | 24 | ||||
-rw-r--r-- | examples/iostat-scsi.txt | 2 |
3 files changed, 31 insertions, 1 deletions
diff --git a/examples/ChangeLog b/examples/ChangeLog index 99fc6928..ae011376 100644 --- a/examples/ChangeLog +++ b/examples/ChangeLog @@ -1,3 +1,9 @@ +2008-03-05 David Smith <dsmith@redhat.com> + + PR5422 + * iostat-scsi.stp: Updated to handle kernel versions > 2.6.24. + * iostat-scsi.txt: Updated. + 2008-01-29 Frank Ch. Eigler <fche@elastic.org> * nettop.stp: Reorganize array usage to minimize contention. diff --git a/examples/iostat-scsi.stp b/examples/iostat-scsi.stp index a65ec3f7..ef778e53 100755 --- a/examples/iostat-scsi.stp +++ b/examples/iostat-scsi.stp @@ -3,6 +3,7 @@ global devices, reads, writes /* data collection: SCSI disk */ +%(kernel_v<"2.6.24" %? probe module("sd_mod").function("sd_init_command") !, kernel.function("sd_init_command") { device=kernel_string($SCpnt->request->rq_disk->disk_name) sector_size=$SCpnt->device->sector_size @@ -17,6 +18,29 @@ probe module("sd_mod").function("sd_init_command") !, kernel.function("sd_init_c else 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(); +%} + +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) + nr_sectors=$rq->nr_sectors + devices[device] = 1 + if ($rq->cmd_flags & 1) + writes[device] <<< nr_sectors * sector_size + else + reads[device] <<< nr_sectors * sector_size +} +%) + /* data collection: SCSI tape */ probe module("st").function("st_do_scsi") !, kernel.function("st_do_scsi") { device=kernel_string($STp->disk->disk_name) diff --git a/examples/iostat-scsi.txt b/examples/iostat-scsi.txt index 81157b1d..8222f659 100644 --- a/examples/iostat-scsi.txt +++ b/examples/iostat-scsi.txt @@ -1,6 +1,6 @@ From: http://sourceware.org/systemtap/wiki/WSiostatSCSI -# stap iostat-scsi.stp 10 # seconds between reports +# stap -g iostat-scsi.stp 10 # seconds between reports Device: tps blk_read/s blk_wrtn/s blk_read blk_wrtn sda 1.30 2.40 105.60 24 1056 |