lkml.org 
[lkml]   [2013]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH V2] mips: function tracer: Fix broken function tracing
From
Date
On Thu, 2013-01-17 at 09:58 -0500, Alan Cooper wrote:
> When the kernel first boots we have to be able to handle the gcc
> generated jalr, addui sequence until ftrace_init gets a chance to run
> and change the sequence. At this point mcount just adjusts the stack
> and returns. When ftrace_init runs, we convert the jalr/addui to nops.
> Then whenever tracing is enabled we convert the first nop to a "jalr
> mcount+8". The mcount+8 entry point skips the stack adjust.
>

I was confused by that too.

>
> On Thu, Jan 17, 2013 at 1:27 AM, Geert Uytterhoeven

> >
> >> @@ -69,7 +68,7 @@ NESTED(ftrace_caller, PT_SIZE, ra)
> >> .globl _mcount
> >> _mcount:
> >> b ftrace_stub
> >> - nop
> >> + addiu sp,sp,8

Can you add a comment here:

/* When tracing is activated, it calls ftrace_caller+8 (aka here) */

> >> lw t1, function_trace_stop
> >> bnez t1, ftrace_stub
> >> nop
> >

-- Steve




\
 
 \ /
  Last update: 2013-01-17 17:21    [W:0.056 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site