public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Patch]Add function for probe point sunrpc.clnt.create_client
@ 2007-09-20 15:05 Cai Fei
  2007-09-21 12:16 ` [Patch]Improve retstr of syscall.adjtimex.return in tapset Zhaolei
  0 siblings, 1 reply; 3+ messages in thread
From: Cai Fei @ 2007-09-20 15:05 UTC (permalink / raw)
  To: systemtap

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-09-21 16:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-20 15:05 [Patch]Add function for probe point sunrpc.clnt.create_client Cai Fei
2007-09-21 12:16 ` [Patch]Improve retstr of syscall.adjtimex.return in tapset Zhaolei
2007-09-21 16:33   ` Martin Hunt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).