#ifdef CONFIG_FTRACE_MCOUNT_RECORD
extern void ftrace_init(void);
+extern void ftrace_init_module(unsigned long *start, unsigned long *end);
#else
static inline void ftrace_init(void) { }
+static inline void
+ftrace_init_module(unsigned long *start, unsigned long *end) { }
#endif
#endif /* _LINUX_FTRACE_H */
#include <linux/license.h>
#include <asm/sections.h>
#include <linux/tracepoint.h>
+#include <linux/ftrace.h>
#if 0
#define DEBUGP printk
unsigned int markersstringsindex;
unsigned int tracepointsindex;
unsigned int tracepointsstringsindex;
+ unsigned int mcountindex;
struct module *mod;
long err = 0;
void *percpu = NULL, *ptr = NULL; /* Stops spurious gcc warning */
tracepointsstringsindex = find_sec(hdr, sechdrs, secstrings,
"__tracepoints_strings");
+ mcountindex = find_sec(hdr, sechdrs, secstrings,
+ "__mcount_loc");
+
/* Now do relocations. */
for (i = 1; i < hdr->e_shnum; i++) {
const char *strtab = (char *)sechdrs[strindex].sh_addr;
mod->tracepoints + mod->num_tracepoints);
#endif
}
+
+ if (mcountindex) {
+ void *mseg = (void *)sechdrs[mcountindex].sh_addr;
+ ftrace_init_module(mseg, mseg + sechdrs[mcountindex].sh_size);
+ }
+
err = module_finalize(hdr, sechdrs, mod);
if (err < 0)
goto cleanup;
return 0;
}
+void ftrace_init_module(unsigned long *start, unsigned long *end)
+{
+ ftrace_convert_nops(start, end);
+}
+
extern unsigned long __start_mcount_loc[];
extern unsigned long __stop_mcount_loc[];