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]

Re: [PATCH]Add lacked syscall.unshare to tapset


Hello, Mark

Thank you for your advice.
It is a good idea to set flags as string in argstr.

In my opinion, sys_unshare support only following flags:

asmlinkage long sys_unshare(unsigned long unshare_flags)
{
    ...
    if (unshare_flags & ~(CLONE_THREAD|CLONE_FS|CLONE_NEWNS|CLONE_SIGHAND|
        CLONE_VM|CLONE_FILES|CLONE_SYSVSEM|
        CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWUSER|
        CLONE_NEWNET))
    goto bad_unshare_out;
    ...
}

It is different from flags in __fork_flags.
I think it maybe necessary to add a new function like __unshare_flags in
aux_syscalls.stp.

Best Regards
Zhaolei

----- Original Message ----- 
From: "Mark Wielaard" <mwielaard@redhat.com>
To: "Zhaolei" <zhaolei@cn.fujitsu.com>
Cc: <systemtap@sourceware.org>
Sent: Tuesday, June 03, 2008 3:29 PM
Subject: Re: [PATCH]Add lacked syscall.unshare to tapset


> Hi Zhaolei,
> 
> On Tue, 2008-06-03 at 13:43 +0800, Zhaolei wrote:
>> Following patch adds support for lacked syscall.unshare.
>> If no objection, I will commit it.
>>
>> +# unshare ____________________________________________________
>> +# new function with 2.6.16
>> +# long sys_unshare(unsigned long unshare_flags)
>> +probe syscall.unshare = kernel.function("sys_unshare") ? {
>> + name = "unshare"
>> + unshare_flags = $unshare_flags
>> + argstr = sprintf("%d", unshare_flags)
>> +}
> 
> Are these flags the same as one would use for clone/fork?
> In that case you might want to use
>  argstr = __fork_flags(unshare_flags)
> __fork_flags() is defined in aux_syscalls.stp.
> 
> Cheers,
> 
> Mark
> 
> 
>

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