Skip to contentSkip to conversation

ftrace: fix the output of profile

PATCH In review Li Zefan 1 participant 2 messages Jun 26, 2009

Subsystems (2)
lore
Share & tools
lore

Li Zefan

author
#0 lore raw

PATCH 1/1 ftrace: fix the output of profile

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

---
 kernel/trace/ftrace.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
kernel/trace/ftrace.c +3 -1
index 5771cc1..673fc8b 100644
@@ -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)
Signature · 1 line
1.5.4.rc3
#1 lore raw

[tip:tracing/urgent] ftrace: Fix the output of profile

Commit-ID:  0296e4254f3318e0dcad9706fa1daf8e5addc1e9
Gitweb:     http://git.kernel.org/tip/0296e4254f3318e0dcad9706fa1daf8e5addc1e9
Author:     Li Zefan <[email protected]>
AuthorDate: Fri, 26 Jun 2009 11:15:37 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Fri, 26 Jun 2009 09:25:42 +0200

ftrace: Fix the output of profile

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

Cc Steven Rostedt <[email protected]>
Cc Frederic Weisbecker <[email protected]>

LKML-Reference: <[email protected]>

---
 kernel/trace/ftrace.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
kernel/trace/ftrace.c +3 -1
index 71a52c1..f3716bf 100644
@@ -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)