This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH] kprobes patch
On Sat, Oct 28, 2006 at 10:21:05AM +0900, Jun Koi wrote:
> Hi Keshavanmurthy,
>
> On 10/28/06, Keshavamurthy@bambi.jf.intel.com
> <Keshavamurthy@bambi.jf.intel.com> wrote:
> >On Sat, Oct 28, 2006 at 03:58:18AM +0900, Jun Koi wrote:
> >> Hello,
> >>
> >> I am not sure if this is a right place to send patch for kprobes, but
> >> here it is. This patch moves the reset command of kprobe instance
> >> into the loop. (against 2.6.18)
> >
> >Hi jun,
> >Yes, you have sent it to the right place. thanks.
> >BTW, is is helpful to know what problem did you encounter due to which
> >you had come up with this patch. Or did you catch this bug by just code
> >review?
> >
>
> I had no problem at al. You are right, the patch is a result of
> reviewing the code.
Okay. Looked at your patch more carefully and found that there is
no bug as such. Please see my inline comments.
>
> Best,
> Jun
>
> >>
> >> Signed-off-by: Jun Koi <junkoi2004@gmail.com>
> >>
> >>
> >> --- a/kernel/kprobes.c 2006-09-20 12:42:06.000000000 +0900
> >> +++ b/kernel/kprobes.c 2006-10-28 03:52:27.000000000 +0900
> >> @@ -204,8 +204,8 @@ static int __kprobes aggr_pre_handler(st
> >> set_kprobe_instance(kp);
> >> if (kp->pre_handler(kp, regs))
> >> return 1;
> >> + reset_kprobe_instance();
> >> }
> >> - reset_kprobe_instance();
The reason that reset_kprobe_instance() is outside the loop is a kind of
optimization. You can call reset_kprobe_instance() once you are
out of the loop instead of having to call everytime inside the loop
followed by immediate call to set_kprobe_instance().
> >> }
> >> return 0;
> >> }
> >
thanks,
Anil Keshavamurthy