diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/ftrace.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 3718d55fb4c3..cde74b9973b7 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -2500,32 +2500,31 @@ int ftrace_graph_count; | |||
2500 | unsigned long ftrace_graph_funcs[FTRACE_GRAPH_MAX_FUNCS] __read_mostly; | 2500 | unsigned long ftrace_graph_funcs[FTRACE_GRAPH_MAX_FUNCS] __read_mostly; |
2501 | 2501 | ||
2502 | static void * | 2502 | static void * |
2503 | g_next(struct seq_file *m, void *v, loff_t *pos) | 2503 | __g_next(struct seq_file *m, loff_t *pos) |
2504 | { | 2504 | { |
2505 | unsigned long *array = m->private; | 2505 | unsigned long *array = m->private; |
2506 | int index = *pos; | ||
2507 | |||
2508 | (*pos)++; | ||
2509 | 2506 | ||
2510 | if (index >= ftrace_graph_count) | 2507 | if (*pos >= ftrace_graph_count) |
2511 | return NULL; | 2508 | return NULL; |
2509 | return &array[*pos]; | ||
2510 | } | ||
2512 | 2511 | ||
2513 | return &array[index]; | 2512 | static void * |
2513 | g_next(struct seq_file *m, void *v, loff_t *pos) | ||
2514 | { | ||
2515 | (*pos)++; | ||
2516 | return __g_next(m, pos); | ||
2514 | } | 2517 | } |
2515 | 2518 | ||
2516 | static void *g_start(struct seq_file *m, loff_t *pos) | 2519 | static void *g_start(struct seq_file *m, loff_t *pos) |
2517 | { | 2520 | { |
2518 | void *p = NULL; | ||
2519 | |||
2520 | mutex_lock(&graph_lock); | 2521 | mutex_lock(&graph_lock); |
2521 | 2522 | ||
2522 | /* Nothing, tell g_show to print all functions are enabled */ | 2523 | /* Nothing, tell g_show to print all functions are enabled */ |
2523 | if (!ftrace_graph_count && !*pos) | 2524 | if (!ftrace_graph_count && !*pos) |
2524 | return (void *)1; | 2525 | return (void *)1; |
2525 | 2526 | ||
2526 | p = g_next(m, p, pos); | 2527 | return __g_next(m, pos); |
2527 | |||
2528 | return p; | ||
2529 | } | 2528 | } |
2530 | 2529 | ||
2531 | static void g_stop(struct seq_file *m, void *p) | 2530 | static void g_stop(struct seq_file *m, void *p) |