summaryrefslogtreecommitdiffstats
path: root/top-ext3times.stp
diff options
context:
space:
mode:
authorSteve Dickson <steved#redhat.com>2008-06-03 07:18:37 -0400
committerSteve Dickson <steved#redhat.com>2008-06-03 07:18:37 -0400
commit0181fade6b230955e0c7761d91c007f6f8c931f9 (patch)
treec7f01bee15655af7acf42b75196a4c8d63107b58 /top-ext3times.stp
parent916ea54791f05bf70be648e4e0ea8deea98e682f (diff)
downloadsystemtap-0181fade6b230955e0c7761d91c007f6f8c931f9.tar.gz
systemtap-0181fade6b230955e0c7761d91c007f6f8c931f9.tar.xz
systemtap-0181fade6b230955e0c7761d91c007f6f8c931f9.zip
Added top-ext3times.stp
Diffstat (limited to 'top-ext3times.stp')
-rwxr-xr-xtop-ext3times.stp51
1 files changed, 51 insertions, 0 deletions
diff --git a/top-ext3times.stp b/top-ext3times.stp
new file mode 100755
index 0000000..25b5336
--- /dev/null
+++ b/top-ext3times.stp
@@ -0,0 +1,51 @@
+#!/usr/bin/env stap
+
+global timebyfunc, topave, topcnt
+global start
+
+probe begin {
+ printf("Collecting data...\n")
+}
+
+probe module("ext3").function("*@fs/ext3/*")
+{
+ start[probefunc(), tid()] = gettimeofday_ns()
+}
+probe module("ext3").function("*@fs/ext3/*").return
+{
+ if (!([probefunc(), tid()] in start)) next
+
+ delta = gettimeofday_ns() - start[probefunc(), tid()]
+ timebyfunc[probefunc()] <<< delta
+
+ delete start[probefunc(), tid()]
+}
+function print_header() {
+ printf("%-26s %10s %12s %12s %12s %12s\n",
+ "Call", "Count", "Total ns",
+ "Avg ns", "Min ns", "Max ns")
+}
+probe end {
+ print_header()
+ foreach (call in timebyfunc)
+ topave[call] = @avg(timebyfunc[call])
+ foreach (call in timebyfunc)
+ topcnt[call] = @count(timebyfunc[call])
+ foreach (call in topcnt- )
+ printf("%-26s %10d %12d %12d %12d %12d\n", call,
+ @count(timebyfunc[call]),
+ @sum(timebyfunc[call]),
+ @avg(timebyfunc[call]),
+ @min(timebyfunc[call]),
+ @max(timebyfunc[call]))
+ //foreach (call in timebyfunc)
+ // printf("%-26s %10d %12d %12d %12d %12d\n", call,
+ // @count(timebyfunc[call]),
+ // @sum(timebyfunc[call]),
+ // @avg(timebyfunc[call]),
+ // @min(timebyfunc[call]),
+ // @max(timebyfunc[call]))
+
+ delete timebyfunc
+}
+