Re: [PATCH v2 2/4] fprobe: make fprobe_kprobe_handler recursion free
From: Ze Gao
Date: Tue May 16 2023 - 05:36:09 EST
Thanks for pointing this out, I'll get it all fixed ASAP.
Regards,
Ze
On Tue, May 16, 2023 at 5:16 PM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> On Tue, May 16, 2023 at 03:18:28PM +0800, Ze Gao wrote:
>
> > +static void fprobe_handler(unsigned long ip, unsigned long parent_ip,
> > + struct ftrace_ops *ops, struct ftrace_regs *fregs)
> > +{
> > + struct fprobe *fp;
> > + int bit;
> > +
> > + fp = container_of(ops, struct fprobe, ops);
> > + if (fprobe_disabled(fp))
> > + return;
> > +
> > + /* recursion detection has to go before any traceable function and
> > + * all functions before this point should be marked as notrace
> > + */
> > + bit = ftrace_test_recursion_trylock(ip, parent_ip);
> > + if (bit < 0) {
> > + fp->nmissed++;
> > + return;
> > + }
> > + __fprobe_handler(ip, parent_ip, ops, fregs);
> > ftrace_test_recursion_unlock(bit);
> > +
> > }
> > NOKPROBE_SYMBOL(fprobe_handler);
> >
> > static void fprobe_kprobe_handler(unsigned long ip, unsigned long parent_ip,
> > struct ftrace_ops *ops, struct ftrace_regs *fregs)
> > {
> > - struct fprobe *fp = container_of(ops, struct fprobe, ops);
> > + struct fprobe *fp;
> > + int bit;
> > +
> > + fp = container_of(ops, struct fprobe, ops);
> > + if (fprobe_disabled(fp))
> > + return;
> > +
> > + /* recursion detection has to go before any traceable function and
> > + * all functions called before this point should be marked as notrace
> > + */
> > + bit = ftrace_test_recursion_trylock(ip, parent_ip);
> > + if (bit < 0) {
> > + fp->nmissed++;
> > + return;
> > + }
>
> Please don't use this comment style; multi line comments go like:
>
> /*
> * Multi line comment ...
> * ... is symmetric.
> */
>
> Same for your next patch.