diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2009-05-13 16:30:24 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-05-18 01:19:04 -0400 |
commit | 021376a3b655364c92c10be544a3319946a792e8 (patch) | |
tree | 923261eaee50d24b54766d68ef799f6934faa837 /arch | |
parent | af3e4aca47d2e05a545a5e10ba5c7193e0b665e0 (diff) |
powerpc/ftrace: Use pr_devel() in ftrace.c
pr_debug() can now result in code being generated even when #DEBUG
is not defined. That's not really desirable in the ftrace code
which we want to be snappy.
With CONFIG_DYNAMIC_DEBUG=y:
size before:
text data bss dec hex filename
3334 672 4 4010 faa arch/powerpc/kernel/ftrace.o
size after:
text data bss dec hex filename
2616 360 4 2980 ba4 arch/powerpc/kernel/ftrace.o
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/ftrace.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c index 70e2a736be1f..5b078ee391fc 100644 --- a/arch/powerpc/kernel/ftrace.c +++ b/arch/powerpc/kernel/ftrace.c | |||
@@ -157,7 +157,7 @@ __ftrace_make_nop(struct module *mod, | |||
157 | * 0xe8, 0x4c, 0x00, 0x28, ld r2,40(r12) | 157 | * 0xe8, 0x4c, 0x00, 0x28, ld r2,40(r12) |
158 | */ | 158 | */ |
159 | 159 | ||
160 | pr_debug("ip:%lx jumps to %lx r2: %lx", ip, tramp, mod->arch.toc); | 160 | pr_devel("ip:%lx jumps to %lx r2: %lx", ip, tramp, mod->arch.toc); |
161 | 161 | ||
162 | /* Find where the trampoline jumps to */ | 162 | /* Find where the trampoline jumps to */ |
163 | if (probe_kernel_read(jmp, (void *)tramp, sizeof(jmp))) { | 163 | if (probe_kernel_read(jmp, (void *)tramp, sizeof(jmp))) { |
@@ -165,7 +165,7 @@ __ftrace_make_nop(struct module *mod, | |||
165 | return -EFAULT; | 165 | return -EFAULT; |
166 | } | 166 | } |
167 | 167 | ||
168 | pr_debug(" %08x %08x", jmp[0], jmp[1]); | 168 | pr_devel(" %08x %08x", jmp[0], jmp[1]); |
169 | 169 | ||
170 | /* verify that this is what we expect it to be */ | 170 | /* verify that this is what we expect it to be */ |
171 | if (((jmp[0] & 0xffff0000) != 0x3d820000) || | 171 | if (((jmp[0] & 0xffff0000) != 0x3d820000) || |
@@ -181,18 +181,18 @@ __ftrace_make_nop(struct module *mod, | |||
181 | offset = ((unsigned)((unsigned short)jmp[0]) << 16) + | 181 | offset = ((unsigned)((unsigned short)jmp[0]) << 16) + |
182 | (int)((short)jmp[1]); | 182 | (int)((short)jmp[1]); |
183 | 183 | ||
184 | pr_debug(" %x ", offset); | 184 | pr_devel(" %x ", offset); |
185 | 185 | ||
186 | /* get the address this jumps too */ | 186 | /* get the address this jumps too */ |
187 | tramp = mod->arch.toc + offset + 32; | 187 | tramp = mod->arch.toc + offset + 32; |
188 | pr_debug("toc: %lx", tramp); | 188 | pr_devel("toc: %lx", tramp); |
189 | 189 | ||
190 | if (probe_kernel_read(jmp, (void *)tramp, 8)) { | 190 | if (probe_kernel_read(jmp, (void *)tramp, 8)) { |
191 | printk(KERN_ERR "Failed to read %lx\n", tramp); | 191 | printk(KERN_ERR "Failed to read %lx\n", tramp); |
192 | return -EFAULT; | 192 | return -EFAULT; |
193 | } | 193 | } |
194 | 194 | ||
195 | pr_debug(" %08x %08x\n", jmp[0], jmp[1]); | 195 | pr_devel(" %08x %08x\n", jmp[0], jmp[1]); |
196 | 196 | ||
197 | ptr = ((unsigned long)jmp[0] << 32) + jmp[1]; | 197 | ptr = ((unsigned long)jmp[0] << 32) + jmp[1]; |
198 | 198 | ||
@@ -269,7 +269,7 @@ __ftrace_make_nop(struct module *mod, | |||
269 | * 0x4e, 0x80, 0x04, 0x20 bctr | 269 | * 0x4e, 0x80, 0x04, 0x20 bctr |
270 | */ | 270 | */ |
271 | 271 | ||
272 | pr_debug("ip:%lx jumps to %lx", ip, tramp); | 272 | pr_devel("ip:%lx jumps to %lx", ip, tramp); |
273 | 273 | ||
274 | /* Find where the trampoline jumps to */ | 274 | /* Find where the trampoline jumps to */ |
275 | if (probe_kernel_read(jmp, (void *)tramp, sizeof(jmp))) { | 275 | if (probe_kernel_read(jmp, (void *)tramp, sizeof(jmp))) { |
@@ -277,7 +277,7 @@ __ftrace_make_nop(struct module *mod, | |||
277 | return -EFAULT; | 277 | return -EFAULT; |
278 | } | 278 | } |
279 | 279 | ||
280 | pr_debug(" %08x %08x ", jmp[0], jmp[1]); | 280 | pr_devel(" %08x %08x ", jmp[0], jmp[1]); |
281 | 281 | ||
282 | /* verify that this is what we expect it to be */ | 282 | /* verify that this is what we expect it to be */ |
283 | if (((jmp[0] & 0xffff0000) != 0x3d600000) || | 283 | if (((jmp[0] & 0xffff0000) != 0x3d600000) || |
@@ -293,7 +293,7 @@ __ftrace_make_nop(struct module *mod, | |||
293 | if (tramp & 0x8000) | 293 | if (tramp & 0x8000) |
294 | tramp -= 0x10000; | 294 | tramp -= 0x10000; |
295 | 295 | ||
296 | pr_debug(" %lx ", tramp); | 296 | pr_devel(" %lx ", tramp); |
297 | 297 | ||
298 | if (tramp != addr) { | 298 | if (tramp != addr) { |
299 | printk(KERN_ERR | 299 | printk(KERN_ERR |
@@ -402,7 +402,7 @@ __ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) | |||
402 | /* ld r2,40(r1) */ | 402 | /* ld r2,40(r1) */ |
403 | op[1] = 0xe8410028; | 403 | op[1] = 0xe8410028; |
404 | 404 | ||
405 | pr_debug("write to %lx\n", rec->ip); | 405 | pr_devel("write to %lx\n", rec->ip); |
406 | 406 | ||
407 | if (probe_kernel_write((void *)ip, op, MCOUNT_INSN_SIZE * 2)) | 407 | if (probe_kernel_write((void *)ip, op, MCOUNT_INSN_SIZE * 2)) |
408 | return -EPERM; | 408 | return -EPERM; |
@@ -442,7 +442,7 @@ __ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) | |||
442 | return -EINVAL; | 442 | return -EINVAL; |
443 | } | 443 | } |
444 | 444 | ||
445 | pr_debug("write to %lx\n", rec->ip); | 445 | pr_devel("write to %lx\n", rec->ip); |
446 | 446 | ||
447 | if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE)) | 447 | if (probe_kernel_write((void *)ip, &op, MCOUNT_INSN_SIZE)) |
448 | return -EPERM; | 448 | return -EPERM; |