On Wed, Nov 12, 2025 at 7:36 AM Steven Rostedt <[email protected]> wrote:
>
> On Tue, 11 Nov 2025 21:54:32 +0800
> Donglin Peng <[email protected]> wrote:
>
> > +     /* Store the retaddr in args[0] */
> > +     if (type == TRACE_GRAPH_RETADDR_ENT)
> > +             entry->args[i++] = retaddr;
> > +
> >  #ifdef CONFIG_HAVE_FUNCTION_ARG_ACCESS_API
> > -     if (fregs) {
> > -             for (int i = 0; i < FTRACE_REGS_MAX_ARGS; i++)
> > -                     entry->args[i] = ftrace_regs_get_argument(fregs, i);
> > +     if (store_args) {
> > +             while (i < nr_args) {
>
> Nit, this could stay as a for loop. You just don't initialize the 'i':

Thanks, I will fix it in v3.

>
>                 for (; i < nr_args; i++) {
>
> > +                     entry->args[i] = ftrace_regs_get_argument(fregs,
> > +                                             i - (type == 
> > TRACE_GRAPH_RETADDR_ENT ? 1 : 0));
> > +                     i++;
>
> Then you don't need the "i++" here.
>
> -- Steve
>
> > +             }
> >       }

Reply via email to