diff options
| -rw-r--r-- | kernel/trace/ftrace.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 3f95bbeb8e8d..76b6ed29d856 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
| @@ -2465,22 +2465,6 @@ ftrace_allocate_pages(unsigned long num_to_init) | |||
| 2465 | return NULL; | 2465 | return NULL; |
| 2466 | } | 2466 | } |
| 2467 | 2467 | ||
| 2468 | static int __init ftrace_dyn_table_alloc(unsigned long num_to_init) | ||
| 2469 | { | ||
| 2470 | int cnt; | ||
| 2471 | |||
| 2472 | if (!num_to_init) { | ||
| 2473 | pr_info("ftrace: No functions to be traced?\n"); | ||
| 2474 | return -1; | ||
| 2475 | } | ||
| 2476 | |||
| 2477 | cnt = num_to_init / ENTRIES_PER_PAGE; | ||
| 2478 | pr_info("ftrace: allocating %ld entries in %d pages\n", | ||
| 2479 | num_to_init, cnt + 1); | ||
| 2480 | |||
| 2481 | return 0; | ||
| 2482 | } | ||
| 2483 | |||
| 2484 | #define FTRACE_BUFF_MAX (KSYM_SYMBOL_LEN+4) /* room for wildcards */ | 2468 | #define FTRACE_BUFF_MAX (KSYM_SYMBOL_LEN+4) /* room for wildcards */ |
| 2485 | 2469 | ||
| 2486 | struct ftrace_iterator { | 2470 | struct ftrace_iterator { |
| @@ -4403,10 +4387,13 @@ void __init ftrace_init(void) | |||
| 4403 | goto failed; | 4387 | goto failed; |
| 4404 | 4388 | ||
| 4405 | count = __stop_mcount_loc - __start_mcount_loc; | 4389 | count = __stop_mcount_loc - __start_mcount_loc; |
| 4406 | 4390 | if (!count) { | |
| 4407 | ret = ftrace_dyn_table_alloc(count); | 4391 | pr_info("ftrace: No functions to be traced?\n"); |
| 4408 | if (ret) | ||
| 4409 | goto failed; | 4392 | goto failed; |
| 4393 | } | ||
| 4394 | |||
| 4395 | pr_info("ftrace: allocating %ld entries in %ld pages\n", | ||
| 4396 | count, count / ENTRIES_PER_PAGE + 1); | ||
| 4410 | 4397 | ||
| 4411 | last_ftrace_enabled = ftrace_enabled = 1; | 4398 | last_ftrace_enabled = ftrace_enabled = 1; |
| 4412 | 4399 | ||
