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]

Runtime probes to load module parameters


Hi Martin, Tom,

I made a small change to the runtime (stpd and stp script) to allow the probes to load with module params. To load your probe module with module params surround the module and the params with quote as follow

./stp "myprobe.ko entryaddr=0xc0168cb0 st_pid=4468"

Attached is the patch for that.

Thanks, Hien



--- src/runtime/stpd/librelay.c	2005-07-29 01:18:18.000000000 -0700
+++ src.new/runtime/stpd/librelay.c	2005-08-02 16:28:57.000000000 -0700
@@ -497,7 +497,9 @@
 		perror ("vfork");
 		exit(-1);
 	} else if (pid == 0) {
-		execl("/sbin/insmod",  "insmod", modname, buf, NULL);
+		char cmd[2048];
+		sprintf(cmd, "/sbin/insmod %s %s", modname, buf);
+		execl("/bin/sh", "sh", "-c", cmd, NULL); 
 		perror ("exec");
 		exit(-1);
 	}
--- src/runtime/probes/stp	2005-07-11 17:32:11.000000000 -0700
+++ src.new/runtime/probes/stp	2005-08-02 16:31:08.000000000 -0700
@@ -38,7 +38,7 @@
 #../../stpd/stpd -p $modulename
 
 # print to screen and log to files (file logging only if #define STP_NETLINK_ONLY commented out in module)
-../../stpd/stpd $modulename
+../../stpd/stpd "$modulename"
 
 # no screen, log to files (file logging only if #define STP_NETLINK_ONLY commented out in module)
 #../../stpd/stpd -q $modulename

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