summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Cohen <wcohen@redhat.com>2010-02-02 14:19:02 -0500
committerWilliam Cohen <wcohen@redhat.com>2010-02-02 14:19:02 -0500
commita4f3198f0b774528ef17dfb1ce5b3e70b6eb82fb (patch)
tree18a51685b92228af017a00232c81a939f4682154
parent743757687f9c09bf9ef84b576bc0aa0fc19dea4c (diff)
downloadsystemtap-steved-a4f3198f0b774528ef17dfb1ce5b3e70b6eb82fb.tar.gz
systemtap-steved-a4f3198f0b774528ef17dfb1ce5b3e70b6eb82fb.tar.xz
systemtap-steved-a4f3198f0b774528ef17dfb1ce5b3e70b6eb82fb.zip
Add iodevstats.stp example
-rw-r--r--testsuite/systemtap.examples/index.html3
-rw-r--r--testsuite/systemtap.examples/index.txt12
-rw-r--r--testsuite/systemtap.examples/io/iodevstats.meta13
-rwxr-xr-xtestsuite/systemtap.examples/io/iodevstats.stp39
-rw-r--r--testsuite/systemtap.examples/keyword-index.html6
-rw-r--r--testsuite/systemtap.examples/keyword-index.txt24
6 files changed, 97 insertions, 0 deletions
diff --git a/testsuite/systemtap.examples/index.html b/testsuite/systemtap.examples/index.html
index 294c6991..83c82d29 100644
--- a/testsuite/systemtap.examples/index.html
+++ b/testsuite/systemtap.examples/index.html
@@ -73,6 +73,9 @@ keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#BAC
<li><a href="io/ioblktime.stp">io/ioblktime.stp</a> - Average Time Block IO Requests Spend in Queue <br>
keywords: <a href="keyword-index.html#IO">IO</a> <br>
<p>The ioblktime.stp script tracks the amount of time that each block IO requests spend waiting for completion. The script computes the average waiting time for block IO per device and prints list every 10 seconds. In some cases there can be too many outstanding 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.</p></li>
+<li><a href="io/iodevstats.stp">io/iodevstats.stp</a> - List Executables Reading and Writing the Most Data by Device<br>
+keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
+<p> The iodevstats.stp script measures the amount of data successfully read and written by all the executables for each io device on the system. The output is sorted from greatest sum of bytes read and written to a device by an executable to the least. The output contains device major/minor number, the count of operations (reads and writes), the totals and averages for the number of bytes read and written.</p></li>
<li><a href="io/iostat-scsi.stp">io/iostat-scsi.stp</a> - iostat for SCSI Devices<br>
keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#SCSI">SCSI</a> <br>
<p>The iostat-scsi.stp script provides a breakdown of the number of blks read and written on the machine's various SCSI devices. The script takes one argument which is the number of seconds between reports.</p></li>
diff --git a/testsuite/systemtap.examples/index.txt b/testsuite/systemtap.examples/index.txt
index ebcd17a3..c435612c 100644
--- a/testsuite/systemtap.examples/index.txt
+++ b/testsuite/systemtap.examples/index.txt
@@ -95,6 +95,18 @@ keywords: io
line.
+io/iodevstats.stp - List Executables Reading and Writing the Most Data by Device
+keywords: io profiling
+
+ The iodevstats.stp script measures the amount of data successfully
+ read and written by all the executables for each io device on the
+ system. The output is sorted from greatest sum of bytes read and
+ written to a device by an executable to the least. The output
+ contains device major/minor number, the count of operations (reads
+ and writes), the totals and averages for the number of bytes read and
+ written.
+
+
io/iostat-scsi.stp - iostat for SCSI Devices
keywords: io profiling scsi
diff --git a/testsuite/systemtap.examples/io/iodevstats.meta b/testsuite/systemtap.examples/io/iodevstats.meta
new file mode 100644
index 00000000..89277d2f
--- /dev/null
+++ b/testsuite/systemtap.examples/io/iodevstats.meta
@@ -0,0 +1,13 @@
+title: List Executables Reading and Writing the Most Data by Device
+name: iodevstats.stp
+version: 1.0
+author: anonymous
+keywords: io profiling
+subsystem: io
+status: production
+exit: user-controlled
+output: sorted-list
+scope: system-wide
+description: The iodevstats.stp script measures the amount of data successfully read and written by all the executables for each io device on the system. The output is sorted from greatest sum of bytes read and written to a device by an executable to the least. The output contains device major/minor number, the count of operations (reads and writes), the totals and averages for the number of bytes read and written.
+test_check: stap -p4 iodevstats.stp
+test_installcheck: stap iodevstats.stp -c "sleep 0.2"
diff --git a/testsuite/systemtap.examples/io/iodevstats.stp b/testsuite/systemtap.examples/io/iodevstats.stp
new file mode 100755
index 00000000..8925945f
--- /dev/null
+++ b/testsuite/systemtap.examples/io/iodevstats.stp
@@ -0,0 +1,39 @@
+#! /usr/bin/env stap
+global reads, writes, totals
+
+probe begin { printf("starting probe\n") }
+
+probe vfs.read.return {
+ count = $return
+ if ( count >= 0 ) {
+ e=execname();
+ reads[e,dev] <<< count # statistics array
+ totals[e,dev] += count
+ }
+}
+
+probe vfs.write.return {
+ count = $return
+ if (count >= 0 ) {
+ e=execname();
+ writes[e,dev] <<< count # statistics array
+ totals[e,dev] += count
+ }
+}
+
+probe end {
+ printf("\n%16s %8s %8s %8s %8s %8s %8s %8s\n",
+ "", "", "", "read", "read", "", "write", "write")
+ printf("%16s %8s %8s %8s %8s %8s %8s %8s\n",
+ "name", "device", "read", "KB tot", "B avg", "write", "KB tot", "B avg")
+ foreach ([name,dev] in totals- limit 20) { # sort by total io
+ printf("%16s %3d, %4d %8d %8d %8d %8d %8d %8d\n",
+ name, _dev_major(dev), _dev_minor(dev),
+ @count(reads[name,dev]),
+ (@count(reads[name,dev]) ? @sum(reads[name,dev])>>10 : 0 ),
+ (@count(reads[name,dev]) ? @avg(reads[name,dev]) : 0 ),
+ @count(writes[name,dev]),
+ (@count(writes[name,dev]) ? @sum(writes[name,dev])>>10 : 0 ),
+ (@count(writes[name,dev]) ? @avg(writes[name,dev]) : 0 ))
+ }
+}
diff --git a/testsuite/systemtap.examples/keyword-index.html b/testsuite/systemtap.examples/keyword-index.html
index 39d29031..7dcd05ce 100644
--- a/testsuite/systemtap.examples/keyword-index.html
+++ b/testsuite/systemtap.examples/keyword-index.html
@@ -165,6 +165,9 @@ keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#BAC
<li><a href="io/ioblktime.stp">io/ioblktime.stp</a> - Average Time Block IO Requests Spend in Queue <br>
keywords: <a href="keyword-index.html#IO">IO</a> <br>
<p>The ioblktime.stp script tracks the amount of time that each block IO requests spend waiting for completion. The script computes the average waiting time for block IO per device and prints list every 10 seconds. In some cases there can be too many outstanding 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.</p></li>
+<li><a href="io/iodevstats.stp">io/iodevstats.stp</a> - List Executables Reading and Writing the Most Data by Device<br>
+keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
+<p> The iodevstats.stp script measures the amount of data successfully read and written by all the executables for each io device on the system. The output is sorted from greatest sum of bytes read and written to a device by an executable to the least. The output contains device major/minor number, the count of operations (reads and writes), the totals and averages for the number of bytes read and written.</p></li>
<li><a href="io/iostat-scsi.stp">io/iostat-scsi.stp</a> - iostat for SCSI Devices<br>
keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#SCSI">SCSI</a> <br>
<p>The iostat-scsi.stp script provides a breakdown of the number of blks read and written on the machine's various SCSI devices. The script takes one argument which is the number of seconds between reports.</p></li>
@@ -324,6 +327,9 @@ keywords: <a href="keyword-index.html#PROCESS">PROCESS</a> <a href="keyword-inde
</ul>
<h3><a name="PROFILING">PROFILING</a></h3>
<ul>
+<li><a href="io/iodevstats.stp">io/iodevstats.stp</a> - List Executables Reading and Writing the Most Data by Device<br>
+keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
+<p> The iodevstats.stp script measures the amount of data successfully read and written by all the executables for each io device on the system. The output is sorted from greatest sum of bytes read and written to a device by an executable to the least. The output contains device major/minor number, the count of operations (reads and writes), the totals and averages for the number of bytes read and written.</p></li>
<li><a href="io/iostat-scsi.stp">io/iostat-scsi.stp</a> - iostat for SCSI Devices<br>
keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <a href="keyword-index.html#SCSI">SCSI</a> <br>
<p>The iostat-scsi.stp script provides a breakdown of the number of blks read and written on the machine's various SCSI devices. The script takes one argument which is the number of seconds between reports.</p></li>
diff --git a/testsuite/systemtap.examples/keyword-index.txt b/testsuite/systemtap.examples/keyword-index.txt
index 96ad06bd..1066d277 100644
--- a/testsuite/systemtap.examples/keyword-index.txt
+++ b/testsuite/systemtap.examples/keyword-index.txt
@@ -250,6 +250,18 @@ keywords: io
line.
+io/iodevstats.stp - List Executables Reading and Writing the Most Data by Device
+keywords: io profiling
+
+ The iodevstats.stp script measures the amount of data successfully
+ read and written by all the executables for each io device on the
+ system. The output is sorted from greatest sum of bytes read and
+ written to a device by an executable to the least. The output
+ contains device major/minor number, the count of operations (reads
+ and writes), the totals and averages for the number of bytes read and
+ written.
+
+
io/iostat-scsi.stp - iostat for SCSI Devices
keywords: io profiling scsi
@@ -670,6 +682,18 @@ keywords: process scheduler time tracepoint
= PROFILING =
+io/iodevstats.stp - List Executables Reading and Writing the Most Data by Device
+keywords: io profiling
+
+ The iodevstats.stp script measures the amount of data successfully
+ read and written by all the executables for each io device on the
+ system. The output is sorted from greatest sum of bytes read and
+ written to a device by an executable to the least. The output
+ contains device major/minor number, the count of operations (reads
+ and writes), the totals and averages for the number of bytes read and
+ written.
+
+
io/iostat-scsi.stp - iostat for SCSI Devices
keywords: io profiling scsi