summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.examples/io/nfs_func_users.stp
diff options
context:
space:
mode:
authorWilliam Cohen <wcohen@redhat.com>2010-02-02 14:32:38 -0500
committerWilliam Cohen <wcohen@redhat.com>2010-02-02 14:32:38 -0500
commit111dd9ac1d5e127b80c89be484be37ea326b449d (patch)
tree1b4f85890d811d8c4260eefe529ce34bf68985bb /testsuite/systemtap.examples/io/nfs_func_users.stp
parenta4f3198f0b774528ef17dfb1ce5b3e70b6eb82fb (diff)
downloadsystemtap-steved-111dd9ac1d5e127b80c89be484be37ea326b449d.tar.gz
systemtap-steved-111dd9ac1d5e127b80c89be484be37ea326b449d.tar.xz
systemtap-steved-111dd9ac1d5e127b80c89be484be37ea326b449d.zip
Add nfs_func_users example.
Diffstat (limited to 'testsuite/systemtap.examples/io/nfs_func_users.stp')
-rwxr-xr-xtestsuite/systemtap.examples/io/nfs_func_users.stp18
1 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/systemtap.examples/io/nfs_func_users.stp b/testsuite/systemtap.examples/io/nfs_func_users.stp
new file mode 100755
index 00000000..010db420
--- /dev/null
+++ b/testsuite/systemtap.examples/io/nfs_func_users.stp
@@ -0,0 +1,18 @@
+#!/usr/bin/env stap
+
+global nfsdcalls
+
+probe begin {
+ printf("Collecting top NFSD procs...\n")
+}
+
+probe kernel.function("*@fs/nfs/*proc.c") ?,
+ module("nfs").function("*@fs/nfs/*proc.c") ? {
+ nfsdcalls[execname(), pid()]++
+}
+
+probe end {
+ printf("\nname(pid) nfs ops\n");
+ foreach ([name,p] in nfsdcalls- limit 20)
+ printf("%s(%d) %d\n", name, p, nfsdcalls[name, p])
+}