From: "Zhaolei" <zhaolei@cn.fujitsu.com>
To: "Wenji Huang" <wenji.huang@oracle.com>
Cc: <systemtap@sourceware.org>
Subject: Re: [patch] For getrusage's argstr in tapset
Date: Mon, 10 Sep 2007 09:28:00 -0000 [thread overview]
Message-ID: <013001c7f367$a9b745d0$85697c0a@guest004> (raw)
In-Reply-To: <46E4AF85.3090901@oracle.com>
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
> >
> >
> >
>
>
next prev parent reply other threads:[~2007-09-10 5:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1188780895.5736.ezmlm@sourceware.org>
2007-09-03 12:48 ` [patch] Modify flag's value in tapset's probe delete_module Zhaolei
2007-09-05 14:46 ` [patch] For memory access error when calling _stp_sockaddr_str with addrlen set to 0 Zhaolei
2007-09-05 22:49 ` Frank Ch. Eigler
2007-09-10 5:03 ` [patch] For getrusage's argstr in tapset Zhaolei
2007-09-10 5:21 ` Wenji Huang
2007-09-10 9:28 ` Zhaolei [this message]
2007-09-10 14:01 ` Wenji Huang
2007-09-13 16:06 ` Zhaolei
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='013001c7f367$a9b745d0$85697c0a@guest004' \
--to=zhaolei@cn.fujitsu.com \
--cc=systemtap@sourceware.org \
--cc=wenji.huang@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).