diff options
author | Matt Fleming <matt@console-pimps.org> | 2009-06-28 09:05:44 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-07-06 06:53:53 -0400 |
commit | c1340c053be7a43d837a3acb352d5008be865a55 (patch) | |
tree | b88104b3a2373d58465057eae38885b66315b3c0 /arch/sh/lib/mcount.S | |
parent | ca0d17277fd101ce4878f92b398b6ab71fb2c287 (diff) |
sh: Define HAVE_FUNCTION_TRACE_MCOUNT_TEST
Enable HAVE_FUNCTION_TRACE_MCOUNT_TEST and test the value of
function_trace_stop from our assembly code as opposed to using the
generic C function. This should optimise our mcount/ftrace code path.
Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/lib/mcount.S')
-rw-r--r-- | arch/sh/lib/mcount.S | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/sh/lib/mcount.S b/arch/sh/lib/mcount.S index 110fbfe1831f..cb87ef580b31 100644 --- a/arch/sh/lib/mcount.S +++ b/arch/sh/lib/mcount.S | |||
@@ -2,7 +2,7 @@ | |||
2 | * arch/sh/lib/mcount.S | 2 | * arch/sh/lib/mcount.S |
3 | * | 3 | * |
4 | * Copyright (C) 2008 Paul Mundt | 4 | * Copyright (C) 2008 Paul Mundt |
5 | * Copyright (C) 2008 Matt Fleming | 5 | * Copyright (C) 2008, 2009 Matt Fleming |
6 | * | 6 | * |
7 | * This file is subject to the terms and conditions of the GNU General Public | 7 | * This file is subject to the terms and conditions of the GNU General Public |
8 | * License. See the file "COPYING" in the main directory of this archive | 8 | * License. See the file "COPYING" in the main directory of this archive |
@@ -35,6 +35,12 @@ | |||
35 | .type mcount,@function | 35 | .type mcount,@function |
36 | _mcount: | 36 | _mcount: |
37 | mcount: | 37 | mcount: |
38 | #ifndef CONFIG_DYNAMIC_FTRACE | ||
39 | mov.l .Lfunction_trace_stop, r0 | ||
40 | mov.l @r0, r0 | ||
41 | tst r0, r0 | ||
42 | bf ftrace_stub | ||
43 | #endif | ||
38 | MCOUNT_ENTER() | 44 | MCOUNT_ENTER() |
39 | 45 | ||
40 | #ifdef CONFIG_DYNAMIC_FTRACE | 46 | #ifdef CONFIG_DYNAMIC_FTRACE |
@@ -62,6 +68,11 @@ skip_trace: | |||
62 | #ifdef CONFIG_DYNAMIC_FTRACE | 68 | #ifdef CONFIG_DYNAMIC_FTRACE |
63 | .globl ftrace_caller | 69 | .globl ftrace_caller |
64 | ftrace_caller: | 70 | ftrace_caller: |
71 | mov.l .Lfunction_trace_stop, r0 | ||
72 | mov.l @r0, r0 | ||
73 | tst r0, r0 | ||
74 | bf ftrace_stub | ||
75 | |||
65 | MCOUNT_ENTER() | 76 | MCOUNT_ENTER() |
66 | 77 | ||
67 | .globl ftrace_call | 78 | .globl ftrace_call |
@@ -88,3 +99,7 @@ ftrace_call: | |||
88 | ftrace_stub: | 99 | ftrace_stub: |
89 | rts | 100 | rts |
90 | nop | 101 | nop |
102 | |||
103 | .align 2 | ||
104 | .Lfunction_trace_stop: | ||
105 | .long function_trace_stop | ||