[PATCH 03/12] ftrace: declare __{start,stop}_mcount_loc as external array

From: Vegard Nossum
Date: Sun Oct 16 2016 - 11:17:42 EST


Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
Signed-off-by: Vegard Nossum <vegard.nossum@xxxxxxxxxx>
---
kernel/trace/ftrace.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 2050a765..3c37036 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -13,6 +13,7 @@
* Copyright (C) 2004 Nadia Yvette Chambers
*/

+#include <linux/extarray.h>
#include <linux/stop_machine.h>
#include <linux/clocksource.h>
#include <linux/kallsyms.h>
@@ -5075,10 +5076,10 @@ void ftrace_module_init(struct module *mod)
}
#endif /* CONFIG_MODULES */

+DECLARE_EXTARRAY(unsigned long, mcount_loc);
+
void __init ftrace_init(void)
{
- extern unsigned long __start_mcount_loc[];
- extern unsigned long __stop_mcount_loc[];
unsigned long count, flags;
int ret;

@@ -5088,7 +5089,7 @@ void __init ftrace_init(void)
if (ret)
goto failed;

- count = __stop_mcount_loc - __start_mcount_loc;
+ count = ext_size(mcount_loc);
if (!count) {
pr_info("ftrace: No functions to be traced?\n");
goto failed;
@@ -5100,8 +5101,8 @@ void __init ftrace_init(void)
last_ftrace_enabled = ftrace_enabled = 1;

ret = ftrace_process_locs(NULL,
- __start_mcount_loc,
- __stop_mcount_loc);
+ ext_start(mcount_loc),
+ ext_end(mcount_loc));

set_ftrace_early_filters();

--
2.10.0.479.g221bd91