]> git.karo-electronics.de Git - mv-sheeva.git/commit
tracing: Fix $mcount_regex for MIPS in recordmcount.pl
authorDavid Daney <ddaney@caviumnetworks.com>
Fri, 9 Jul 2010 21:52:05 +0000 (14:52 -0700)
committerSteven Rostedt <rostedt@goodmis.org>
Thu, 22 Jul 2010 18:55:43 +0000 (14:55 -0400)
commita484e54fae891703cbe1c9ec1b536605f11f5482
tree5823d13ad3118c642a90af4df852077f20f5e6c4
parent9849ed4d72251d273524efb8b70be0be9aecb1df
tracing: Fix $mcount_regex for MIPS in recordmcount.pl

I found this issue in a locally patched 2.6.32.x, current kernels have
moved the offending code to an __init function which is skipped by
recordmcount.pl, so the bug is not currently being exercised.
However, I think the patch is still a good idea, to avoid future
problems if _mcount were to ever have its address taken in normal
code.

This is what I originally saw:

    Although arch/mips/kernel/ftrace.c is built without -pg, and thus
    contains no calls to _mcount, it does use the address of _mcount
    in ftrace_make_nop().  This was causing relocations to be emitted
    for _mcount which recordmcount.pl erronously took to be _mcount
    call sites.  The result was that the text of ftrace_make_nop()
    would be patched with garbage leading to a system crash.

In non-module code, all _mcount call sites will have R_MIPS_26
relocations, so we restrict $mcount_regex to only match on these.

Acked-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Wu Zhangjin <wuzhangjin@gmail.com>
Signed-off-by: David Daney <ddaney@caviumnetworks.com>
LKML-Reference: <1278712325-12050-1-git-send-email-ddaney@caviumnetworks.com>
Cc: Li Hong <lihong.hi@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
scripts/recordmcount.pl