diff options
-rw-r--r-- | sunrpc/sunrpc.stp | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/sunrpc/sunrpc.stp b/sunrpc/sunrpc.stp index 73c40cd..689577c 100644 --- a/sunrpc/sunrpc.stp +++ b/sunrpc/sunrpc.stp @@ -40,14 +40,15 @@ function rpcprogname:string(_clnt:long) %} global syn_clnt, syn_msg, syn_flags global asyn_clnt, asyn_msg, asyn_flags +global show_all probe module("sunrpc").function("rpc_call_sync") { - /* - printf("%s(%d): rpc_call_sync: %s: %s: flags 0x%x\n", - execname(), pid(), rpcprocname($msg), - rpcprogname($clnt), $flags); - */ + if (show_all) { + printf("%s(%d): rpc_call_sync:%s:%s: flags 0x%x\n", + execname(), pid(), rpcprocname($msg), + rpcprogname($clnt), $flags); + } syn_clnt = $clnt; syn_msg = $msg; syn_flags = $flags; @@ -64,11 +65,11 @@ probe module("sunrpc").function("rpc_call_sync").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); - */ + if (show_all) { + 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; @@ -83,6 +84,17 @@ probe module("sunrpc").function("rpc_call_async").return } } } -probe begin { log("starting sunrpc probe") } +probe begin +{ + show_all = 0; + if (argc > 0) { + if (isinstr(argv[1], "--show_all")) { + show_all = 1 + } else { + error("Usage: sunrpc -- --show_all"); + } + } + log("starting sunrpc probe") +} probe end { log("ending sunrpc probe") } |