summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Cohen <wcohen@redhat.com>2009-02-06 17:44:23 -0500
committerWilliam Cohen <wcohen@redhat.com>2009-02-06 17:44:23 -0500
commit3e4444ed0b5367ee58c89685c2ee072abc185737 (patch)
tree9c2d1cc0976246467834d39b1c48b17a837b428c
parent5c54d49ebb4da71680cb45e3be221e11b9b8d364 (diff)
downloadsystemtap-steved-3e4444ed0b5367ee58c89685c2ee072abc185737.tar.gz
systemtap-steved-3e4444ed0b5367ee58c89685c2ee072abc185737.tar.xz
systemtap-steved-3e4444ed0b5367ee58c89685c2ee072abc185737.zip
Fold the systemtap.samples/iotask*.stp into systemtap.examples/io/iostats.stp.
Regenerate the catalog information.
-rw-r--r--testsuite/ChangeLog11
-rw-r--r--testsuite/systemtap.examples/index.html3
-rw-r--r--testsuite/systemtap.examples/index.txt11
-rw-r--r--testsuite/systemtap.examples/io/iostats.meta13
-rw-r--r--testsuite/systemtap.examples/io/iostats.stp44
-rw-r--r--testsuite/systemtap.examples/keyword-index.html6
-rw-r--r--testsuite/systemtap.examples/keyword-index.txt22
-rw-r--r--testsuite/systemtap.samples/iotask.stp44
-rw-r--r--testsuite/systemtap.samples/iotask2.stp42
9 files changed, 110 insertions, 86 deletions
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog
index 7a005ffb..a9fc0b1e 100644
--- a/testsuite/ChangeLog
+++ b/testsuite/ChangeLog
@@ -1,5 +1,16 @@
2009-02-06 Will Cohen <wcohen@redhat.com>
+ * systemtap.samples/iotask.stp:
+ * systemtap.samples/iotask2.stp: Remove.
+ * systemtap.examples/io/iostats.stp:
+ * systemtap.examples/io/iostats.meta: New
+ * systemtap.examples/index.html:
+ * systemtap.examples/index.txt:
+ * systemtap.examples/keyword-index.html:
+ * systemtap.examples/keyword-index.txt: Regenerate.
+
+2009-02-06 Will Cohen <wcohen@redhat.com>
+
* systemtap.samples/syscalls.stp:
* systemtap.samples/syscalls1.exp:
* systemtap.samples/syscalls2.exp: Removed.
diff --git a/testsuite/systemtap.examples/index.html b/testsuite/systemtap.examples/index.html
index e02ab867..17c520ef 100644
--- a/testsuite/systemtap.examples/index.html
+++ b/testsuite/systemtap.examples/index.html
@@ -58,6 +58,9 @@ keywords: <a href="keyword-index.html#DISK">DISK</a> <br>
<li><a href="io/io_submit.stp">io/io_submit.stp</a> - Tally Reschedule Reason During AIO io_submit Call<br>
keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
<p>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.</p></li>
+<li><a href="io/iostats.stp">io/iostats.stp</a> - List Executables Reading and Writing the Most Data<br>
+keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
+<p> 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.</p></li>
<li><a href="io/iotime.stp">io/iotime.stp</a> - Trace Time Spent in Read and Write for Files <br>
keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#READ">READ</a> <a href="keyword-index.html#WRITE">WRITE</a> <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#IO">IO</a> <br>
<p>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.</p></li>
diff --git a/testsuite/systemtap.examples/index.txt b/testsuite/systemtap.examples/index.txt
index 0076afaa..7ae951db 100644
--- a/testsuite/systemtap.examples/index.txt
+++ b/testsuite/systemtap.examples/index.txt
@@ -52,6 +52,17 @@ keywords: io backtrace
list from most common to least common backtrace.
+io/iostats.stp - List Executables Reading and Writing the Most Data
+keywords: io profiling
+
+ 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.
+
+
io/iotime.stp - Trace Time Spent in Read and Write for Files
keywords: syscall read write time io
diff --git a/testsuite/systemtap.examples/io/iostats.meta b/testsuite/systemtap.examples/io/iostats.meta
new file mode 100644
index 00000000..a74c9fe4
--- /dev/null
+++ b/testsuite/systemtap.examples/io/iostats.meta
@@ -0,0 +1,13 @@
+title: List Executables Reading and Writing the Most Data
+name: iostats.stp
+version: 1.0
+author: anonymous
+keywords: io profiling
+subsystem: io
+status: production
+exit: user-controlled
+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"
diff --git a/testsuite/systemtap.examples/io/iostats.stp b/testsuite/systemtap.examples/io/iostats.stp
new file mode 100644
index 00000000..90bb4f5b
--- /dev/null
+++ b/testsuite/systemtap.examples/io/iostats.stp
@@ -0,0 +1,44 @@
+#! /usr/bin/env stap
+global opens, reads, writes, totals
+
+probe begin { printf("starting probe\n") }
+
+probe syscall.open {
+ e=execname();
+ opens[e] <<< 1 # statistics array
+}
+
+probe syscall.read.return {
+ count = $return
+ if ( count >= 0 ) {
+ e=execname();
+ reads[e] <<< count # statistics array
+ totals[e] += count
+ }
+}
+
+probe syscall.write.return {
+ count = $return
+ if (count >= 0 ) {
+ e=execname();
+ writes[e] <<< count # statistics array
+ totals[e] += 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", "open", "read", "KB tot", "B avg", "write", "KB tot", "B avg")
+ foreach (name in totals- limit 20) { # sort by total io
+ printf("%16s %8d %8d %8d %8d %8d %8d %8d\n",
+ name, @count(opens[name]),
+ @count(reads[name]),
+ (@count(reads[name]) ? @sum(reads[name])>>10 : 0 ),
+ (@count(reads[name]) ? @avg(reads[name]) : 0 ),
+ @count(writes[name]),
+ (@count(writes[name]) ? @sum(writes[name])>>10 : 0 ),
+ (@count(writes[name]) ? @avg(writes[name]) : 0 ))
+ }
+}
diff --git a/testsuite/systemtap.examples/keyword-index.html b/testsuite/systemtap.examples/keyword-index.html
index 3156cc08..822131d5 100644
--- a/testsuite/systemtap.examples/keyword-index.html
+++ b/testsuite/systemtap.examples/keyword-index.html
@@ -102,6 +102,9 @@ keywords: <a href="keyword-index.html#INTERRUPT">INTERRUPT</a> <a href="keyword-
<li><a href="io/io_submit.stp">io/io_submit.stp</a> - Tally Reschedule Reason During AIO io_submit Call<br>
keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#BACKTRACE">BACKTRACE</a> <br>
<p>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.</p></li>
+<li><a href="io/iostats.stp">io/iostats.stp</a> - List Executables Reading and Writing the Most Data<br>
+keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
+<p> 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.</p></li>
<li><a href="io/iotime.stp">io/iotime.stp</a> - Trace Time Spent in Read and Write for Files <br>
keywords: <a href="keyword-index.html#SYSCALL">SYSCALL</a> <a href="keyword-index.html#READ">READ</a> <a href="keyword-index.html#WRITE">WRITE</a> <a href="keyword-index.html#TIME">TIME</a> <a href="keyword-index.html#IO">IO</a> <br>
<p>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.</p></li>
@@ -144,6 +147,9 @@ keywords: <a href="keyword-index.html#NETWORK">NETWORK</a> <a href="keyword-inde
</ul>
<h3><a name="PROFILING">PROFILING</a></h3>
<ul>
+<li><a href="io/iostats.stp">io/iostats.stp</a> - List Executables Reading and Writing the Most Data<br>
+keywords: <a href="keyword-index.html#IO">IO</a> <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
+<p> 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.</p></li>
<li><a href="process/pf2.stp">process/pf2.stp</a> - Profile kernel functions<br>
keywords: <a href="keyword-index.html#PROFILING">PROFILING</a> <br>
<p>The pf2.stp script sets up time-based sampling. Every five seconds it prints out a sorted list with the top ten kernel functions with samples.</p></li>
diff --git a/testsuite/systemtap.examples/keyword-index.txt b/testsuite/systemtap.examples/keyword-index.txt
index a940ccfa..acc010c1 100644
--- a/testsuite/systemtap.examples/keyword-index.txt
+++ b/testsuite/systemtap.examples/keyword-index.txt
@@ -125,6 +125,17 @@ keywords: io backtrace
list from most common to least common backtrace.
+io/iostats.stp - List Executables Reading and Writing the Most Data
+keywords: io profiling
+
+ 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.
+
+
io/iotime.stp - Trace Time Spent in Read and Write for Files
keywords: syscall read write time io
@@ -227,6 +238,17 @@ keywords: network traffic per-process
= PROFILING =
+io/iostats.stp - List Executables Reading and Writing the Most Data
+keywords: io profiling
+
+ 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.
+
+
process/pf2.stp - Profile kernel functions
keywords: profiling
diff --git a/testsuite/systemtap.samples/iotask.stp b/testsuite/systemtap.samples/iotask.stp
deleted file mode 100644
index 1b4c7243..00000000
--- a/testsuite/systemtap.samples/iotask.stp
+++ /dev/null
@@ -1,44 +0,0 @@
-#! /usr/bin/env stap
-# iotask.stp
-# A reimplementation of user script: iotask.stp given at OLS 2005
-# in the current language.
-#
-# Will Cohen
-# 9/22/2005
-
-global names, opens
-global reads, read_bytes
-global writes, write_bytes
-
-probe kernel.function("sys_open") {
- ++names[execname()]; ++opens[execname()];
-}
-
-probe kernel.function("sys_read") {
- ++names[execname()]; ++reads[execname()];
- read_bytes[execname()] += $count;
-}
-
-probe kernel.function("sys_write") {
- ++names[execname()]; ++writes[execname()];
- write_bytes[execname()] += $count;
-}
-
-probe begin { println( "starting probe" ); }
-
-probe end {
- foreach( name in names){
- printf ("process: %s\n", name);
- if (opens[name])
- printf ("opens=%d\n",opens[name])
- if (reads[name]){
- count = reads[name]; total=read_bytes[name];
- printf("reads=%d, sum=%d, avg=%d\n", count, total, total/count);
- }
- if (writes[name]){
- count = writes[name]; total=write_bytes[name];
- printf("writes=%d, sum=%d, avg=%d\n", count, total, total/count);
- }
- println("");
- }
-}
diff --git a/testsuite/systemtap.samples/iotask2.stp b/testsuite/systemtap.samples/iotask2.stp
deleted file mode 100644
index cc4707b7..00000000
--- a/testsuite/systemtap.samples/iotask2.stp
+++ /dev/null
@@ -1,42 +0,0 @@
-global names, opens, reads, writes
-
-probe begin { println("starting probe") }
-
-probe timer.ms(10000) {
- println("stopping probe after 10 seconds")
- exit()
-}
-
-probe kernel.function("sys_open") {
- e=execname(); names[e]=1
- opens[e] ++ # simple integer array
-}
-
-probe kernel.function("sys_read") {
- e=execname(); names[e]=1
- reads[e] <<< $count # statistics array
-}
-
-probe kernel.function("sys_write") {
- e=execname(); names[e]=1
- writes[e] <<< $count # statistics array
-}
-
-
-probe end {
- foreach (name+ in names) { # sort by name
- printf("process: %s\n", name)
- if (opens[name])
- printf("opens n=%d\n", opens[name])
- if (@count(reads[name]))
- printf("reads n=%d, sum=%d, avg=%d\n",
- @count(reads[name]), # extracting stat results
- @sum(reads[name]),
- @avg(reads[name]))
- if (@count(writes[name]))
- printf("writes n=%d, sum=%d, avg=%d\n",
- @count(writes[name]), # extracting stat results
- @sum(writes[name]),
- @avg(writes[name]))
- }
-}