linux-mips
[Top] [All Lists]

Re: [PATCH V2] mips: function tracer: Fix broken function tracing

To: Alan Cooper <alcooperx@gmail.com>
Subject: Re: [PATCH V2] mips: function tracer: Fix broken function tracing
From: Steven Rostedt <rostedt@goodmis.org>
Date: Thu, 17 Jan 2013 10:35:45 -0500
Cc: Geert Uytterhoeven <geert@linux-m68k.org>, ddaney.cavm@gmail.com, ralf@linux-mips.org, linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
In-reply-to: <CAOGqxeWNfknkq2Kad2sTWh9f9C8HpghdNBimsB9HFs8ze=LHHQ@mail.gmail.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
References: <1358379808-16449-1-git-send-email-alcooperx@gmail.com> <CAMuHMdUSRM6dauiRtSs20YVfHmNrROrc4RpZL+dKA_e2t82J6A@mail.gmail.com> <CAOGqxeWNfknkq2Kad2sTWh9f9C8HpghdNBimsB9HFs8ze=LHHQ@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
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



<Prev in Thread] Current Thread [Next in Thread>