diff options
| author | Steve Dickson <steved@redhat.com> | 2009-11-17 11:44:37 -0500 |
|---|---|---|
| committer | Steve Dickson <steved@redhat.com> | 2009-11-17 11:44:37 -0500 |
| commit | ab361a8190ccef2cb675569b5cc8dddc579cb1bb (patch) | |
| tree | 99e70b6724d70b3ab2b7029eadf52eda3bee2cbd | |
| parent | e53853a96bb7f6cf8abf69fcd6645bc2cd9db9d2 (diff) | |
| parent | 536fe50ff10ac2048dd5d6a3b175c9a1cc384b7a (diff) | |
| download | systemtap-ab361a8190ccef2cb675569b5cc8dddc579cb1bb.tar.gz systemtap-ab361a8190ccef2cb675569b5cc8dddc579cb1bb.tar.xz systemtap-ab361a8190ccef2cb675569b5cc8dddc579cb1bb.zip | |
Merge branch 'master' of git://fedorapeople.org/~steved/systemtap
| -rw-r--r-- | ext3/ext3_acl.stp | 25 | ||||
| -rwxr-xr-x | ext3calltimes | 160 | ||||
| -rwxr-xr-x | funccount.sh | 57 | ||||
| -rwxr-xr-x | kernelcalltimes | 177 | ||||
| -rw-r--r-- | lockd/lockd_clnt.stp | 16 | ||||
| -rw-r--r-- | lockd/lockd_listener.stp (renamed from lockd_listener.stp) | 0 | ||||
| -rw-r--r-- | net/inet_bind.stp (renamed from sys_bind/inet_bind.stp) | 0 | ||||
| -rw-r--r-- | net/ipv6_bind.stp (renamed from bind.stp) | 0 | ||||
| -rw-r--r-- | nfs/nfs4_lck.stp (renamed from nfs4_lck.stp) | 0 | ||||
| -rw-r--r-- | nfs/nfs4_lookup_root.stp (renamed from nfs4_lookup_root.stp) | 0 | ||||
| -rw-r--r-- | nfs/nfs4_xattr.stp (renamed from nfs4_xattr.stp) | 0 | ||||
| -rw-r--r-- | nfs/nfs_auth.stp (renamed from nfs_auth.stp) | 0 | ||||
| -rw-r--r-- | nfs/nfs_mount.stp | 76 | ||||
| -rw-r--r-- | nfs/nfs_umount.stp (renamed from nfs_umount.stp) | 0 | ||||
| -rw-r--r-- | nfs/nfs_unlink.stp (renamed from nfsunlink.stp) | 0 | ||||
| -rw-r--r-- | nfs/nfsd_mount_opts.stp (renamed from mnt.stp) | 4 | ||||
| -rw-r--r-- | nfs_get_sb.stp | 10 | ||||
| -rw-r--r-- | nfsd/nfsd4_acl.stp (renamed from nfsd4_acl.stp) | 0 | ||||
| -rw-r--r-- | nfsd/nfsd4_callback.stp | 38 | ||||
| -rw-r--r-- | nfsd/nfsd4_open.stp | 49 | ||||
| -rw-r--r-- | nfsd/nfsd4_secinfo.stp (renamed from nfsd4_secinfo.stp) | 0 | ||||
| -rw-r--r-- | nfsd/nfsd4_set_nfs4_acl.stp | 29 | ||||
| -rw-r--r-- | nfsd/nfsd_auth.stp (renamed from nfsd_auth.stp) | 0 | ||||
| -rw-r--r-- | nfsd/nfsd_cacheio.stp (renamed from cacheio.stp) | 7 | ||||
| -rw-r--r-- | nfsd/nfsd_deleg.stp (renamed from nfsd_deleg.stp) | 20 | ||||
| -rw-r--r-- | nfsd/nfsd_dispatch.stp (renamed from nfsd_dispatch.stp) | 0 | ||||
| -rw-r--r-- | nfsd/nfsd_exports.stp (renamed from exports.stp) | 2 | ||||
| -rw-r--r-- | nfsd/nfsd_fh.stp (renamed from nfsd_fh.stp) | 0 | ||||
| -rw-r--r-- | nfsd/nfsd_lookup.stp (renamed from nfsd_lookup.stp) | 19 | ||||
| -rw-r--r-- | nfsd/nfsd_permission.stp | 37 | ||||
| -rw-r--r-- | nfsd/nfsd_setattr.stp (renamed from nfsd_setattr.stp) | 0 | ||||
| -rw-r--r-- | nfsd/svc_export.stp (renamed from svc_export.stp) | 0 | ||||
| -rw-r--r-- | nfsd_permission.stp | 16 | ||||
| -rw-r--r-- | prob.stp | 32 | ||||
| -rw-r--r-- | rpciod/rpciod.stp | 11 | ||||
| -rw-r--r-- | sunrpc/call_connect_status.stp | 12 | ||||
| -rw-r--r-- | sunrpc/call_status.stp | 32 | ||||
| -rw-r--r-- | sunrpc/force_rebind.stp | 66 | ||||
| -rw-r--r-- | sunrpc/rpc_killall.stp (renamed from rpc.stp) | 4 | ||||
| -rw-r--r-- | sunrpc/sunrpc-xprtsock.stp | 11 | ||||
| -rw-r--r-- | sunrpc/xprt.stp (renamed from xprt.stp) | 0 | ||||
| -rw-r--r-- | sys/open_namei.stp (renamed from open_namei.stp) | 0 | ||||
| -rw-r--r-- | sys/sysmount.stp (renamed from sysmount.stp) | 0 | ||||
| -rwxr-xr-x | syscalltimes | 248 | ||||
| -rw-r--r-- | tapset/acl.stp | 27 | ||||
| -rw-r--r-- | tapset/cachiodata.stp | 8 | ||||
| -rw-r--r-- | tapset/fs.stp | 8 | ||||
| -rw-r--r-- | tapset/fs_type.stp | 16 | ||||
| -rw-r--r-- | tapset/inode.stp | 13 | ||||
| -rw-r--r-- | tapset/nfs4_callback.stp | 38 | ||||
| -rw-r--r-- | tapset/nfs_mnt_rq.stp | 30 | ||||
| -rw-r--r-- | tapset/nfsmntflags.stp | 1 | ||||
| -rw-r--r-- | tapset/sunrpc_task.stp | 63 | ||||
| -rw-r--r-- | tapset/task.stp | 102 | ||||
| -rwxr-xr-x | top-nfscalls.stp | 6 | ||||
| -rw-r--r-- | top-nfsclient.stp | 145 | ||||
| -rwxr-xr-x | top-nfsdcalls.stp | 6 | ||||
| -rw-r--r-- | tracemarks/sched.stp | 3 | ||||
| -rw-r--r-- | tracepoints/rpc_call_status.stp | 38 |
59 files changed, 860 insertions, 802 deletions
diff --git a/ext3/ext3_acl.stp b/ext3/ext3_acl.stp new file mode 100644 index 0000000..904e146 --- /dev/null +++ b/ext3/ext3_acl.stp @@ -0,0 +1,25 @@ +/* + * To run: + * stap -g -I../tapset ext3_acl.stp + */ +probe module("ext3").function("ext3_get_acl") +{ + printf(" ext3_get_acl: inode %p\n", $inode); +} +probe module("ext3").function("ext3_get_acl").return +{ + if ($return) + printf(" ext3_get_acl: %s\n", acl_dump($return)); +} +probe module("ext3").function("ext3_check_acl") +{ + printf("ext3_check_acl: %s mask 0x%x\n", + inode_uid($inode), $mask); +} +probe module("ext3").function("ext3_check_acl").return +{ + printf("ext3_check_acl: %d\n", $return); +} +probe begin { log("starting ext3_acl probe") } +probe end { log("ending ext3_acl probe") } + diff --git a/ext3calltimes b/ext3calltimes deleted file mode 100755 index 675c9ab..0000000 --- a/ext3calltimes +++ /dev/null @@ -1,160 +0,0 @@ -#!/bin/bash -do_sort=0 -sort_ave=0 -sort_cnt=0 -sort_min=0 -sort_max=0 -sort_tot=0 -show_all=1 -pname="" -verbose="" -function usage { - echo "Usage: ext3calltimes [-Aachnmtv]" - echo " -A - Do all possible sorting" - echo " -a - sort by Ave ns" - echo " -c - sort by Count" - echo " -n - sort by Min ns" - echo " -m - sort by Max ns" - echo " -p - process name to monitor" - echo " -t - sort by Total ns" - echo " -v - turn on SystemTap debugging" - echo " -h - print this help text" -} -while getopts Aachnmp:tv option; do - case $option in - A) sort_ave=1; sort_cnt=1; sort_min=1; - sort_max=1; sort_tot=1; do_sort=1;; - a) sort_ave=1; do_sort=1;; - c) sort_cnt=1; do_sort=1 ;; - n) sort_min=1; do_sort=1 ;; - m) sort_max=1; do_sort=1 ;; - p) pname=$OPTARG;; - t) sort_tot=1; do_sort=1 ;; - v) verbose="-v "$verbose ;; - h|?|*) usage - exit 1;; - esac -done - -if [ $do_sort -eq 1 ]; then - show_all=0 -fi -echo "Creating and building SystemTap module..." - -stap "$verbose" -e ' -global timebyfunc, top -global start, pname_str - -probe begin { - pname_str = "'$pname'" - if (pname_str != "") { - printf("Collecting ext3 data on '%s' - type Ctrl-C to print output and exit...\n", pname_str); - } else - printf("Collecting ext3 data - type Ctrl-C to print output and exit...\n") -} - -probe module("ext3").function("*@fs/ext3/*") -{ - if (pname_str != "") { - if (execname() == pname_str) - start[probefunc(), tid()] = gettimeofday_ns() - } else - 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 { - if ('$sort_ave' != 0) { - printf("\nSorted ext3 data by Avg ns \n") - print_header() - foreach (call in timebyfunc) - top[call] = @avg(timebyfunc[call]) - foreach (call in top- limit 20) - 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 top - } - if ('$sort_cnt' != 0) { - printf("\nSorted ext3 data by Count\n") - print_header() - foreach (call in timebyfunc) - top[call] = @count(timebyfunc[call]) - foreach (call in top- limit 20) - 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 top - } - if ('$sort_tot' != 0) { - printf("\nSorted ext3 data by Total ns\n") - print_header() - foreach (call in timebyfunc) - top[call] = @sum(timebyfunc[call]) - foreach (call in top- limit 20) - 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 top - } - if ('$sort_min' != 0) { - printf("\nSorted ext3 data by Min ns\n") - print_header() - foreach (call in timebyfunc) - top[call] = @min(timebyfunc[call]) - foreach (call in top- limit 20) - 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 top - } - if ('$sort_max' != 0) { - printf("\nSorted ext3 data by Max ns\n") - print_header() - foreach (call in timebyfunc) - top[call] = @min(timebyfunc[call]) - foreach (call in top- limit 20) - 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 top - } - if ('$show_all' != 0) { - print_header() - 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 -}' diff --git a/funccount.sh b/funccount.sh deleted file mode 100755 index 0ba1ee4..0000000 --- a/funccount.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash -pname="" -verbose="" - -function usage { - echo "Usage: funccount [process]" -} -if [ $# -eq 1 ]; then - pname=$1 -fi - -echo "Creating and building SystemTap module..." - -stap "$verbose" -e ' -global timebyfunc, pages, page_sz -global start, pname_str, totcalls - -probe begin { - pname_str = "'$pname'" - printf("Collecting data for %s - type Ctrl-C to print output and exit...\n", pname_str); -} - -probe kernel.function("mpage_readpages") -{ - if ($nr_pages && execname() == pname_str) { - start[$nr_pages] = gettimeofday_ns() - pages=$nr_pages - } -} -probe kernel.function("mpage_readpages").return -{ - if (pages == 0) - next - - delta = gettimeofday_ns() - start[pages] - timebyfunc[pages] <<< delta - page_sz[pages] = pages - - delete start[pages] - pages=0 -} -function print_header() { - printf("%-19s %10s %12s\n", - "Call", "Count", "Total ns") -} -probe end { - print_header() - foreach (page in page_sz-) { - printf("mpage_readpages(%d) %10d %12d\n", page_sz[page], - @count(timebyfunc[page]), @sum(timebyfunc[page])) - totcalls += @count(timebyfunc[page]) - } - printf("Total Calls: %d\n", totcalls); - - delete page_sz - delete timebyfunc -}' diff --git a/kernelcalltimes b/kernelcalltimes deleted file mode 100755 index 0f88caf..0000000 --- a/kernelcalltimes +++ /dev/null @@ -1,177 +0,0 @@ -#!/bin/bash -do_sort=0 -sort_ave=0 -sort_cnt=0 -sort_min=0 -sort_max=0 -sort_tot=0 -show_all=1 -pname="" -verbose="" -function usage { - echo "Usage: ext3calltimes [-Aachnmtv]" - echo " -A - Do all possible sorting" - echo " -a - sort by Ave ns" - echo " -c - sort by Count" - echo " -n - sort by Min ns" - echo " -m - sort by Max ns" - echo " -p - process name to monitor" - echo " -t - sort by Total ns" - echo " -v - turn on SystemTap debugging" - echo " -h - print this help text" -} -while getopts Aachnmp:tv option; do - case $option in - A) sort_ave=1; sort_cnt=1; sort_min=1; - sort_max=1; sort_tot=1; do_sort=1;; - a) sort_ave=1; do_sort=1;; - c) sort_cnt=1; do_sort=1 ;; - n) sort_min=1; do_sort=1 ;; - m) sort_max=1; do_sort=1 ;; - p) pname=$OPTARG;; - t) sort_tot=1; do_sort=1 ;; - v) verbose="-v "$verbose ;; - h|?|*) usage - exit 1;; - esac -done - -if [ $do_sort -eq 1 ]; then - show_all=0 -fi -echo "Creating and building SystemTap module..." - -stap "$verbose" -e ' -global timebyfunc, top -global start, pname_str - -probe begin { - pname_str = "'$pname'" - if (pname_str != "") { - printf("Collecting ext3 data on '%s' - type Ctrl-C to print output and exit...\n", pname_str); - } else - printf("Collecting ext3 data - type Ctrl-C to print output and exit...\n") -} - -probe kernel.function("*@mm/readahead.c") -{ - if (pname_str != "") { - if (execname() == pname_str) - start[probefunc(), tid()] = gettimeofday_ns() - } else - start[probefunc(), tid()] = gettimeofday_ns() -} -probe kernel.function("*@mm/readahead.c").return -{ - if (!([probefunc(), tid()] in start)) next - - delta = gettimeofday_ns() - start[probefunc(), tid()] - timebyfunc[probefunc()] <<< delta - - delete start[probefunc(), tid()] -} -probe kernel.function("*@mm/filemap.c") -{ - if (pname_str != "") { - if (execname() == pname_str) - start[probefunc(), tid()] = gettimeofday_ns() - } else - start[probefunc(), tid()] = gettimeofday_ns() -} -probe kernel.function("*@mm/filemap.c").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 { - if ('$sort_ave' != 0) { - printf("\nSorted ext3 data by Avg ns \n") - print_header() - foreach (call in timebyfunc) - top[call] = @avg(timebyfunc[call]) - foreach (call in top- limit 20) - 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 top - } - if ('$sort_cnt' != 0) { - printf("\nSorted ext3 data by Count\n") - print_header() - foreach (call in timebyfunc) - top[call] = @count(timebyfunc[call]) - foreach (call in top- limit 20) - 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 top - } - if ('$sort_tot' != 0) { - printf("\nSorted ext3 data by Total ns\n") - print_header() - foreach (call in timebyfunc) - top[call] = @sum(timebyfunc[call]) - foreach (call in top- limit 20) - 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 top - } - if ('$sort_min' != 0) { - printf("\nSorted ext3 data by Min ns\n") - print_header() - foreach (call in timebyfunc) - top[call] = @min(timebyfunc[call]) - foreach (call in top- limit 20) - 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 top - } - if ('$sort_max' != 0) { - printf("\nSorted ext3 data by Max ns\n") - print_header() - foreach (call in timebyfunc) - top[call] = @min(timebyfunc[call]) - foreach (call in top- limit 20) - 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 top - } - if ('$show_all' != 0) { - print_header() - 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 -}' diff --git a/lockd/lockd_clnt.stp b/lockd/lockd_clnt.stp index 0769650..6a6537f 100644 --- a/lockd/lockd_clnt.stp +++ b/lockd/lockd_clnt.stp @@ -1,3 +1,7 @@ +/* + * stap -g -I../tapset lockd_clnt.stp + */ + %{ #include <linux/sunrpc/svc.h> #include <linux/sunrpc/sched.h> @@ -17,7 +21,7 @@ enum { }; %} -function task_error:string(_task:long) +function task_nlm_error:string(_task:long) %{ struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); char *errstr; @@ -47,14 +51,6 @@ function task_error:string(_task:long) CATCH_DEREF_FAULT(); %} -function task_status:long(_task:long) -%{ - struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); - - THIS->__retvalue = task->tk_status; - - CATCH_DEREF_FAULT(); -%} /* function rpcprocnum:long(_msg:long) %{ @@ -247,7 +243,7 @@ probe module("lockd").function("nlmclnt_unlock_callback") { if (task_status($task)) { printf("%s(%d): nlmclnt_unlock_callback: ERROR: %s \n", - execname(), pid(), task_error($task)); + execname(), pid(), task_nlm_error($task)); } } probe module("lockd").function("nlm_rebind_host") diff --git a/lockd_listener.stp b/lockd/lockd_listener.stp index ff845e6..ff845e6 100644 --- a/lockd_listener.stp +++ b/lockd/lockd_listener.stp diff --git a/sys_bind/inet_bind.stp b/net/inet_bind.stp index 621473a..621473a 100644 --- a/sys_bind/inet_bind.stp +++ b/net/inet_bind.stp diff --git a/bind.stp b/net/ipv6_bind.stp index 2a9db1c..2a9db1c 100644 --- a/bind.stp +++ b/net/ipv6_bind.stp diff --git a/nfs4_lck.stp b/nfs/nfs4_lck.stp index b170a95..b170a95 100644 --- a/nfs4_lck.stp +++ b/nfs/nfs4_lck.stp diff --git a/nfs4_lookup_root.stp b/nfs/nfs4_lookup_root.stp index 592af25..592af25 100644 --- a/nfs4_lookup_root.stp +++ b/nfs/nfs4_lookup_root.stp diff --git a/nfs4_xattr.stp b/nfs/nfs4_xattr.stp index 59b2280..59b2280 100644 --- a/nfs4_xattr.stp +++ b/nfs/nfs4_xattr.stp diff --git a/nfs_auth.stp b/nfs/nfs_auth.stp index c7fc739..c7fc739 100644 --- a/nfs_auth.stp +++ b/nfs/nfs_auth.stp diff --git a/nfs/nfs_mount.stp b/nfs/nfs_mount.stp new file mode 100644 index 0000000..32e41f7 --- /dev/null +++ b/nfs/nfs_mount.stp @@ -0,0 +1,76 @@ + +probe module("nfs").function("nfs_get_sb") +{ + printf("nfs_mount: fs_name %s dev %s \n", + fs_name($fs_type), kernel_string($dev_name)); + + printf(" : flags=[%s]\n", nfs_mntflags($raw_data)); +} +probe module("nfs").function("nfs_get_sb").return +{ + if ($return) + printf("nfs_mount: ERROR %d (%s)", $return, errno_str($return)); +} +/* +probe module("nfs").function("nfs_validate_mount_data") +{ + printf(" nfs_validate_mount_data: raw_data %p data %p\n", + $raw_data, $data); + + printf(" : flags=[%s]\n", nfs_mntflags($raw_data)); +} +probe module("nfs").function("nfs_validate_mount_data").return +{ + if ($return) + printf(" nfs_validate_mount_data: ERROR %d (%s)", $return, errno_str($return)); +} +*/ +probe module("nfs").function("nfs_parse_mount_options") +{ + printf(" nfs_parse_mount_options: raw [%s]\n", kernel_string($raw)); +} +probe module("nfs").function("nfs_parse_mount_options").return +{ + if ($return == 0) + printf(" nfs_parse_mount_options: Failed\n"); +} +probe module("nfs").function("nfs_parse_devname").return +{ + if ($return) + printf(" nfs_parse_devname: ERROR %d (%s)", $return, errno_str($return)); +} +/* +probe module("nfs").function("nfs_try_mount") +{ + printf(" nfs_try_mount: args %p root_fh %p\n", $args, $root_fh); +} +*/ +probe module("nfs").function("nfs_mount") +{ + printf(" nfs_mount: %s\n", mnt_req($info)); +} +probe module("nfs").function("nfs_mount").return +{ + if ($return) + printf(" nfs_mount: ERROR %d (%s)", $return, errno_str($return)); +} +probe module("nfs").function("nfs_get_root") +{ + printf(" nfs_get_root: sb %p mntfh %p\n", $sb, $mntfh); +} +probe module("nfs").function("nfs_get_root").return +{ + printf(" nfs_get_root: returns %p\n", $return); +} +/* +probe module("nfs").function("nfs_fill_super") +{ + printf(" nfs_fill_super: sb %p data %p \n", $sb, $data); +} +*/ +probe module("nfs").function("nfs_initialise_sb") +{ + printf(" nfs_initialise_sb: sb %p\n", $sb); +} +probe begin { log("starting nfs_mount probe") } +probe end { log("ending nfs_mount probe") } diff --git a/nfs_umount.stp b/nfs/nfs_umount.stp index e5f1164..e5f1164 100644 --- a/nfs_umount.stp +++ b/nfs/nfs_umount.stp diff --git a/nfsunlink.stp b/nfs/nfs_unlink.stp index 7fc417c..7fc417c 100644 --- a/nfsunlink.stp +++ b/nfs/nfs_unlink.stp diff --git a/mnt.stp b/nfs/nfsd_mount_opts.stp index 7a6df87..cd2ed96 100644 --- a/mnt.stp +++ b/nfs/nfsd_mount_opts.stp @@ -10,5 +10,5 @@ probe module("nfs").function("nfs_compare_mount_options") printf("acdirmin %d/%d\n", $a->acdirmin, $b->acdirmin); printf("acdirmax %d/%d\n", $a->acdirmax, $b->acdirmax); } -probe begin { log("starting probe") } -probe end { log("ending probe") } +probe begin { log("starting nfs_mount_opts") } +probe end { log("ending nfs_mount_opts probe") } diff --git a/nfs_get_sb.stp b/nfs_get_sb.stp deleted file mode 100644 index fed1c8e..0000000 --- a/nfs_get_sb.stp +++ /dev/null @@ -1,10 +0,0 @@ - -probe module("nfs").function("nfs_get_sb") -{ - printf("nfs_get_sb: fs_type %p flags 0x%x dev %p data %p mnt %p\n", - $fs_type, $flags, $dev_name, $raw_data, $mnt); - - printf(" : flags %s\n", nfs_mntflags($raw_data)); -} -probe begin { log("starting probe") } -probe end { log("ending probe") } diff --git a/nfsd4_acl.stp b/nfsd/nfsd4_acl.stp index e46403f..e46403f 100644 --- a/nfsd4_acl.stp +++ b/nfsd/nfsd4_acl.stp diff --git a/nfsd/nfsd4_callback.stp b/nfsd/nfsd4_callback.stp new file mode 100644 index 0000000..3853271 --- /dev/null +++ b/nfsd/nfsd4_callback.stp @@ -0,0 +1,38 @@ +probe module("nfsd").function("nfsd4_probe_callback") +{ + printf("nfsd4_probe_callback: client %s\n", nfs4_callback_addr($clp)); +} +/* +probe module("nfsd").function("nfsd4_setclientid_confirm") +{ + printf("nfsd4_setclientid_confirm: hellow\n"); +} +probe module("nfsd").function("*@fs/nfsd/nfs4state.c:3318") +{ + printf("nfsd4_setclientid_confirm: hellow\n"); +} +probe module("nfsd").function("*@fs/nfsd/nfs4callback.c") +{ + printf("%s\n", probefunc()); +} +*/ +probe module("nfsd").function("nfsd4_cb_probe_done") +{ + terror = task_status($task); + if (terror) + printf("nfsd4_cb_probe_done: client %s: error %d (%s)\n", + cl_server($task), terror, errno_str(terror)); +} +probe module("nfsd").function("nfsd4_setclientid_confirm").return +{ + if ($return) + printf("nfsd4_setclientid_confirm: status %d\n", $return); +} +probe module("nfsd").function("nfsd4_process_open2").return +{ + if ($return) + printf("nfsd4_process_open2: status %d\n", $return); +} + +probe begin { log("starting probe") } +probe end { log("ending probe") } diff --git a/nfsd/nfsd4_open.stp b/nfsd/nfsd4_open.stp new file mode 100644 index 0000000..73a14a6 --- /dev/null +++ b/nfsd/nfsd4_open.stp @@ -0,0 +1,49 @@ +/* + * To run: + * stap -g -I../tapset nfsd4_open.stp + */ +probe module("nfsd").function("nfsd4_process_open1") +{ + printf("nfsd4_process_open1: open %p\n", $open); +} +probe module("nfsd").function("nfsd4_process_open1").return +{ + printf("nfsd4_process_open1: %s\n", nfsderror($return)); +} + +probe module("nfsd").function("do_open_permission") +{ + printf("do_open_permission: open %p\n", $open); +} +probe module("nfsd").function("do_open_permission").return +{ + printf("do_open_permission: %s\n", nfsderror($return)); +} + +probe module("nfsd").function("nfsd4_process_open2") +{ + printf("nfsd4_process_open2: open %p\n", $open); +} +probe module("nfsd").function("nfsd4_process_open2").return +{ + printf("nfsd4_process_open2: %s\n", nfsderror($return)); +} +probe module("nfsd").function("nfsd_permission") +{ + printf("nfsd_permission: exp 0x%x\n", $acc); +} +probe module("nfsd").function("nfsd_permission").return +{ + printf("nfsd_permission: %s\n", nfsderror($return)); +} +probe module("ext3").function("ext3_check_acl") +{ + printf("ext3_check_acl: mask 0x%x\n", $mask); +} +probe module("ext3").function("ext3_check_acl").return +{ + printf("ext3_check_acl: %d\n", $return); +} +probe begin { log("starting nfsd4_open probe") } +probe end { log("ending nfsd4_open probe") } + diff --git a/nfsd4_secinfo.stp b/nfsd/nfsd4_secinfo.stp index aa91a26..aa91a26 100644 --- a/nfsd4_secinfo.stp +++ b/nfsd/nfsd4_secinfo.stp diff --git a/nfsd/nfsd4_set_nfs4_acl.stp b/nfsd/nfsd4_set_nfs4_acl.stp new file mode 100644 index 0000000..45fcd85 --- /dev/null +++ b/nfsd/nfsd4_set_nfs4_acl.stp @@ -0,0 +1,29 @@ +#!/usr/bin/env stap +/* + * To run: + * stap -g -I../tapset nfsd4_set_nfs4_acl.stp + */ + +probe module("nfsd").function("nfsd4_set_nfs4_acl") +{ + printf("nfsd4_set_nfs4_acl: rqstp %p \n", $rqstp); +} +probe module("nfsd").function("nfsd4_set_nfs4_acl").return +{ + printf("nfsd4_set_nfs4_acl: %s\n", nfsderror($return)); +} +probe module("nfsd").function("nfs4_acl_nfsv4_to_posix").return +{ + printf(" nfs4_acl_nfsv4_to_posix: %d(%s)\n", $return, errno_str($return)); +} +probe module("nfsd").function("set_nfsv4_acl_one").return +{ + printf(" set_nfsv4_acl_one: %s\n", nfsderror($return)); +} +probe module("nfsd").function("_nfsv4_to_posix_one").return +{ + printf(" _nfsv4_to_posix_one: %p\n", $return); +} +probe begin { log("starting nfsd4_set_nfs4_acl probe") } +probe end { log("ending nfsd4_set_nfs4_acl probe") } + diff --git a/nfsd_auth.stp b/nfsd/nfsd_auth.stp index 6e2b4d2..6e2b4d2 100644 --- a/nfsd_auth.stp +++ b/nfsd/nfsd_auth.stp diff --git a/cacheio.stp b/nfsd/nfsd_cacheio.stp index 3dc0a8d..62e65f8 100644 --- a/cacheio.stp +++ b/nfsd/nfsd_cacheio.stp @@ -49,11 +49,18 @@ probe module("nfsd").function("svc_export_parse").return if ($return < 0) printf(" svc_export_parse: error %s\n", errno_str($return)); } +/* probe module("nfsd").function("exp_get_by_name") { printf("exp_get_by_name: clp %p mnt %p dentry %p reqp %p\n", $clp, $mnt, $dentry, $reqp); } +*/ +probe module("nfsd").function("exp_get_by_name") +{ + printf("exp_get_by_name: clp %p path %p reqp %p\n", + $clp, $path, $reqp); +} probe module("nfsd").function("exp_get_by_name").return { printf("exp_get_by_name: return %p\n", $return); diff --git a/nfsd_deleg.stp b/nfsd/nfsd_deleg.stp index 02c7590..679d9ba 100644 --- a/nfsd_deleg.stp +++ b/nfsd/nfsd_deleg.stp @@ -1,10 +1,24 @@ probe module("nfsd").function("nfs4_open_delegation") { - printf("nfs4_open_delegation: fh %p open %p (type: %d) stp %d\n", + printf("nfs4_open_delegation: fh %p open %p (type: %d) stp %p\n", $fh, $open, $open->op_claim_type, $stp); printf(" : %s\n", nfs4_callback($stp)); } +global open_confirm + +probe module("nfsd").function("nfsd4_open_confirm") +{ + open_confirm = $oc +} +probe module("nfsd").function("nfsd4_open_confirm").return +{ + if ($return) { + printf("nfsd4_open_confirm: status %d\n", $return); + } else { + printf("nfsd4_open_confirm: %s\n", nfs4_openconf(open_confirm)); + } +} probe module("nfsd").function("alloc_init_deleg") { printf(" alloc_init_deleg: clp %p stp %p current_fh %p, type %d\n", @@ -14,6 +28,7 @@ probe module("nfsd").function("alloc_init_deleg").return { printf(" alloc_init_deleg: %p\n", $return); } +/* probe kernel.function("setlease") { printf(" setlease: filp %p arg %p\n", $filp, $arg); @@ -22,7 +37,6 @@ probe kernel.function("setlease").return { printf(" setlease: return %d (%s)\n", $return, errno_str($return)); } -/* probe kernel.function("security_file_lock") { printf(" security_file_lock: filp %p arg %p\n", $filp, $arg); @@ -32,7 +46,6 @@ probe kernel.function("security_file_lock").return printf(" security_file_lock: return %d (%s)\n", $return, errno_str($return)); } -*/ probe kernel.function("__setlease") { printf(" __setlease: filp %p arg %p\n", $filp, $arg); @@ -42,6 +55,7 @@ probe kernel.function("__setlease").return printf(" __setlease: return %d (%s)\n", $return, errno_str($return)); } +*/ probe begin { log("starting nfsd_deleg probe") } probe end { log("ending nfsd_deleg probe") } diff --git a/nfsd_dispatch.stp b/nfsd/nfsd_dispatch.stp index 15f9e6f..15f9e6f 100644 --- a/nfsd_dispatch.stp +++ b/nfsd/nfsd_dispatch.stp diff --git a/exports.stp b/nfsd/nfsd_exports.stp index ec73af8..fb0cacb 100644 --- a/exports.stp +++ b/nfsd/nfsd_exports.stp @@ -59,6 +59,7 @@ probe module("sunrpc").function("cache_check").return if ($return) printf(" cache_check: %s\n", errno_str($return)); } +/* probe module("sunrpc").function("cache_make_upcall") { printf(" cache_make_upcall: detail %p h %p \n", @@ -70,7 +71,6 @@ probe module("sunrpc").function("cache_make_upcall").return if ($return) printf(" cache_make_upcall: %s\n", errno_str($return)); } -/* probe module("nfsd").function("check_nfsd_access") { check_exp = $exp; diff --git a/nfsd_fh.stp b/nfsd/nfsd_fh.stp index 7c7fdbe..7c7fdbe 100644 --- a/nfsd_fh.stp +++ b/nfsd/nfsd_fh.stp diff --git a/nfsd_lookup.stp b/nfsd/nfsd_lookup.stp index 1c9e9b4..5230248 100644 --- a/nfsd_lookup.stp +++ b/nfsd/nfsd_lookup.stp @@ -17,15 +17,19 @@ probe module("nfsd").function("nfsd_lookup_dentry").return } probe module("nfsd").function("check_nfsd_access") { +/* check_exp = $exp; check_rqstp_flavor = $rqstp->rq_flavor; +*/ } probe module("nfsd").function("check_nfsd_access").return { if ($return != 0) { printf(" check_nfsd_access: %s\n", nfsderror($return)); +/* printf(" : rq_flavor %d %s\n", check_rqstp_flavor, svc_export_flavors(check_exp)); +*/ } } probe module("nfsd").function("fh_verify") @@ -43,27 +47,36 @@ probe module("nfsd").function("nfsd_setuser_and_check_port") { printf(" nfsd_setuser_and_check_port: rqstp %p exp %p \n", $rqstp, $exp); + printf(" : %s\n", svc_export_dump($exp)); } probe module("nfsd").function("nfsd_setuser_and_check_port").return { if ($return) printf(" nfsd_setuser_and_check_port: %s\n", nfsderror($return)); } +/* probe module("nfsd").function("check_nfsd_access") { printf(" check_nfsd_access: rqstp %p exp %p \n", $rqstp, $exp); } +*/ probe module("nfsd").function("check_nfsd_access").return { if ($return) printf(" check_nfsd_access: %s\n", nfsderror($return)); } +/* probe module("nfsd").function("rqst_exp_parent") { printf(" rqst_exp_parent: rqstp %p mnt %d dentry %d\n", $rqstp, $mnt, $dentry); } +*/ +probe module("nfsd").function("rqst_exp_parent") +{ + printf(" rqst_exp_parent: rqstp %p path %p \n", $rqstp, $path); +} probe module("nfsd").function("rqst_exp_parent").return { printf(" rqst_exp_parent: %p\n", $return); @@ -88,9 +101,15 @@ probe module("nfsd").function("nfsd_cross_mnt").return } probe module("nfsd").function("rqst_exp_get_by_name") { + printf(" rqst_exp_get_by_name: rqstp %p path %p \n", $rqstp, $path); +} +/* +probe module("nfsd").function("rqst_exp_get_by_name") +{ printf(" rqst_exp_get_by_name: rqstp %p mnt %p dentry %p\n", $rqstp, $mnt, $dentry); } +*/ probe module("nfsd").function("rqst_exp_get_by_name").return { printf(" rqst_exp_get_by_name: %p\n", $return); diff --git a/nfsd/nfsd_permission.stp b/nfsd/nfsd_permission.stp new file mode 100644 index 0000000..d73e615 --- /dev/null +++ b/nfsd/nfsd_permission.stp @@ -0,0 +1,37 @@ +#!/usr/bin/env stap + +probe module("nfsd").function("nfsd_permission") +{ + printf("nfsd_permission: rqstp %p exp %p dentry '%s' acc 0x%x\n", + $rqstp, $exp, dentry2name($dentry), $acc); + printf(" : %s\n", svc_export_dump($exp)); +} +probe kernel.function("inode_permission").return +{ + if ($return) + printf(" inode_permission: error: %d\n", $return); +} +probe kernel.function("security_inode_permission").return +{ + if ($return) + printf(" security_inode_permission: error: %d\n", $return); +} +probe kernel.function("devcgroup_inode_permission").return +{ + if ($return) + printf(" devcgroup_inode_permission: error: %d\n", $return); +} +probe kernel.function("generic_permission").return +{ + if ($return) + printf(" generic_permission: error: %d\n", $return); +} +probe module("nfsd").function("nfsd_permission").return +{ + if ($return) + printf("nfsd_permission: error: %s\n", nfsderror($return)); +} +probe begin { log("starting nfsd_permission probe") } +probe end { log("ending nfsd_permission probe") } + + diff --git a/nfsd_setattr.stp b/nfsd/nfsd_setattr.stp index b0cd7e0..b0cd7e0 100644 --- a/nfsd_setattr.stp +++ b/nfsd/nfsd_setattr.stp diff --git a/svc_export.stp b/nfsd/svc_export.stp index eb36538..eb36538 100644 --- a/svc_export.stp +++ b/nfsd/svc_export.stp diff --git a/nfsd_permission.stp b/nfsd_permission.stp deleted file mode 100644 index 7e27ca5..0000000 --- a/nfsd_permission.stp +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env stap - -probe module("nfsd").function("nfsd_permission") -{ - printf("nfsd_permission: rqstp %p exp %p dentry %p acc 0x%x\n", - $rqstp, $exp, $dentry, $acc); - printf(" : %s\n", svc_export_dump($exp)); -} -probe module("nfsd").function("nfsd_permission").return -{ - printf("nfsd_permission: %s\n", nfsderror($return)); -} -probe begin { log("starting nfsd_permission probe") } -probe end { log("ending nfsd_permission probe") } - - diff --git a/prob.stp b/prob.stp deleted file mode 100644 index b0defc6..0000000 --- a/prob.stp +++ /dev/null @@ -1,32 +0,0 @@ -probe module("nfsd").function("nfsd4_probe_callback") -{ - printf("nfsd4_probe_callback: clp %p\n", $clp); -} -probe module("nfsd").function("nfsd4_setclientid_confirm") -{ - printf("nfsd4_setclientid_confirm: hellow\n"); -} -/* -probe module("nfsd").function("*@fs/nfsd/nfs4state.c:3318") -{ - printf("nfsd4_setclientid_confirm: hellow\n"); -} -*/ -probe module("nfsd").function("nfsd4_setclientid_confirm").return -{ - printf("nfsd4_setclientid_confirm: status %d\n", $return); -} -probe module("nfsd").function("nfsd4_process_open2").return -{ - printf("nfsd4_process_open2: status %d\n", $return); -} -probe module("nfsd").function("svc_export_parse").return -{ - printf("svc_export_parse: status %d\n", $return); -} -probe module("sunrpc").function("rpc_exit_task") -{ - printf("rpc_exit_task: task 0x%p\n", $task); -} -probe begin { log("starting probe") } -probe end { log("ending probe") } diff --git a/rpciod/rpciod.stp b/rpciod/rpciod.stp new file mode 100644 index 0000000..37e5aec --- /dev/null +++ b/rpciod/rpciod.stp @@ -0,0 +1,11 @@ +/* + * stap -g -I../tapset rpciod.stp + */ +probe module("sunrpc").function("rpc_execute") +{ + if (task_status($task)) + printf("rpc_execute: task %p\n", $task); +} +probe begin { log("starting rpciod probe") } +probe end { log("ending rpciod probe") } + diff --git a/sunrpc/call_connect_status.stp b/sunrpc/call_connect_status.stp new file mode 100644 index 0000000..b6d8354 --- /dev/null +++ b/sunrpc/call_connect_status.stp @@ -0,0 +1,12 @@ +/* + * stap -g -I../tapset call_connect_status.stp + */ +probe module("sunrpc").function("call_connect_status") +{ + terror = task_status($task); + if (terror && terror == -107) + printf("call_connect_status:%s:%s: error %d (%s)\n", + cl_server($task), cl_prog($task), terror, errno_str(terror)); +} +probe begin { log("starting call_connect_status probe (ENOCONN)") } +probe end { log("ending call_connect_status probe (ENOCONN)") } diff --git a/sunrpc/call_status.stp b/sunrpc/call_status.stp new file mode 100644 index 0000000..56976cd --- /dev/null +++ b/sunrpc/call_status.stp @@ -0,0 +1,32 @@ +/* + * stap -g -I../tapset call_status.stp + */ +probe module("sunrpc").function("call_connect_status") +{ + terror = task_status($task); + if (terror) + printf("call_connect_status:%s:%s: error %d (%s)\n", + cl_server($task), cl_prog($task), terror, errno_str(terror)); +} +probe module("sunrpc").function("call_bind_status") +{ + terror = task_status($task); + if (terror) + printf("call_bind_status:%s:%s: error %d (%s)\n", + cl_server($task), cl_prog($task), terror, errno_str(terror)); +} +probe module("sunrpc").function("call_connect_status") +{ + terror = task_status($task); + if (terror) + printf("call_connect_status:%s:%s: error %d (%s)\n", + cl_server($task), cl_prog($task), terror, errno_str(terror)); +} +probe module("sunrpc").function("xs_tcp_finish_connecting").return +{ + if ($return) + printf("xs_tcp_finish_connecting: error %d (%s)\n", + $return, errno_str($return)); +} +probe begin { log("starting call_status probe") } +probe end { log("ending call_status probe") } diff --git a/sunrpc/force_rebind.stp b/sunrpc/force_rebind.stp index cd288a2..2fa92c7 100644 --- a/sunrpc/force_rebind.stp +++ b/sunrpc/force_rebind.stp @@ -1,66 +1,6 @@ -%{ -#include <linux/sunrpc/svc.h> -#include <linux/sunrpc/sched.h> -#include <linux/sunrpc/clnt.h> -%} - -function cl_prog:string(_task:long) -%{ - struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); - struct rpc_clnt *clnt = (struct rpc_clnt *)(long) kread(&(task->tk_client)); - struct rpc_procinfo *proc = - (struct rpc_procinfo *)(long) kread(&(clnt->cl_procinfo)); - char *p_name = kread(&(proc->p_name)); - static struct { - int prog; - char *string; - } prog_progtbl[] = { - {100000, "rpcbind"}, - {100024, "statd"}, - {100011, "rquotad"}, - {100003, "nfsd"}, - {100021, "nlockmgr"}, - {100005, "mountd"}, - {100227, "nfs_acl"}, - }; - int i; - int tabsz = (sizeof(prog_progtbl)/sizeof(prog_progtbl[0])); - - for (i = 0; i < tabsz; i++) { - if (prog_progtbl[i].prog == clnt->cl_prog) { - break; - } - } - if (i == tabsz) - snprintf(THIS->__retvalue, MAXSTRINGLEN, "0x%x[%d]:%d", - clnt->cl_prog, clnt->cl_vers, proc->p_proc); - else - snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s[%d]:%d", - prog_progtbl[i].string, clnt->cl_vers, proc->p_proc); - - CATCH_DEREF_FAULT(); -%} -function cl_server:string(_task:long) -%{ - struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); - struct rpc_clnt *clnt = (struct rpc_clnt *)(long) kread(&(task->tk_client)); - char *cl_server = kread(&(clnt->cl_server)); - - snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s", - cl_server ? cl_server : "NULL"); - - CATCH_DEREF_FAULT(); -%} - -function task_status:long(_task:long) -%{ - struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); - - THIS->__retvalue = task->tk_status; - - CATCH_DEREF_FAULT(); -%} - +/* + * stap -g -I../tapset force_rebind.stp + */ probe module("sunrpc").function("call_connect_status") { terror = task_status($task); diff --git a/rpc.stp b/sunrpc/rpc_killall.stp index 03d2bfa..7da2eb6 100644 --- a/rpc.stp +++ b/sunrpc/rpc_killall.stp @@ -11,6 +11,6 @@ probe module("sunrpc").function("rpc_release_calldata") { printf("rpc_release_calldata: ops %p calldata %p\n", $ops, $calldata); } -probe begin { log("starting probe") } -probe end { log("ending probe") } +probe begin { log("starting rpc_killall probe") } +probe end { log("ending rpc_killall probe") } diff --git a/sunrpc/sunrpc-xprtsock.stp b/sunrpc/sunrpc-xprtsock.stp index a6433d6..e070208 100644 --- a/sunrpc/sunrpc-xprtsock.stp +++ b/sunrpc/sunrpc-xprtsock.stp @@ -1,3 +1,6 @@ +/* + * stap -g -I../tapset sunrpc-xprtsock.stp + */ %{ #include <linux/kernel.h> #include <linux/sunrpc/clnt.h> @@ -37,14 +40,6 @@ function rpcb_proc:string(_rpc:long) CATCH_DEREF_FAULT(); %} -function task_status:long(_task:long) -%{ - struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); - - THIS->__retvalue = task->tk_status; - - CATCH_DEREF_FAULT(); -%} probe kernel.function("tcp_sendpage").return { if ($return == -107) /* ENOTCONN */ diff --git a/xprt.stp b/sunrpc/xprt.stp index b6a0c73..b6a0c73 100644 --- a/xprt.stp +++ b/sunrpc/xprt.stp diff --git a/open_namei.stp b/sys/open_namei.stp index 3dda40a..3dda40a 100644 --- a/open_namei.stp +++ b/sys/open_namei.stp diff --git a/sysmount.stp b/sys/sysmount.stp index 24a5190..24a5190 100644 --- a/sysmount.stp +++ b/sys/sysmount.stp diff --git a/syscalltimes b/syscalltimes deleted file mode 100755 index 84ca77a..0000000 --- a/syscalltimes +++ /dev/null @@ -1,248 +0,0 @@ -#!/bin/bash - -# Syscalltimes systemtap script -# Copyright (C) 2007 IBM Corp. -# -# This file is part of systemtap, and is free software. You can -# redistribute it and/or modify it under the terms of the GNU General -# Public License (GPL); either version 2, or (at your option) any -# later version. - -### -### syscalltime - Combination shell/systemtap script to measure system call -### counts and times. Can be filtered by process IDs, process -### names and users. -### - -# Filter options -F_PIDSTR=""; F_PID=0 # Filter by process ID -F_EXECSTR=""; F_EXEC=0 # Filter by process name -F_UIDSTR=""; F_UID=0 # Filter by user -FILTER=0 # Any filters specified? - -# Print options -P_TOTALS=0 # Print totals -P_VERBOSE_STR="" # Print verbose build output - -DELIM="," - -function usage { - echo "USAGE: syscalltimes [-n pname]... [-p pid]... [-u username]..." - echo " [-v]... [-t] [-h]" - echo " -n pname # filter by this process name" - echo " -p pid # filter by this process ID" - echo " -u username # filter by this user" - echo " -t # print totals (default with filters: OFF" - echo " default without filters: ON)" - echo " -v # print verbose output during SystemTap module creation" - echo " -h # print this help text" - echo "" - echo "NOTE: This script can take long time to build. Use -v[vv] to monitor" - echo " the module creation and build process." -} - -# Process options -while getopts n:p:u:vth option; do - case $option in - n) let "F_EXEC++" - F_EXECSTR=$OPTARG$DELIM$F_EXECSTR ;; - - p) let "F_PID++" - F_PIDSTR=$OPTARG$DELIM$F_PIDSTR ;; - - u) uid=`awk -F: '$1 == name {print $3}' name=$OPTARG /etc/passwd` - if [[ $uid != "" ]]; then - let "F_UID++" - F_UIDSTR=$uid$DELIM$F_UIDSTR - else - echo "ERROR: Unknown user:" $OPTARG - let "ERROR++" - fi ;; - - v) P_VERBOSE_STR="-v "$P_VERBOSE_STR ;; - - t) P_TOTALS=1 ;; - - h|?|*) usage - exit 1 ;; - esac -done - -if [[ $ERROR > 0 ]]; then - exit 1 -fi - -if [[ $F_EXEC > 0 || $F_PID > 0 || $F_UID > 0 ]]; then - FILTER=1 -fi - -echo "Creating and building SystemTap module..." - -# -# SystemTap script -# -stap $P_VERBOSE_STR -e ' -global start, timebycall, timebypid, timebyuid, timebyexec -global f_exec_str, f_pid_str, f_uid_str -global f_exec, f_pid, f_uid -global prt_totals, filter_str - -probe begin { - printf("Collecting data - type Ctrl-C to print output and exit...\n") - - # If no filters specified, skip filter processing - if ('$FILTER' == 0) { - filter_str = " (unfiltered)" - prt_totals = 1 // On by default if no filtering - next - } else - filter_str = " (filtered)" - - prt_totals = '$P_TOTALS' - f_exec_str = "'$F_EXECSTR'" - f_pid_str = "'$F_PIDSTR'" - f_uid_str = "'$F_UIDSTR'" - - delim = "'$DELIM'" - - # Process names - if ('$F_EXEC') { - pname = tokenize(f_exec_str, delim) - while (pname != "") { - f_exec[pname] = 1 - pname = tokenize("", delim) - } - } - - # Process IDs - if ('$F_PID') { - pid = tokenize(f_pid_str, delim) - while (pid != "") { - f_pid[strtol(pid, 10)] = 1 - pid = tokenize("", delim) - } - } - - # User IDs - if ('$F_UID') { - uid = tokenize(f_uid_str, delim) - while (uid != "") { - f_uid[strtol(uid, 10)] = 1 - uid = tokenize("", delim) - } - } -} - -probe syscall.* { - start[name, tid()] = gettimeofday_ns() -} - -probe syscall.*.return { - # Skip if we have not seen this before - if (!([name, tid()] in start)) next - - delta = gettimeofday_ns() - start[name, tid()] - - # Check filters - if ('$FILTER') { - target = 0 - if (pid() in f_pid) { - timebypid[name, pid()] <<< delta - target = 1 - } - if (uid() in f_uid) { - timebyuid[name, uid()] <<< delta - target = 1 - } - if (execname() in f_exec) { - timebyexec[name, execname()] <<< delta - target = 1 - } - } else - target = 1 - - # Totals - if (target && prt_totals) - timebycall[name] <<< delta - - delete start[name, tid()] -} - -function print_header() { - printf("%22s %10s %12s %12s %12s %12s\n", - "System Call", "Count", "Total ns", - "Avg ns", "Min ns", "Max ns") -} - -probe end { - if (prt_totals) { - printf("\nTimes for all processes%s:\n\n", filter_str) - print_header() - foreach (call in timebycall) - printf("%22s %10d %12d %12d %12d %12d\n", call, - @count(timebycall[call]), - @sum(timebycall[call]), - @avg(timebycall[call]), - @min(timebycall[call]), - @max(timebycall[call])) - } - - if ('$F_PID') { - curpid = -1 - foreach ([call, pid-] in timebypid) { - if (curpid != pid) { - curpid = pid - printf("\nTimes for process ID %d:\n\n", curpid) - print_header() - } - printf("%22s %10d %12d %12d %12d %12d\n", call, - @count(timebypid[call, pid]), - @sum(timebypid[call, pid]), - @avg(timebypid[call, pid]), - @min(timebypid[call, pid]), - @max(timebypid[call, pid])) - } - printf("\n") - } - - if ('$F_EXEC') { - curexec = "" - foreach ([call, exec-] in timebyexec) { - if (curexec != exec) { - curexec = exec - printf("\nTimes for process name %s:\n\n", curexec) - print_header() - } - printf("%22s %10d %12d %12d %12d %12d\n", call, - @count(timebyexec[call, exec]), - @sum(timebyexec[call, exec]), - @avg(timebyexec[call, exec]), - @min(timebyexec[call, exec]), - @max(timebyexec[call, exec])) - } - printf("\n") - } - - if ('$F_UID') { - curuid = -1 - foreach ([call, uid-] in timebyuid) { - if (curuid != uid) { - curuid = uid - printf("\nTimes for user ID %d:\n\n", curuid) - print_header() - } - printf("%22s %10d %12d %12d %12d %12d\n", call, - @count(timebyuid[call, uid]), - @sum(timebyuid[call, uid]), - @avg(timebyuid[call, uid]), - @min(timebyuid[call, uid]), - @max(timebyuid[call, uid])) - } - printf("\n") - } - - delete timebycall - delete timebypid - delete timebyuid - delete timebyexec -}' diff --git a/tapset/acl.stp b/tapset/acl.stp new file mode 100644 index 0000000..ad9f88d --- /dev/null +++ b/tapset/acl.stp @@ -0,0 +1,27 @@ +%{ +#include <linux/kernel.h> +#include <linux/posix_acl.h> +%} + +function acl_dump:string(_acl:long) +%{ + struct posix_acl *acl = (struct posix_acl *)(long) kread(&(THIS->_acl)); + struct posix_acl_entry *pa; + char buf[MAXSTRINGLEN]; + int cc=0, i; + + sprintf(buf+cc, "acl(%d) ", acl->a_count); + cc = strlen(buf); + pa = acl->a_entries; + + for (i=0; i < acl->a_count; i++) { + + sprintf(buf+cc, "[%d,%d,%d] ", pa->e_tag, pa->e_perm, pa->e_id); + cc = strlen(buf); + + pa++; + } + snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s", buf); + + CATCH_DEREF_FAULT(); +%} diff --git a/tapset/cachiodata.stp b/tapset/cachiodata.stp index 441e9fa..4b7ac1a 100644 --- a/tapset/cachiodata.stp +++ b/tapset/cachiodata.stp @@ -2,7 +2,7 @@ function svc_export_data:string(msg:string) %{ char *tmp, *ptr, *str; - char buf[1024], cc; + char buf[512], cc; str = ptr = THIS->msg; tmp = buf; @@ -71,7 +71,7 @@ function svc_export_data:string(msg:string) function ip_map_data:string(msg:string) %{ char *tmp, *ptr, *str; - char buf[1024], cc; + char buf[512], cc; str = ptr = THIS->msg; tmp = buf; @@ -99,7 +99,7 @@ function ip_map_data:string(msg:string) function expkey_data:string(msg:string) %{ char *tmp, *ptr, *str; - char buf[1024], cc; + char buf[512], cc; str = ptr = THIS->msg; tmp = buf; @@ -134,7 +134,7 @@ function expkey_data:string(msg:string) function idtoname_data:string(msg:string) %{ char *tmp, *ptr, *str; - char buf[1024], cc; + char buf[512], cc; str = ptr = THIS->msg; tmp = buf; diff --git a/tapset/fs.stp b/tapset/fs.stp index 85956e9..f8122bf 100644 --- a/tapset/fs.stp +++ b/tapset/fs.stp @@ -31,3 +31,11 @@ function file2name:string(filep:long) CATCH_DEREF_FAULT(); %} +function dentry2name:string(dentry_:long) +%{ + struct dentry *dentry = (struct dentry *)(long) kread(&(THIS->dentry_)); + + strlcpy(THIS->__retvalue, dentry->d_name.name, MAXSTRINGLEN); + + CATCH_DEREF_FAULT(); +%} diff --git a/tapset/fs_type.stp b/tapset/fs_type.stp new file mode 100644 index 0000000..a71bfd7 --- /dev/null +++ b/tapset/fs_type.stp @@ -0,0 +1,16 @@ +%{ +#include <linux/fs.h> +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) +#include <linux/path.h> +#endif +%} + +function fs_name:string(_fs:long) +%{ + struct file_system_type *fs = + (struct file_system_type *)(long) kread(&(THIS->_fs)); + + snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s", fs->name); + + CATCH_DEREF_FAULT(); +%} diff --git a/tapset/inode.stp b/tapset/inode.stp new file mode 100644 index 0000000..106cba1 --- /dev/null +++ b/tapset/inode.stp @@ -0,0 +1,13 @@ +%{ +#include <linux/kernel.h> +%} + +function inode_uid:string(_ino:long) +%{ + struct inode *inode = (struct inode *)(long) kread(&(THIS->_ino)); + + snprintf(THIS->__retvalue, MAXSTRINGLEN, "uid=%d gid=%d", + inode->i_uid, inode->i_gid); + + CATCH_DEREF_FAULT(); +%} diff --git a/tapset/nfs4_callback.stp b/tapset/nfs4_callback.stp index 351f0f2..01070e1 100644 --- a/tapset/nfs4_callback.stp +++ b/tapset/nfs4_callback.stp @@ -2,12 +2,15 @@ #include <linux/socket.h> #include <net/sock.h> #include <net/inet_sock.h> +#include <linux/skbuff.h> #include <linux/sunrpc/svc.h> #include <linux/nfs4.h> #include <linux/nfsd/nfsfh.h> #include <linux/nfsd/state.h> +#include <linux/nfsd/nfsd.h> +#include <linux/nfsd/xdr4.h> %} function nfs4_callback:string(_stp:long) @@ -18,14 +21,18 @@ function nfs4_callback:string(_stp:long) (long) kread(&stp->st_stateowner); struct nfs4_client *so_client = (struct nfs4_client *) (long)kread(&sop->so_client); + /* struct nfs4_callback *cb = (struct nfs4_callback *) &so_client->cl_callback; + */ + struct nfs4_cb_conn *cb = (struct nfs4_cb_conn *) + &so_client->cl_cb_conn; char buf[MAXSTRINGLEN]; int cc=0; - snprintf(buf+cc, MAXSTRINGLEN, "cb: cb_set %d so_confirmed %d", - cb->cb_set.counter, sop->so_confirmed); + snprintf(buf+cc, MAXSTRINGLEN, "cb: cb_set %d sop %p so_confirmed %d", + cb->cb_set.counter, sop, sop->so_confirmed); cc = strlen(buf); snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s", buf); @@ -33,3 +40,30 @@ function nfs4_callback:string(_stp:long) CATCH_DEREF_FAULT(); %} +function nfs4_callback_addr:string(_clp:long) +%{ + struct nfs4_client *clp = (struct nfs4_client *) + (long)kread(&(THIS->_clp)); + + char buf[MAXSTRINGLEN]; + int cc=0; + + snprintf(THIS->__retvalue, MAXSTRINGLEN, + NIPQUAD_FMT, NIPQUAD(clp->cl_addr)); + + CATCH_DEREF_FAULT(); + +%} +function nfs4_openconf:string(_oc:long) +%{ + struct nfsd4_open_confirm *oc = (struct nfsd4_open_confirm *) + (long)kread(&(THIS->_oc)); + struct nfs4_stateowner *sop = (struct nfs4_stateowner *) + (long) kread(&oc->oc_stateowner); + + snprintf(THIS->__retvalue, MAXSTRINGLEN, + "sop %p so_confirmed %d", sop, sop->so_confirmed); + + CATCH_DEREF_FAULT(); + +%} diff --git a/tapset/nfs_mnt_rq.stp b/tapset/nfs_mnt_rq.stp new file mode 100644 index 0000000..4f638a8 --- /dev/null +++ b/tapset/nfs_mnt_rq.stp @@ -0,0 +1,30 @@ +%{ +#include <linux/socket.h> +#include <net/sock.h> +#include <net/inet_sock.h> +#include <linux/nfs.h> + +struct nfs_mount_request { + struct sockaddr *sap; + size_t salen; + char *hostname; + char *dirpath; + u32 version; + unsigned short protocol; + struct nfs_fh *fh; + int noresvport; +}; + +%} +function mnt_req:string(_req:long) +%{ + struct nfs_mount_request *req = + (struct nfs_mount_request *)(long) kread(&(THIS->_req)); + + snprintf(THIS->__retvalue, MAXSTRINGLEN, + "server: %s export: %s vers: %d proto: %d", + req->hostname, req->dirpath, req->version, req->protocol); + + CATCH_DEREF_FAULT(); +%} + diff --git a/tapset/nfsmntflags.stp b/tapset/nfsmntflags.stp index 98f4bb5..62519c1 100644 --- a/tapset/nfsmntflags.stp +++ b/tapset/nfsmntflags.stp @@ -24,7 +24,6 @@ function nfs_mntflags:string(rawdata) { NFS_MOUNT_NOACL, ",noacl", "" }, { NFS_MOUNT_NORDIRPLUS, ",nordirplus", "" }, { NFS_MOUNT_UNSHARED, ",nosharecache", "" }, - { NFS_MOUNT_FSCACHE, ",fsc", "" }, { 0, "", "" } }; struct nfs_mount_data *data = (struct nfs_mount_data *)(long) THIS->rawdata; diff --git a/tapset/sunrpc_task.stp b/tapset/sunrpc_task.stp new file mode 100644 index 0000000..47cc178 --- /dev/null +++ b/tapset/sunrpc_task.stp @@ -0,0 +1,63 @@ +%{ +#include <linux/sunrpc/svc.h> +#include <linux/sunrpc/sched.h> +#include <linux/sunrpc/clnt.h> +%} + +function cl_prog:string(_task:long) +%{ + struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); + struct rpc_clnt *clnt = (struct rpc_clnt *)(long) kread(&(task->tk_client)); + struct rpc_procinfo *proc = + (struct rpc_procinfo *)(long) kread(&(clnt->cl_procinfo)); + char *p_name = kread(&(proc->p_name)); + static struct { + int prog; + char *string; + } prog_progtbl[] = { + {100000, "rpcbind"}, + {100024, "statd"}, + {100011, "rquotad"}, + {100003, "nfsd"}, + {100021, "nlockmgr"}, + {100005, "mountd"}, + {100227, "nfs_acl"}, + }; + int i; + int tabsz = (sizeof(prog_progtbl)/sizeof(prog_progtbl[0])); + + for (i = 0; i < tabsz; i++) { + if (prog_progtbl[i].prog == clnt->cl_prog) { + break; + } + } + if (i == tabsz) + snprintf(THIS->__retvalue, MAXSTRINGLEN, "0x%x[%d]:%d", + clnt->cl_prog, clnt->cl_vers, proc->p_proc); + else + snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s[%d]:%d", + prog_progtbl[i].string, clnt->cl_vers, proc->p_proc); + + CATCH_DEREF_FAULT(); +%} +function cl_server:string(_task:long) +%{ + struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); + struct rpc_clnt *clnt = (struct rpc_clnt *)(long) kread(&(task->tk_client)); + char *cl_server = kread(&(clnt->cl_server)); + + snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s", + cl_server ? cl_server : "NULL"); + + CATCH_DEREF_FAULT(); +%} + +function task_status:long(_task:long) +%{ + struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); + + THIS->__retvalue = task->tk_status; + + CATCH_DEREF_FAULT(); +%} + diff --git a/tapset/task.stp b/tapset/task.stp index d409a96..6b121be 100644 --- a/tapset/task.stp +++ b/tapset/task.stp @@ -1,6 +1,7 @@ %{ #include <linux/kernel.h> #include <linux/sunrpc/clnt.h> +#include <linux/sunrpc/sched.h> #include <linux/sunrpc/svc.h> %} @@ -21,3 +22,104 @@ function task_dump:string(_task:long) CATCH_DEREF_FAULT(); %} +function task_status:long(_task:long) +%{ + struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); + + THIS->__retvalue = task->tk_status; + + CATCH_DEREF_FAULT(); +%} + +function cl_prognum:long(_task:long) +%{ + struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); + struct rpc_clnt *clnt = (struct rpc_clnt *)(long) kread(&(task->tk_client)); + + THIS->__retvalue = clnt->cl_prog; + + CATCH_DEREF_FAULT(); +%} + +function cl_vers:long(_task:long) +%{ + struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); + struct rpc_clnt *clnt = (struct rpc_clnt *)(long) kread(&(task->tk_client)); + + THIS->__retvalue = clnt->cl_vers; + + CATCH_DEREF_FAULT(); +%} + +function cl_prog:string(_task:long) +%{ + struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); + struct rpc_clnt *clnt = (struct rpc_clnt *)(long) kread(&(task->tk_client)); + struct rpc_procinfo *proc = + (struct rpc_procinfo *)(long) kread(&(clnt->cl_procinfo)); + char *p_name = kread(&(proc->p_name)); + static struct { + int prog; + char *string; + } prog_progtbl[] = { + {100000, "rpcbind"}, + {100024, "statd"}, + {100011, "rquotad"}, + {100003, "nfs"}, + {100021, "nlockmgr"}, + {100005, "mountd"}, + {100227, "nfs_acl"}, + }; + int i; + int tabsz = (sizeof(prog_progtbl)/sizeof(prog_progtbl[0])); + + for (i = 0; i < tabsz; i++) { + if (prog_progtbl[i].prog == clnt->cl_prog) { + break; + } + } + if (i == tabsz) + snprintf(THIS->__retvalue, MAXSTRINGLEN, "0x%x[%d]:%d", + clnt->cl_prog, clnt->cl_vers, proc->p_proc); + else + snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s[%d]:%d", + prog_progtbl[i].string, clnt->cl_vers, proc->p_proc); + + CATCH_DEREF_FAULT(); +%} +function cl_server:string(_task:long) +%{ + struct rpc_task *task = (struct rpc_task *)(long) kread(&(THIS->_task)); + struct rpc_clnt *clnt = (struct rpc_clnt *)(long) kread(&(task->tk_client)); + char *cl_server = kread(&(clnt->cl_server)); + + snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s", + cl_server ? cl_server : "NULL"); + + CATCH_DEREF_FAULT(); +%} +/* +function rpcprocnum:long(_msg:long) +%{ + struct rpc_message *msg = (struct rpc_message *)(long) kread(&(THIS->_msg)); + struct rpc_procinfo *rpc_proc = + (struct rpc_procinfo *)(long) kread(&(msg->rpc_proc)); + + THIS->__retvalue = rpc_proc->p_proc; + + CATCH_DEREF_FAULT(); +%} +function rpcprocname:string(_msg:long) +%{ + struct rpc_message *msg = (struct rpc_message *)(long) kread(&(THIS->_msg)); + struct rpc_procinfo *rpc_proc = + (struct rpc_procinfo *)(long) kread(&(msg->rpc_proc)); + char *p_name = kread(&(rpc_proc->p_name)); + char buf[MAXSTRINGLEN]; + + snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s(%d)", + p_name ? p_name : "NULL" , rpc_proc->p_proc); + + CATCH_DEREF_FAULT(); +%} +*/ diff --git a/top-nfscalls.stp b/top-nfscalls.stp index 62fe9d0..90586e0 100755 --- a/top-nfscalls.stp +++ b/top-nfscalls.stp @@ -3,11 +3,11 @@ global nfscalls probe begin { - printf("Collecting data...\n") + printf("Collecting top NFS procs...\n") } -probe kernel.function("*@fs/nfs") ?, - module("nfs").function("*@fs/nfs/*") ? +probe kernel.function("*@fs/nfs/*proc.c") ?, + module("nfs").function("*@fs/nfs/*proc.c") ? { nfscalls[probefunc()]++ } diff --git a/top-nfsclient.stp b/top-nfsclient.stp new file mode 100644 index 0000000..7d187c8 --- /dev/null +++ b/top-nfsclient.stp @@ -0,0 +1,145 @@ +#!/usr/bin/env stap + +global entry, timings + +probe begin { + printf("Collecting data... Hit <Ctrl-C> to stop..\n") +} + +function collect_entry() { entry[probefunc(),pid()] = gettimeofday_us() } +function collect_exit() { timings[probefunc()] <<< (gettimeofday_us() - entry[probefunc(),pid()]) } + +probe module("nfs").function("*@fs/nfs/*proc.c") { collect_entry(); } +probe module("nfs").function("*@fs/nfs/*proc.c").return { collect_exit(); } +/* +# Filename: nfs_v3_clientops_functions Line: 1 +probe module("nfs").function("nfs3_proc_get_root") { collect_entry(); } +probe module("nfs").function("nfs3_proc_get_root").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 2 +probe module("nfs").function("nfs3_proc_getattr") { collect_entry(); } +probe module("nfs").function("nfs3_proc_getattr").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 3 +probe module("nfs").function("nfs3_proc_setattr") { collect_entry(); } +probe module("nfs").function("nfs3_proc_setattr").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 4 +probe module("nfs").function("nfs3_proc_lookup") { collect_entry(); } +probe module("nfs").function("nfs3_proc_lookup").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 5 +probe module("nfs").function("nfs3_proc_access") { collect_entry(); } +probe module("nfs").function("nfs3_proc_access").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 6 +probe module("nfs").function("nfs3_proc_readlink") { collect_entry(); } +probe module("nfs").function("nfs3_proc_readlink").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 10 +probe module("nfs").function("nfs3_proc_create") { collect_entry(); } +probe module("nfs").function("nfs3_proc_create").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 11 +probe module("nfs").function("nfs3_proc_remove") { collect_entry(); } +probe module("nfs").function("nfs3_proc_remove").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 12 +probe module("nfs").function("nfs3_proc_unlink_setup") { collect_entry(); } +probe module("nfs").function("nfs3_proc_unlink_setup").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 13 +probe module("nfs").function("nfs3_proc_unlink_done") { collect_entry(); } +probe module("nfs").function("nfs3_proc_unlink_done").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 14 +probe module("nfs").function("nfs3_proc_rename") { collect_entry(); } +probe module("nfs").function("nfs3_proc_rename").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 15 +probe module("nfs").function("nfs3_proc_link") { collect_entry(); } +probe module("nfs").function("nfs3_proc_link").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 16 +probe module("nfs").function("nfs3_proc_symlink") { collect_entry(); } +probe module("nfs").function("nfs3_proc_symlink").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 17 +probe module("nfs").function("nfs3_proc_mkdir") { collect_entry(); } +probe module("nfs").function("nfs3_proc_mkdir").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 18 +probe module("nfs").function("nfs3_proc_rmdir") { collect_entry(); } +probe module("nfs").function("nfs3_proc_rmdir").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 19 +probe module("nfs").function("nfs3_proc_readdir") { collect_entry(); } +probe module("nfs").function("nfs3_proc_readdir").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 20 +probe module("nfs").function("nfs3_proc_mknod") { collect_entry(); } +probe module("nfs").function("nfs3_proc_mknod").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 21 +probe module("nfs").function("nfs3_proc_statfs") { collect_entry(); } +probe module("nfs").function("nfs3_proc_statfs").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 22 +probe module("nfs").function("nfs3_proc_fsinfo") { collect_entry(); } +probe module("nfs").function("nfs3_proc_fsinfo").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 23 +probe module("nfs").function("nfs3_proc_pathconf") { collect_entry(); } +probe module("nfs").function("nfs3_proc_pathconf").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 24 +probe module("nfs").function("nfs3_decode_dirent") { collect_entry(); } +probe module("nfs").function("nfs3_decode_dirent").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 25 +probe module("nfs").function("nfs3_proc_read_setup") { collect_entry(); } +probe module("nfs").function("nfs3_proc_read_setup").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 26 +probe module("nfs").function("nfs3_read_done") { collect_entry(); } +probe module("nfs").function("nfs3_read_done").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 27 +probe module("nfs").function("nfs3_proc_write_setup") { collect_entry(); } +probe module("nfs").function("nfs3_proc_write_setup").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 28 +probe module("nfs").function("nfs3_write_done") { collect_entry(); } +probe module("nfs").function("nfs3_write_done").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 29 +probe module("nfs").function("nfs3_proc_commit_setup") { collect_entry(); } +probe module("nfs").function("nfs3_proc_commit_setup").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 30 +probe module("nfs").function("nfs3_commit_done") { collect_entry(); } +probe module("nfs").function("nfs3_commit_done").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 31 +probe module("nfs").function("nfs_open") { collect_entry(); } +probe module("nfs").function("nfs_open").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 32 +probe module("nfs").function("nfs_release") { collect_entry(); } +probe module("nfs").function("nfs_release").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 33 +probe module("nfs").function("nfs3_proc_lock") { collect_entry(); } +probe module("nfs").function("nfs3_proc_lock").return { collect_exit(); } + +# Filename: nfs_v3_clientops_functions Line: 34 +probe module("nfs").function("nfs3_forget_cached_acls") { collect_entry(); } +probe module("nfs").function("nfs3_forget_cached_acls").return { collect_exit(); } +*/ +probe end { + printf("function count min_us avg_us max_us\n") + foreach (i+ in timings) { + printf("%-25s %7d %8d %8d %8d\n", i, @count(timings[i]), + @min(timings[i]), @avg(timings[i]), @max(timings[i])) + } +} diff --git a/top-nfsdcalls.stp b/top-nfsdcalls.stp index 7bfdf03..8b5dbdb 100755 --- a/top-nfsdcalls.stp +++ b/top-nfsdcalls.stp @@ -3,11 +3,11 @@ global nfsdcalls probe begin { - printf("Collecting data...\n") + printf("Collecting top NFSD procs...\n") } -probe kernel.function("*@fs/nfsd") ?, - module("nfsd").function("*@fs/nfsd/*") ? +probe kernel.function("*@fs/nfsd/*proc.c") ?, + module("nfsd").function("*@fs/nfsd/*proc.c*") ? { nfsdcalls[probefunc()]++ } diff --git a/tracemarks/sched.stp b/tracemarks/sched.stp new file mode 100644 index 0000000..0b3ffa2 --- /dev/null +++ b/tracemarks/sched.stp @@ -0,0 +1,3 @@ +probe kernel.mark("kernel_sched_schedule") { + printf("kernel_sched_schedule: pid %d\n", $arg1) +} diff --git a/tracepoints/rpc_call_status.stp b/tracepoints/rpc_call_status.stp new file mode 100644 index 0000000..37ac5e2 --- /dev/null +++ b/tracepoints/rpc_call_status.stp @@ -0,0 +1,38 @@ +/* + * stap -g -I ../tapset rpc_call_status.stp + */ +%{ +#include <linux/sunrpc/svc.h> +#include <linux/sunrpc/sched.h> +#include <linux/sunrpc/clnt.h> +%} + +probe kernel.trace("rpc_bind_status") +{ + terror = task_status($task); + if (terror) + printf("%s[%d]:rpc_bind_status:%s:%s: error %d (%s)\n", + execname(), pid(), cl_server($task), cl_prog($task), + terror, errno_str(terror)); +} +probe kernel.trace("rpc_connect_status") +{ + terror = task_status($task); + if (terror) + printf("%s[%d]:call_connect_status:%s:%s: error %d (%s)\n", + execname(), pid(), cl_server($task), cl_prog($task), + terror, errno_str(terror)); +} +probe kernel.trace("rpc_call_status") +{ + terror = task_status($task); + /* ingore EAGAIN and ETIMEDOUT */ + if (terror) { + printf("%s[%d]:call_status:%s:%s: error %d (%s)\n", + execname(), pid(), cl_server($task), cl_prog($task), + terror, errno_str(terror)); + } +} + +probe begin { log("starting rpc call status probe") } +probe end { log("ending rpc call status probe") } |
