This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Patch]Add function for probe point sunrpc.clnt.create_client


Hi, all

I found that probe point sunrpc.clnt.create_client does not work properly on RHEL5.
The reason is that when a rpc client is created, the kernel function be called is not
rpc_create_client, but rpc_new_client.


On RHEL5, rpc_create_client and rpc_new_client both exists. And in the latest
kernel, rpc_create_client does not exist any more. So it's necessary to add rpc_new_client
to the tapset.


The patch is as below:

diff -Nur systemtap-20070915.orig/tapset/rpc.stp systemtap-20070915/tapset/rpc.stp
--- systemtap-20070915.orig/tapset/rpc.stp 2007-09-20 11:59:27.000000000 +0900
+++ systemtap-20070915/tapset/rpc.stp 2007-09-20 12:21:40.000000000 +0900
@@ -56,6 +56,11 @@
* rpc_create_client(struct rpc_xprt *xprt, char *servname, * struct rpc_program *info, u32 version, * rpc_authflavor_t authflavor)
+ *
+ * static struct rpc_clnt * + * rpc_new_client(struct rpc_xprt *xprt, char *servname, + * struct rpc_program *program, u32 vers, + * rpc_authflavor_t flavor)
* * @servername: the server machine name
* @progname: the RPC program name
@@ -65,10 +70,20 @@
* @port: the port number
* @authflavor: the authentication flavor
*/
-probe sunrpc.clnt.create_client = kernel.function("rpc_create_client") ?,
- module("sunrpc").function("rpc_create_client") ?
+probe sunrpc.clnt.create_client = _sunrpc.clnt.create_client.*
{
servername = kernel_string($servname)
+ prot = $xprt->prot
+ port = $xprt->port
+
+ argstr = sprintf("%s %s %d %d %d %d %d", servername, progname, + prog, vers, prot, port, authflavor)
+}
+
+probe _sunrpc.clnt.create_client.part1 = kernel.function("rpc_create_client") ?,
+ module("sunrpc").function("rpc_create_client") ?
+{
+ name = "sunrpc.clnt.create_client"
%( kernel_v >= "2.6.10" %?
progname = kernel_string($info->name)
prog = $info->number
@@ -80,21 +95,35 @@
vers = vers_from_prog($program, $vers)
authflavor = $flavor
%)
-
- prot = $xprt->prot
- port = $xprt->port
+}


- name = "sunrpc.clnt.create_client"
- argstr = sprintf("%s %s %d %d %d %d %d", servername, progname, - prog, vers, prot, port, authflavor)
+probe _sunrpc.clnt.create_client.part2 = kernel.function("rpc_new_client") ?,
+ module("sunrpc").function("rpc_new_client") ?
+{
+ name = "sunrpc.clnt.new_client"
+ progname = kernel_string($program->name)
+ prog = $program->number
+ vers = vers_from_prog($program, $vers)
+ authflavor = $flavor
}


-probe sunrpc.clnt.create_client.return = +probe sunrpc.clnt.create_client.return = _sunrpc.clnt.create_client.return.* +{
+ retstr = returnstr($return)
+}
+
+probe _sunrpc.clnt.create_client.return.part1 = kernel.function("rpc_create_client").return ?,
- module("sunrpc").function("rpc_create_client").return ?
+ module("sunrpc").function("rpc_create_client").return ?
{
name = "sunrpc.clnt.create_client.return"
- retstr = returnstr($return)
+}
+
+probe _sunrpc.clnt.create_client.return.part2 =
+ kernel.function("rpc_new_client").return ?,
+ module("sunrpc").function("rpc_new_client").return ?
+{
+ name = "sunrpc.clnt.new_client.return"
}


/*


Regards, CaiFei



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]