On Fri, 17 Jul 2015 11:49:52 +0900
AKASHI Takahiro <takahiro.aka...@linaro.org> wrote:

> > -
> > -   if (using_ftrace_ops_list_func())
> > -           max_stack_trace.skip = 4;
> > -   else
> > -           max_stack_trace.skip = 3;
> > +   max_stack_trace.skip = 3;
> 
> I don't think this last line is necessary because we will skip all
> the functions anyway below:

I put this back more as an optimization as it is already known that it
takes at least three calls to get to this point. Unless of course gcc
decides to inline them. But currently I don't see that.

> 
> >     save_stack_trace(&max_stack_trace);
> >
> > -   /*
> > -    * Add the passed in ip from the function tracer.
> > -    * Searching for this on the stack will skip over
> > -    * most of the overhead from the stack tracer itself.
> > -    */
> > -   stack_dump_trace[0] = ip;
> > -   max_stack_trace.nr_entries++;
> > +   /* Skip over the overhead of the stack tracer itself */
> > +   for (i = 0; i < max_stack_trace.nr_entries; i++) {
> > +           if (stack_dump_trace[i] == ip)
> > +                   break;
> > +   }
> 
> here. Now "i" indicates the start point, excepting tracer functions,
> and "x" will eventually represent the exact number of functions
> that we are interested in after searching the stack.
> 
> To calc "stack_max_size" correctly, we should change the line:
>      if (unlikely(tracer_frame) && i == 1) {
> to
>      if (unlikely(tracer_frame)) {

Good catch, I'll fix that!

-- Steve

> 
> With these two changes applied, the issues Jungseok mentioned will be
> fixed.
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to