Commit c867ccd8 authored by Jiri Slaby's avatar Jiri Slaby Committed by Steven Rostedt

ftrace: Inline the code from ftrace_dyn_table_alloc()

The function used to do allocations some time ago. This no longer
happens and it only checks the count and prints some info. This patch
inlines the body to the only caller. There are two reasons:
* the name of the function was misleading
* it's clear what is going on in ftrace_init now

Link: http://lkml.kernel.org/r/1393268401-24379-2-git-send-email-jslaby@suse.czSigned-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 1dc43cf0
...@@ -2465,22 +2465,6 @@ ftrace_allocate_pages(unsigned long num_to_init) ...@@ -2465,22 +2465,6 @@ ftrace_allocate_pages(unsigned long num_to_init)
return NULL; return NULL;
} }
static int __init ftrace_dyn_table_alloc(unsigned long num_to_init)
{
int cnt;
if (!num_to_init) {
pr_info("ftrace: No functions to be traced?\n");
return -1;
}
cnt = num_to_init / ENTRIES_PER_PAGE;
pr_info("ftrace: allocating %ld entries in %d pages\n",
num_to_init, cnt + 1);
return 0;
}
#define FTRACE_BUFF_MAX (KSYM_SYMBOL_LEN+4) /* room for wildcards */ #define FTRACE_BUFF_MAX (KSYM_SYMBOL_LEN+4) /* room for wildcards */
struct ftrace_iterator { struct ftrace_iterator {
...@@ -4403,10 +4387,13 @@ void __init ftrace_init(void) ...@@ -4403,10 +4387,13 @@ void __init ftrace_init(void)
goto failed; goto failed;
count = __stop_mcount_loc - __start_mcount_loc; count = __stop_mcount_loc - __start_mcount_loc;
if (!count) {
ret = ftrace_dyn_table_alloc(count); pr_info("ftrace: No functions to be traced?\n");
if (ret)
goto failed; goto failed;
}
pr_info("ftrace: allocating %ld entries in %ld pages\n",
count, count / ENTRIES_PER_PAGE + 1);
last_ftrace_enabled = ftrace_enabled = 1; last_ftrace_enabled = ftrace_enabled = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment