]> git.baikalelectronics.ru Git - kernel.git/commit
ftrace: remove old pointers to mcount
authorSteven Rostedt <rostedt@goodmis.org>
Fri, 15 Aug 2008 02:47:19 +0000 (22:47 -0400)
committerIngo Molnar <mingo@elte.hu>
Tue, 14 Oct 2008 08:35:12 +0000 (10:35 +0200)
commit0e14531fd73cbfc0e5d4c4a0932fc53948f9d864
treea4592352d28efcfe82379c71d061b9127e49a115
parent10bafea25f363cc42e599b652dc2c2ee34b10fbd
ftrace: remove old pointers to mcount

When a mcount pointer is recorded into a table, it is used to add or
remove calls to mcount (replacing them with nops). If the code is removed
via removing a module, the pointers still exist.  At modifying the code
a check is always made to make sure the code being replaced is the code
expected. In-other-words, the code being replaced is compared to what
it is expected to be before being replaced.

There is a very small chance that the code being replaced just happens
to look like code that calls mcount (very small since the call to mcount
is relative). To remove this chance, this patch adds ftrace_release to
allow module unloading to remove the pointers to mcount within the module.

Another change for init calls is made to not trace calls marked with
__init. The tracing can not be started until after init is done anyway.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/linux/ftrace.h
include/linux/init.h
kernel/module.c
kernel/trace/ftrace.c