diff options
author | Steve Dickson <steved@redhat.com> | 2009-03-17 10:23:56 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2009-03-17 10:23:56 -0400 |
commit | 95f632ea0879c8841e93f3d4a15046af092cf2b4 (patch) | |
tree | 1b6779e328971aca92006909493aca6421a2b485 /sunrpc | |
parent | e255f4bfb61351b318da1b3fdadb45928fd334a2 (diff) | |
download | systemtap-95f632ea0879c8841e93f3d4a15046af092cf2b4.tar.gz systemtap-95f632ea0879c8841e93f3d4a15046af092cf2b4.tar.xz systemtap-95f632ea0879c8841e93f3d4a15046af092cf2b4.zip |
Added the rpcprogname function and the rpc_call_async probe
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'sunrpc')
-rw-r--r-- | sunrpc/sunrpc.stp | 55 |
1 files changed, 46 insertions, 9 deletions
diff --git a/sunrpc/sunrpc.stp b/sunrpc/sunrpc.stp index 15c9dcd..73c40cd 100644 --- a/sunrpc/sunrpc.stp +++ b/sunrpc/sunrpc.stp @@ -25,24 +25,61 @@ function rpcprocname:string(_msg:long) CATCH_DEREF_FAULT(); %} -global msg, flags +function rpcprogname:string(_clnt:long) +%{ + struct rpc_clnt *clnt = (struct rpc_clnt *)(long) kread(&(THIS->_clnt)); + char *cl_server = kread(&(clnt->cl_server)); + char *cl_protname = kread(&(clnt->cl_protname)); + char buf[MAXSTRINGLEN]; + + snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s:%s", + cl_server ? cl_server : "NULL" , + cl_protname ? cl_protname : "NULL" ); + + CATCH_DEREF_FAULT(); +%} +global syn_clnt, syn_msg, syn_flags +global asyn_clnt, asyn_msg, asyn_flags probe module("sunrpc").function("rpc_call_sync") { /* - printf("%s(%d): rpc_call_sync: %s: flags 0x%x\n", - execname(), pid(), rpcprocname($msg), $flags); + printf("%s(%d): rpc_call_sync: %s: %s: flags 0x%x\n", + execname(), pid(), rpcprocname($msg), + rpcprogname($clnt), $flags); */ - msg = $msg; - flags = $flags + syn_clnt = $clnt; + syn_msg = $msg; + syn_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)); + if (rpcprocnum(syn_msg) != 2 && $return != -2) { + printf("%s(%d): rpc_call_sync:%s:%s: return %d (%s)\n", + execname(), pid(), rpcprocname(syn_msg), rpcprogname(syn_clnt), + $return, errno_str($return)); + } + } +} +probe module("sunrpc").function("rpc_call_async") +{ + /* + printf("%s(%d): rpc_call_sync:%s:%s:flags 0x%x\n", + execname(), pid(), rpcprocname($msg), + rpcprogname($clnt), $flags); + */ + asyn_clnt = $clnt; + asyn_msg = $msg; + asyn_flags = $flags; +} +probe module("sunrpc").function("rpc_call_async").return +{ + if ($return) { + if (rpcprocnum(asyn_msg) != 2 && $return != -2) { + printf("%s(%d): rpc_call_sync:%s:%s: return %d (%s)\n", + execname(), pid(), rpcprocname(syn_msg), rpcprogname(syn_clnt), + $return, errno_str($return)); } } } |