This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Patch] Add cloning flags of syscall clone to tapset
- From: Cai Fei <caifei at cn dot fujitsu dot com>
- To: systemtap at sourceware dot org
- Date: Thu, 09 Aug 2007 16:02:08 +0900
- Subject: [Patch] Add cloning flags of syscall clone to tapset
Hi, all.
I'm using systemtap for tracing syscall clone.
According to the definition of sched.h in glibc, the cloning flags
contain the following
CLONE_VM, CLONE_NEWNS and CLONE_DETACHED etc..
But in the function __fork_flags:string(flags:long) in aux_syscalls.stp,
they are not
mentioned so these 3 flags will never be outputted even they are used.
I add them to the tapset:
Signed-off-by: Cai Fei <caifei@cn.fujitsu.com>
--- systemtap-20070804/tapset/aux_syscalls.stp 2007-08-04 05:48:36.000000000 +0900
+++ systemtap-20070804new/tapset/aux_syscalls.stp 2007-08-09 15:52:31.000000000 +0900
@@ -559,6 +559,8 @@ function __fork_flags:string(flags:long)
int len;
long flags = THIS->flags;
char *str = THIS->__retvalue;
+ if (flags & CLONE_VM)
+ strlcat(str,"CLONE_VM|", MAXSTRINGLEN);
if (flags & CLONE_FS)
strlcat(str,"CLONE_FS|", MAXSTRINGLEN);
if (flags & CLONE_FILES)
@@ -573,6 +575,8 @@ function __fork_flags:string(flags:long)
strlcat(str, "CLONE_PARENT|", MAXSTRINGLEN);
if (flags & CLONE_THREAD)
strlcat(str, "CLONE_THREAD|", MAXSTRINGLEN);
+ if (flags & CLONE_NEWNS)
+ strlcat(str,"CLONE_NEWNS|", MAXSTRINGLEN);
if (flags & CLONE_SYSVSEM)
strlcat(str, "CLONE_SYSVSEM|", MAXSTRINGLEN);
if (flags & CLONE_SETTLS)
@@ -581,6 +585,8 @@ function __fork_flags:string(flags:long)
strlcat(str, "CLONE_PARENT_SETTID|", MAXSTRINGLEN);
if (flags & CLONE_CHILD_CLEARTID)
strlcat(str, "CLONE_CHILD_CLEARTID|", MAXSTRINGLEN);
+ if (flags & CLONE_DETACHED)
+ strlcat(str,"CLONE_DETACHED|", MAXSTRINGLEN);
if (flags & CLONE_UNTRACED)
strlcat(str, "CLONE_UNTRACED|", MAXSTRINGLEN);
if (flags & CLONE_CHILD_SETTID)
Regards, Cai Fei