summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/io/ioblktime.stp
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-03-19 12:47:30 -0400
committerDave Brolley <brolley@redhat.com>2009-03-19 12:47:30 -0400
commit1ca3466b0426566a6c6ba03251d8cca3d111f170 (patch)
tree92f6c41ebb29dc4210551bfea7ebc796d7472e2d /testsuite/systemtap.examples/io/ioblktime.stp
parent2855f6351e26f51953af11b17c4499df4d3d3441 (diff)
parent59b30bda24855bc46608a126efad8e150196721c (diff)
downloadsystemtap-steved-1ca3466b0426566a6c6ba03251d8cca3d111f170.tar.gz
systemtap-steved-1ca3466b0426566a6c6ba03251d8cca3d111f170.tar.xz
systemtap-steved-1ca3466b0426566a6c6ba03251d8cca3d111f170.zip
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Diffstat (limited to 'testsuite/systemtap.examples/io/ioblktime.stp')
-rwxr-xr-xtestsuite/systemtap.examples/io/ioblktime.stp29
1 files changed, 29 insertions, 0 deletions
diff --git a/testsuite/systemtap.examples/io/ioblktime.stp b/testsuite/systemtap.examples/io/ioblktime.stp
new file mode 100755
index 00000000..5ff59cf7
--- /dev/null
+++ b/testsuite/systemtap.examples/io/ioblktime.stp
@@ -0,0 +1,29 @@
+#! /usr/bin/env stap
+
+global req_time, etimes
+
+probe ioblock.request
+{
+ req_time[$bio] = gettimeofday_us()
+}
+
+probe ioblock.end
+{
+ t = gettimeofday_us()
+ s = req_time[$bio]
+ delete req_time[$bio]
+ if (s) {
+ etimes[devname, bio_rw_str(rw)] <<< t - s
+ }
+}
+
+probe timer.s(10), end {
+ printf("\033[2J\033[1;1H") /* clear screen */
+ printf("%10s %3s %10s %10s %10s\n",
+ "device", "rw", "total (us)", "count", "avg (us)")
+ foreach ([dev,rw] in etimes - limit 20) {
+ printf("%10s %3s %10d %10d %10d\n", dev, rw,
+ @sum(etimes[dev,rw]), @count(etimes[dev,rw]), @avg(etimes[dev,rw]))
+ }
+ delete etimes
+}