module/ftrace: handle patchable-function-entry
[linux-2.6-block.git] / include / asm-generic / vmlinux.lds.h
index dae64600ccbffe9d006164de3243bbe284e638a5..a9c4e47214340f3b9b170041e17b897412594c9f 100644 (file)
 #endif
 
 #ifdef CONFIG_FTRACE_MCOUNT_RECORD
-#ifdef CC_USING_PATCHABLE_FUNCTION_ENTRY
-#define MCOUNT_REC()   . = ALIGN(8);                           \
-                       __start_mcount_loc = .;                 \
-                       KEEP(*(__patchable_function_entries))   \
-                       __stop_mcount_loc = .;
-#else
+/*
+ * The ftrace call sites are logged to a section whose name depends on the
+ * compiler option used. A given kernel image will only use one, AKA
+ * FTRACE_CALLSITE_SECTION. We capture all of them here to avoid header
+ * dependencies for FTRACE_CALLSITE_SECTION's definition.
+ */
 #define MCOUNT_REC()   . = ALIGN(8);                           \
                        __start_mcount_loc = .;                 \
                        KEEP(*(__mcount_loc))                   \
+                       KEEP(*(__patchable_function_entries))   \
                        __stop_mcount_loc = .;
-#endif
 #else
 #define MCOUNT_REC()
 #endif