diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 71a52c172140fd8a2f9fa43000cd9ac0412986e9..f3716bf04df648418b5f8dc246d54c958097baaf 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -291,7 +291,9 @@ function_stat_next(void *v, int idx) pg = (struct ftrace_profile_page *)((unsigned long)rec & PAGE_MASK); again: - rec++; + if (idx != 0) + rec++; + if ((void *)rec >= (void *)&pg->records[pg->index]) { pg = pg->next; if (!pg)