diff options
author | Steven Rostedt <rostedt@goodmis.org> | 2008-08-14 15:45:12 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-14 04:34:58 -0400 |
commit | 0a37605c2261a06d8cafc62dee11374ad676c8c4 (patch) | |
tree | 0867723688dbdb824a5a15f91551f88bd47c6936 /arch/x86/kernel/ftrace.c | |
parent | e4b2b8866121bd06d5f3d9de0f79a04339ffa252 (diff) |
ftrace: x86 mcount stub
x86 now sets up the mcount locations through the build and no longer
needs to record the ip when the function is executed. This patch changes
the initial mcount to simply return. There's no need to do any other work.
If the ftrace start up test fails, the original mcount will be what everything
will use, so having this as fast as possible is a good thing.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/ftrace.c')
-rw-r--r-- | arch/x86/kernel/ftrace.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index ab115cd15fdf..96aadbfedcc6 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c | |||
@@ -112,18 +112,8 @@ notrace int ftrace_update_ftrace_func(ftrace_func_t func) | |||
112 | 112 | ||
113 | notrace int ftrace_mcount_set(unsigned long *data) | 113 | notrace int ftrace_mcount_set(unsigned long *data) |
114 | { | 114 | { |
115 | unsigned long ip = (long)(&mcount_call); | 115 | /* mcount is initialized as a nop */ |
116 | unsigned long *addr = data; | 116 | *data = 0; |
117 | unsigned char old[MCOUNT_INSN_SIZE], *new; | ||
118 | |||
119 | /* | ||
120 | * Replace the mcount stub with a pointer to the | ||
121 | * ip recorder function. | ||
122 | */ | ||
123 | memcpy(old, &mcount_call, MCOUNT_INSN_SIZE); | ||
124 | new = ftrace_call_replace(ip, *addr); | ||
125 | *addr = ftrace_modify_code(ip, old, new); | ||
126 | |||
127 | return 0; | 117 | return 0; |
128 | } | 118 | } |
129 | 119 | ||