diff options
| author | Steve Dickson <steved@redhat.com> | 2009-04-02 13:19:32 -0400 |
|---|---|---|
| committer | Steve Dickson <steved@redhat.com> | 2009-04-02 13:19:32 -0400 |
| commit | 235cb51e8781d9ec0ec3c45ffdf5bc7bf77c5fd2 (patch) | |
| tree | 772c8fbc5c80e831e1633e7980fbb6fdb08c9bcd | |
| parent | 2350cdc2065d991fd8722de4ae91f62914c75556 (diff) | |
| download | systemtap-235cb51e8781d9ec0ec3c45ffdf5bc7bf77c5fd2.tar.gz systemtap-235cb51e8781d9ec0ec3c45ffdf5bc7bf77c5fd2.tar.xz systemtap-235cb51e8781d9ec0ec3c45ffdf5bc7bf77c5fd2.zip | |
Updates to be a bit less verbose
Signed-off-by: Steve Dickson <steved@redhat.com>
| -rw-r--r-- | lockd/lockd_clnt.stp | 35 | ||||
| -rw-r--r-- | sunrpc/force_rebind.stp | 76 | ||||
| -rw-r--r-- | sunrpc/sunrpc-svc.stp | 14 |
3 files changed, 107 insertions, 18 deletions
diff --git a/lockd/lockd_clnt.stp b/lockd/lockd_clnt.stp index 0d74c76..0769650 100644 --- a/lockd/lockd_clnt.stp +++ b/lockd/lockd_clnt.stp @@ -55,6 +55,7 @@ function task_status:long(_task:long) CATCH_DEREF_FAULT(); %} +/* function rpcprocnum:long(_msg:long) %{ struct rpc_message *msg = (struct rpc_message *)(long) kread(&(THIS->_msg)); @@ -78,6 +79,7 @@ function rpcprocname:string(_msg:long) CATCH_DEREF_FAULT(); %} +*/ function nlmproc:string(proc:long) %{ char *procstr; @@ -140,21 +142,15 @@ function nmsproc:string(proc:long) snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s", procstr); %} -/* -function nlm_host:string(_req:long) +function nlm_host:string(_host:long) %{ - char buf[MAXSTRINGLEN]; - - struct nlm_rqst *req = (struct nlm_rqst *)(long) kread(&(THIS->_req)); - struct nlm_host *host = (struct nlm_host *)(long) kread(&req); + struct nlm_host *host = (struct nlm_host *)(long) kread(&(THIS->_host)); char *h_name = kread(&(host->h_name)); - snprintf(THIS->__retvalue, MAXSTRINGLEN, "a_host %p %s", - host, h_name); + snprintf(THIS->__retvalue, MAXSTRINGLEN, "host %s", h_name); CATCH_DEREF_FAULT(); %} -*/ function nlm_res_status:long(_req:long) %{ struct nlm_rqst *req = (struct nlm_rqst *)(long) kread(&(THIS->_req)); @@ -192,7 +188,8 @@ function nlm_res_error:string(_req:long) CATCH_DEREF_FAULT(); %} -global nlm_req, msg, flags +global nlm_req, nms_proc +/* global msg, flags */ probe module("lockd").function("nlmclnt_call") { @@ -225,14 +222,18 @@ probe module("lockd").function("nlmclnt_async_call").return } probe module("lockd").function("nsm_mon_unmon") { + nms_proc = $proc; + /* printf("%s(%d): nsm_mon_unmon: %s\n", execname(), pid(), nmsproc($proc)); + */ } probe module("lockd").function("nsm_monitor").return { if ($return) { - printf("%s(%d): nsm_monitor: %d (%s)\n", - execname(), pid(), $return, errno_str($return)); + printf("%s(%d): nsm_monitor: %s: error %d (%s)\n", + execname(), pid(), nmsproc(nms_proc), + $return, errno_str($return)); } } probe module("lockd").function("nsm_mon_unmon").return @@ -249,6 +250,16 @@ probe module("lockd").function("nlmclnt_unlock_callback") execname(), pid(), task_error($task)); } } +probe module("lockd").function("nlm_rebind_host") +{ + printf("%s(%d): nlm_rebind_host: %s \n", + execname(), pid(), nlm_host($host)); +} +probe module("lockd").function("nlm_bind_host") +{ + printf("%s(%d): nlm_bind_host: %s \n", + execname(), pid(), nlm_host($host)); +} /* probe module("sunrpc").function("rpc_call_sync") { diff --git a/sunrpc/force_rebind.stp b/sunrpc/force_rebind.stp index 30eda72..42f44ec 100644 --- a/sunrpc/force_rebind.stp +++ b/sunrpc/force_rebind.stp @@ -1,3 +1,79 @@ +%{ +#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)); + 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]:%s", + clnt->cl_prog, clnt->cl_vers, proc->p_name); + else + snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s[%d]:%s", + prog_progtbl[i].string, clnt->cl_vers, proc->p_name); + + 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(); +%} + +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_status") +{ + terror = task_status($task); + if (terror) + printf("call_status:%s:%s: error %d (%s)\n", + cl_server($task), cl_prog($task), terror, errno_str(terror)); +} probe module("sunrpc").function("rpc_force_rebind") { printf("rpc_force_rebind: clnt %p\n", $clnt); diff --git a/sunrpc/sunrpc-svc.stp b/sunrpc/sunrpc-svc.stp index 0fb2a06..b566ae1 100644 --- a/sunrpc/sunrpc-svc.stp +++ b/sunrpc/sunrpc-svc.stp @@ -70,14 +70,16 @@ probe module("sunrpc").function("svc_process") probe module("sunrpc").function("svc_process").return { if ($return == 0) { - printf("%s(%d): svc_process: return %d (%s)\n", - execname(), pid(), $return, errno_str($return)); - } else if ($return != 0) { + printf("%s(%d): %s[%d]:%d: return %d (%s)\n", + execname(), pid(), svcprog(rq_prog), rq_vers, rq_proc, + $return, errno_str($return)); + } else if (show_all && $return != 0) { if (rq_vers == 4) { - printf("%s(%d): svc_process:%s(%d): bytes %d\n", - execname(), pid(), svcprog(rq_prog), rq_vers, $return); + printf("%s(%d): %s[%d]:%d: bytes %d\n", + execname(), pid(), svcprog(rq_prog), rq_vers, + rq_proc, $return); } else { - printf("%s(%d): svc_process:%s(%d):%d: bytes %d\n", + printf("%s(%d): %s[%d]:%d: bytes %d\n", execname(), pid(), svcprog(rq_prog), rq_vers, rq_proc, $return); } |
