Skip to contentSkip to conversation

perf annotate: Fix --stdio rendering

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Feb 9, 2011 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  e3087b80aa0bceda9863f33307460f3ba79f2b15
Gitweb:     http://git.kernel.org/tip/e3087b80aa0bceda9863f33307460f3ba79f2b15
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Tue, 8 Feb 2011 15:01:39 -0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Tue, 8 Feb 2011 15:01:39 -0200

perf annotate: Fix --stdio rendering

The checks for not using a max_lines parameter were b0rked, problem introduced in 3653246.

Cc: Frederic Weisbecker <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Tom Zanussi <[email protected]>
LKML-Reference: <new-submission>

---
 tools/perf/util/annotate.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/util/annotate.c +2 -2
index 1012841..6db4351 100644
@@ -132,7 +132,7 @@ static int objdump_line__print(struct objdump_line *oline,
 		if (percent < min_pcnt)
 			return -1;
 
-		if (printed >= max_lines)
+		if (max_lines && printed >= max_lines)
 			return 1;
 
 		color = get_percent_color(percent);
@@ -154,7 +154,7 @@ static int objdump_line__print(struct objdump_line *oline,
 		color_fprintf(stdout, color, " %7.2f", percent);
 		printf(" :	");
 		color_fprintf(stdout, PERF_COLOR_BLUE, "%s\n", oline->line);
-	} else if (printed >= max_lines)
+	} else if (max_lines && printed >= max_lines)
 		return 1;
 	else {
 		if (!*oline->line)