On Wed, Sep 16, 2009 at 03:32, Li Yi wrote:
> On Wed, 2009-09-16 at 00:39 -0400, Mike Frysinger wrote:
>> On Tue, Sep 15, 2009 at 05:24,  <[email protected]> wrote:
>> >  ENTRY(__mcount)
>> > +   /* __mcount is called this way:
>> > +    * parent_ip: [--sp] = rets; call __mcount; rets = [sp++]
>> > +    */
>> > +   [--sp] = r1;
>> > +   r1 = [sp + 4];
>> > +
>> > -   /* save first/second function arg and the return register */
>> >     [--sp] = r0;
>> > -   [--sp] = r1;
>> >     [--sp] = rets;
>>
>> why did you need to move the r1 save/restore location ?  the early
>> code doesnt need r1 and it's been specifically coded to avoid any
>> unnecessary overhead in the most common case -- ftrace is completely
>> disabled.
>
> I did not take the overhead of "[--sp] = r1" into consideration. OK, I
> will check in a new patch to fix this.

thanks, with that change your final diff looks much more reasonable ;)

>    /* setup the tracer function */
>    p0 = r3;
>
>-   /* tracer(ulong frompc, ulong selfpc):
>-    *  frompc: the pc that did the call to ...
>-    *  selfpc: ... this location
>-    * the selfpc itself will need adjusting for the mcount call
>+   /* function_trace_call(unsigned long ip, unsigned long parent_ip):
>+    *  ip: ... this location
>+    *  parent_ip: the pc that did the call to ...
>+    * the ip itself will need adjusting for the mcount call
>     */

the re-ordering the comment lines kind of screws up the "..."

>-   r1 = rets;
>-   r0 = [fp + 4];
>-   r1 += -MCOUNT_INSN_SIZE;
>-
>+   r0 = rets;
>+   r0 += -MCOUNT_INSN_SIZE;
>+
>+   /*
>+    * parent_ip:
>+    * __mcount is called this way:
>+    * [--sp] = rets; call __mcount; rets = [sp++]
>+    * currently on stack: rets, r2, r0, r1, rets
>+    */
>+   r1 = [sp + 16];

i had inlined the r1/r0/r1 loads in a naive attempt to better account
for the pipeline

these are trivial issues so i'll fix them when cleaning up the commit for git
-mike
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to