diff options
author | Steve Dickson <steved@redhat.com> | 2009-06-13 06:21:26 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2009-06-13 06:21:26 -0400 |
commit | 82467982439f83074e8810bd13ce5a2a83f1e7bc (patch) | |
tree | 5de8e4526afa0f5b87e86998f40e1d2e253b2475 /tapset | |
parent | e1c9b2542a4a7e72c7f3a876db09986d43f8c252 (diff) | |
download | systemtap-82467982439f83074e8810bd13ce5a2a83f1e7bc.tar.gz systemtap-82467982439f83074e8810bd13ce5a2a83f1e7bc.tar.xz systemtap-82467982439f83074e8810bd13ce5a2a83f1e7bc.zip |
Moved task_staus into tapset/task.stp
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'tapset')
-rw-r--r-- | tapset/task.stp | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/tapset/task.stp b/tapset/task.stp index d409a96..76e7c71 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,84 @@ 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_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 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(); +%} +*/ |