lkml.org 
[lkml]   [2015]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 2/3] arm64: refactor save_stack_trace()
On Fri, 17 Jul 2015 11:49:52 +0900
AKASHI Takahiro <takahiro.akashi@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.
>


\
 
 \ /
  Last update: 2015-07-17 05:41    [W:0.111 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site