This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Patch]Fix the args' output of syscall execve
- From: Cai Fei <caifei at cn dot fujitsu dot com>
- To: systemtap at sourceware dot org
- Date: Thu, 16 Aug 2007 10:52:42 +0900
- Subject: [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