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 | |
| 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>
| -rw-r--r-- | lockd/lockd_clnt.stp | 16 | ||||
| -rw-r--r-- | sunrpc/force_rebind.stp | 66 | ||||
| -rw-r--r-- | sunrpc/sunrpc-xprtsock.stp | 11 | ||||
| -rw-r--r-- | tapset/task.stp | 82 |
4 files changed, 94 insertions, 81 deletions
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/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/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/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(); +%} +*/ |
