summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nfs/nfs_topreads.stp22
1 files changed, 22 insertions, 0 deletions
diff --git a/nfs/nfs_topreads.stp b/nfs/nfs_topreads.stp
new file mode 100644
index 0000000..8e8fff2
--- /dev/null
+++ b/nfs/nfs_topreads.stp
@@ -0,0 +1,22 @@
+#!/usr/bin/env stap
+
+global starts, reads
+
+probe begin {
+ printf("Collecting top NFS reads...\n")
+}
+
+probe module("nfs").function("*@fs/nfs/read.c")
+{
+ starts[probefunc()] = gettimeofday_us()
+}
+probe module("nfs").function("*@fs/nfs/read.c").return
+{
+ reads[probefunc()] = gettimeofday_us() - starts[probefunc()]
+}
+
+probe end {
+ printf("Collating data...\n");
+ foreach (name in reads- limit 20)
+ printf("%10d %s\n", reads[name], name)
+}