diff options
Diffstat (limited to 'testsuite/systemtap.examples/io')
-rw-r--r-- | testsuite/systemtap.examples/io/disktop.meta | 2 | ||||
-rw-r--r-- | testsuite/systemtap.examples/io/io_submit.meta | 2 | ||||
-rw-r--r-- | testsuite/systemtap.examples/io/ioblktime.meta | 2 | ||||
-rw-r--r-- | testsuite/systemtap.examples/io/iostat-scsi.meta | 14 | ||||
-rwxr-xr-x | testsuite/systemtap.examples/io/iostat-scsi.stp | 19 | ||||
-rw-r--r-- | testsuite/systemtap.examples/io/iostats.meta | 2 | ||||
-rw-r--r-- | testsuite/systemtap.examples/io/iotime.meta | 2 | ||||
-rw-r--r-- | testsuite/systemtap.examples/io/iotop.meta | 2 | ||||
-rw-r--r-- | testsuite/systemtap.examples/io/traceio.meta | 2 | ||||
-rw-r--r-- | testsuite/systemtap.examples/io/traceio2.meta | 2 | ||||
-rw-r--r-- | testsuite/systemtap.examples/io/ttyspy.meta | 2 |
11 files changed, 37 insertions, 14 deletions
diff --git a/testsuite/systemtap.examples/io/disktop.meta b/testsuite/systemtap.examples/io/disktop.meta index b063075b..1d0ce04b 100644 --- a/testsuite/systemtap.examples/io/disktop.meta +++ b/testsuite/systemtap.examples/io/disktop.meta @@ -10,4 +10,4 @@ output: timed scope: system-wide description: Get the status of reading/writing disk every 5 seconds, output top ten entries during that period. test_check: stap -p4 disktop.stp -test_installcheck: stap disktop.stp -c "sleep 1" +test_installcheck: stap disktop.stp -c "sleep 0.2" diff --git a/testsuite/systemtap.examples/io/io_submit.meta b/testsuite/systemtap.examples/io/io_submit.meta index 911cb837..7bbc33a1 100644 --- a/testsuite/systemtap.examples/io/io_submit.meta +++ b/testsuite/systemtap.examples/io/io_submit.meta @@ -10,4 +10,4 @@ output: sorted on-exit scope: system-wide description: When a reschedule occurs during an AIO io_submit call, accumulate the traceback in a histogram. When the script exits prints out a sorted list from most common to least common backtrace. test_check: stap -p4 io_submit.stp -test_installcheck: stap io_submit.stp -c "sleep 1" +test_installcheck: stap io_submit.stp -c "sleep 0.2" diff --git a/testsuite/systemtap.examples/io/ioblktime.meta b/testsuite/systemtap.examples/io/ioblktime.meta index 18a8b168..09425b29 100644 --- a/testsuite/systemtap.examples/io/ioblktime.meta +++ b/testsuite/systemtap.examples/io/ioblktime.meta @@ -10,4 +10,4 @@ output: sorted-list scope: system-wide description: The ioblktime.stp script tracks the amount of time that each block IO requests spend waiting for completion. The script computes the average time waiting time for block IO per device and prints list every 10 seconds. In some cases there can be too many oustanding block IO operations and the script may exceed the default number of MAXMAPENTRIES allowed. In this case the allowed number can be increased with "-DMAXMAPENTRIES=10000" option on the stap command line. test_check: stap -p4 ioblktime.stp -test_installcheck: stap ioblktime.stp -c "sleep 1" +test_installcheck: stap ioblktime.stp -c "sleep 0.2" diff --git a/testsuite/systemtap.examples/io/iostat-scsi.meta b/testsuite/systemtap.examples/io/iostat-scsi.meta new file mode 100644 index 00000000..a992bd51 --- /dev/null +++ b/testsuite/systemtap.examples/io/iostat-scsi.meta @@ -0,0 +1,14 @@ +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_support: stap -l module("st").function("st_do_scsi")!,kernel.function("st_do_scsi") +test_check: stap -g -p4 iostat-scsi.stp 1 +test_installcheck: stap -g iostat-scsi.stp 1 -c "sleep 0.2" 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 diff --git a/testsuite/systemtap.examples/io/iostats.meta b/testsuite/systemtap.examples/io/iostats.meta index a74c9fe4..2f0a2c50 100644 --- a/testsuite/systemtap.examples/io/iostats.meta +++ b/testsuite/systemtap.examples/io/iostats.meta @@ -10,4 +10,4 @@ output: sorted-list scope: system-wide description: The iostat.stp script measures the amount of data successfully read and written by all the executables on the system. The output is sorted from most greatest sum of bytes read and written by an executable to the least. The output contains the count of operations (opens, reads, and writes), the totals and averages for the number of bytes read and written. test_check: stap -p4 iostats.stp -test_installcheck: stap iostats.stp -c "sleep 1" +test_installcheck: stap iostats.stp -c "sleep 0.2" diff --git a/testsuite/systemtap.examples/io/iotime.meta b/testsuite/systemtap.examples/io/iotime.meta index f656ff85..cde49974 100644 --- a/testsuite/systemtap.examples/io/iotime.meta +++ b/testsuite/systemtap.examples/io/iotime.meta @@ -10,4 +10,4 @@ output: trace scope: system-wide description: The script watches each open, close, read, and write syscalls on the system. For each file the scripts observes opened it accumulates the amount of wall clock time spend in read and write operations and the number of bytes read and written. When a file is closed the script prints out a pair of lines for the file. Both lines begin with a timestamp in microseconds, the PID number, and the executable name in parenthesese. The first line with the "access" keyword lists the file name, the attempted number of bytes for the read and write operations. The second line with the "iotime" keyword list the file name and the number of microseconds accumulated in the read and write syscalls. test_check: stap -p4 iotime.stp -test_installcheck: stap iotime.stp -c "sleep 1" +test_installcheck: stap iotime.stp -c "sleep 0.2" diff --git a/testsuite/systemtap.examples/io/iotop.meta b/testsuite/systemtap.examples/io/iotop.meta index d5331eda..52a8e2f3 100644 --- a/testsuite/systemtap.examples/io/iotop.meta +++ b/testsuite/systemtap.examples/io/iotop.meta @@ -10,4 +10,4 @@ output: timed scope: system-wide description: Every five seconds print out the top ten executables generating I/O traffic during that interval sorted in descending order. test_check: stap -p4 iotop.stp -test_installcheck: stap iotop.stp -c "sleep 1" +test_installcheck: stap iotop.stp -c "sleep 0.2" diff --git a/testsuite/systemtap.examples/io/traceio.meta b/testsuite/systemtap.examples/io/traceio.meta index da0b99f3..77e7f5df 100644 --- a/testsuite/systemtap.examples/io/traceio.meta +++ b/testsuite/systemtap.examples/io/traceio.meta @@ -10,4 +10,4 @@ output: timed scope: system-wide description: Every second print out the top ten executables sorted in descending order based on cumulative I/O traffic observed. test_check: stap -p4 traceio.stp -test_installcheck: stap traceio.stp -c "sleep 1" +test_installcheck: stap traceio.stp -c "sleep 0.2" diff --git a/testsuite/systemtap.examples/io/traceio2.meta b/testsuite/systemtap.examples/io/traceio2.meta index 4b63108c..432978ca 100644 --- a/testsuite/systemtap.examples/io/traceio2.meta +++ b/testsuite/systemtap.examples/io/traceio2.meta @@ -10,4 +10,4 @@ output: trace scope: system-wide description: Print out the executable name and process number as reads and writes to the specified device occur. test_check: stap -p4 traceio2.stp 0x0801 -test_installcheck: stap traceio2.stp 0x0801 -c "sleep 1" +test_installcheck: stap traceio2.stp 0x0801 -c "sleep 0.2" diff --git a/testsuite/systemtap.examples/io/ttyspy.meta b/testsuite/systemtap.examples/io/ttyspy.meta index e29add1b..b190eafd 100644 --- a/testsuite/systemtap.examples/io/ttyspy.meta +++ b/testsuite/systemtap.examples/io/ttyspy.meta @@ -3,4 +3,4 @@ name: ttyspy.stp keywords: io tty per-process monitor description: The ttyspy.stp script uses tty_audit hooks to monitor recent typing activity on the system, printing a scrolling record of recent keystrokes, on a per-tty basis. test_check: stap -gp4 ttyspy.stp -test_installcheck: stap --skip-badvars -g ttyspy.stp -c "sleep 7" +test_installcheck: stap --skip-badvars -g ttyspy.stp -c "sleep 1" |