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]Fix the args' output of syscall execve


Hi, all
I'm using stap for tracing syscall execve. The following is part of my program:
---------------------------------------------------------
char *exec_argv[4] = {"arg1", "arg2", "arg3", NULL};
......
execve("./hello", exec_argv, NULL);
......
---------------------------------------------------------
and my stap file:
---------------------------------------------------------
probe syscall.execve {
if (pid() == target() || ppid() == target()) next
printf("%s\n", name)
printf("%s\n", filename)
printf("%s\n", args)
}
---------------------------------------------------------
and the output of stap command:
---------------------------------------------------------
execve
./hello
arg2 arg3
---------------------------------------------------------


I think users may be confused without the first argument. So I fixed it:

--- systemtap-20070811/tapset/aux_syscalls.stp	2007-08-11 00:39:43.000000000 +0900
+++ systemtap-20070811new/tapset/aux_syscalls.stp	2007-08-16 10:23:14.000000000 +0900
@@ -608,9 +608,6 @@ function __get_argv:string(a:long)
	char buf[80];
	char *ptr = buf;

-	if (argv)
-		argv++;
-
	while (argv != NULL) {
		if (get_user (vstr, argv))
      			break;


Regards, CaiFei



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