tracing: Use linker magic instead of recasting ftrace_ops_list_func()
[linux-2.6-microblaze.git] / include / asm-generic / vmlinux.lds.h
index f2984af..8771c43 100644 (file)
  * Need to also make ftrace_stub_graph point to ftrace_stub
  * so that the same stub location may have different protocols
  * and not mess up with C verifiers.
+ *
+ * ftrace_ops_list_func will be defined as arch_ftrace_ops_list_func
+ * as some archs will have a different prototype for that function
+ * but ftrace_ops_list_func() will have a single prototype.
  */
 #define MCOUNT_REC()   . = ALIGN(8);                           \
                        __start_mcount_loc = .;                 \
                        KEEP(*(__mcount_loc))                   \
                        KEEP(*(__patchable_function_entries))   \
                        __stop_mcount_loc = .;                  \
-                       ftrace_stub_graph = ftrace_stub;
+                       ftrace_stub_graph = ftrace_stub;        \
+                       ftrace_ops_list_func = arch_ftrace_ops_list_func;
 #else
 # ifdef CONFIG_FUNCTION_TRACER
-#  define MCOUNT_REC() ftrace_stub_graph = ftrace_stub;
+#  define MCOUNT_REC() ftrace_stub_graph = ftrace_stub;        \
+                       ftrace_ops_list_func = arch_ftrace_ops_list_func;
 # else
 #  define MCOUNT_REC()
 # endif