Commit 0296e4254f3318e0dcad9706fa1daf8e5addc1e9

Authored by Li Zefan
Committed by Ingo Molnar
1 parent 1155de47cd

ftrace: Fix the output of profile

The first entry of the ftrace profile was always skipped when
reading trace_stat/functionX.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <4A443D59.4080307@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff

kernel/trace/ftrace.c
... ... @@ -291,7 +291,9 @@
291 291 pg = (struct ftrace_profile_page *)((unsigned long)rec & PAGE_MASK);
292 292  
293 293 again:
294   - rec++;
  294 + if (idx != 0)
  295 + rec++;
  296 +
295 297 if ((void *)rec >= (void *)&pg->records[pg->index]) {
296 298 pg = pg->next;
297 299 if (!pg)