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] For getrusage's argstr in tapset


Hello, Wenji.

Thank you for your suggestion.

I investigated RUSAGE_BOTH and got the following result:
1: _rusage_who_str is only used for sys_getrusage(and compat_sys_getrusage)
 in current tapset, and there is no other syscall which needs to call
 _rusage_who_str.

2: RUSAGE_BOTH is only used in kernel's internal function getrusage, but
 there is no syscall using this function with RUSAGE_BOTH.

So I think RUSAGE_BOTH is not necessary in tracing syscall, but it may be
 needed when tracing kernel function as getrusage.

It is good idea disable RUSAGE_BOTH only in sys_getrusage
(and compat_sys_getrusage).

Regards
Zhaolei
----- Original Message ----- 
From: "Wenji Huang" <wenji.huang@oracle.com>
To: "Zhaolei" <zhaolei@cn.fujitsu.com>
Cc: <systemtap@sourceware.org>
Sent: Monday, September 10, 2007 11:44 AM
Subject: Re: [patch] For getrusage's argstr in tapset


> Hi Zhaolei,
> 
>     probe getrusage set probe point at the entry of the function. So the 
> arguments may be any value.
>   
>     So I think to keep the entry in _rusage_who_str, just give another 
> mapping in case of some certain value.
> 
>     Of course, if you can ensure that "who" only be 
> RUSAGE_SELF/RUSAGE_CHILDREN when the syscall called. Just remove.
> 
> Thanks,
> Wenji
> 
> 
> Zhaolei wrote:
> 
> >Hi, everyone
> >
> >In [tapset->probe getrusage], argstr's "who" argument is printed as
> > "RUSAGE_BOTH" when its value is -2.
> >But "RUSAGE_BOTH" is not used in getrusage syscall due to the following
> > kernel source:
> >asmlinkage long sys_getrusage(int who, struct rusage __user *ru)
> >{
> >        if (who != RUSAGE_SELF && who != RUSAGE_CHILDREN)
> >                return -EINVAL;
> >        return getrusage(current, who, ru);
> >}
> >
> >So i want to remove RUSAGE_BOTH from _rusage_who_str.
> >Is there anyone knows why RUSAGE_BOTH is necessary, please tell me.
> >and if no objection, I will commit it.
> >
> >Signed-off-by: "Zhaolei" zhaolei@cn.fujitsu.com
> >
> >--- aux_syscalls.stp.old        2007-09-06 11:51:14.000000000 +0900
> >+++ aux_syscalls.stp    2007-09-06 11:52:22.000000000 +0900
> >@@ -1661,7 +1661,6 @@ function _rlimit_resource_str(r) {
> > function _rusage_who_str(w) {
> >    if(w==0) return "RUSAGE_SELF"
> >    if(w==-1) return "RUSAGE_CHILDREN"
> >-   if(w==-2) return "RUSAGE_BOTH"
> >    return sprintf("UNKNOWN VALUE: %d", w)
> > }
> >
> >Regards
> >Zhaolei
> >
> >  
> >
> 
> 


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