kprobes/trace: Fix kprobe selftest for gcc 4.6
authorSteven Rostedt <srostedt@redhat.com>
Tue, 7 Jun 2011 02:35:13 +0000 (22:35 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Tue, 7 Jun 2011 18:47:36 +0000 (14:47 -0400)
commit265a5b7ee3eb21a4d0e53e17d59ba6eada91af39
tree52ad853f49e8949a307f475115cc682d44753287
parent0aff1c0cef13b34c17e81a502336fad738151c37
kprobes/trace: Fix kprobe selftest for gcc 4.6

With gcc 4.6, the self test kprobe function:

 kprobe_trace_selftest_target()

is optimized such that kallsyms does not list it. The kprobes
test uses this function to insert a probe and test it. But
it will fail the test if the function is not listed in kallsyms.

Adding a __used annotation keeps the symbol in the kallsyms table.

Suggested-by: David Daney <ddaney@caviumnetworks.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace_kprobe.c