summaryrefslogtreecommitdiffstats
path: root/lockd
diff options
context:
space:
mode:
authorSteve Dickson <steved@redhat.com>2009-03-13 18:14:08 -0400
committerSteve Dickson <steved@redhat.com>2009-03-13 18:14:08 -0400
commite255f4bfb61351b318da1b3fdadb45928fd334a2 (patch)
tree088ef6117186abbd91717e8a914296105f2439d6 /lockd
parentc63a15c69ebe891e6db6253ad16fda552bc842c9 (diff)
downloadsystemtap-e255f4bfb61351b318da1b3fdadb45928fd334a2.tar.gz
systemtap-e255f4bfb61351b318da1b3fdadb45928fd334a2.tar.xz
systemtap-e255f4bfb61351b318da1b3fdadb45928fd334a2.zip
Added the better rpc_call_sync proces to lockd_clnt.stp
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'lockd')
-rw-r--r--lockd/lockd_clnt.stp52
1 files changed, 44 insertions, 8 deletions
diff --git a/lockd/lockd_clnt.stp b/lockd/lockd_clnt.stp
index 09c4cf4..1dd3dae 100644
--- a/lockd/lockd_clnt.stp
+++ b/lockd/lockd_clnt.stp
@@ -1,6 +1,7 @@
%{
#include <linux/sunrpc/svc.h>
#include <linux/sunrpc/sched.h>
+#include <linux/sunrpc/clnt.h>
#include <linux/lockd/lockd.h>
#include <linux/lockd/nlm.h>
#include <linux/lockd/xdr.h>
@@ -54,7 +55,29 @@ 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));
+ 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();
+%}
function nlmproc:string(proc:long)
%{
char *procstr;
@@ -169,7 +192,8 @@ function nlm_res_error:string(_req:long)
CATCH_DEREF_FAULT();
%}
-global nlm_req;
+global nlm_req, msg, flags
+
probe module("lockd").function("nlmclnt_call")
{
printf("%s(%d): nlmclnt_call: proc %s \n",
@@ -199,13 +223,6 @@ probe module("lockd").function("nlmclnt_async_call").return
execname(), pid(), $return, errno_str($return));
}
}
-probe module("sunrpc").function("rpc_call_sync").return
-{
- if ($return) {
- printf("%s(%d): rpc_call_sync: %d (%s)\n",
- execname(), pid(), $return, errno_str($return));
- }
-}
probe module("lockd").function("nsm_mon_unmon")
{
printf("%s(%d): nsm_mon_unmon: %s\n", execname(), pid(),
@@ -232,6 +249,25 @@ probe module("lockd").function("nlmclnt_unlock_callback")
execname(), pid(), task_error($task));
}
}
+probe module("sunrpc").function("rpc_call_sync")
+{
+ /*
+ printf("%s(%d): rpc_call_sync: %s: flags 0x%x\n",
+ execname(), pid(), rpcprocname($msg), $flags);
+ */
+ msg = $msg;
+ flags = $flags
+}
+probe module("sunrpc").function("rpc_call_sync").return
+{
+ if ($return) {
+ if (rpcprocnum(msg) != 2 && $return != -2) {
+ printf("%s(%d): rpc_call_sync: %s: return %d (%s)\n",
+ execname(), pid(), rpcprocname(msg), $return,
+ errno_str($return));
+ }
+ }
+}
/*
probe module("lockd").function("nsm_monitor")
{