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


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]