From aefcf37b82886260d8540c9fb815e613c8977e06 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Mon, 8 Jun 2009 23:15:28 +0200 Subject: perf_counter tools: Standardize color printing The rule is: - high overhead: red - mid overhead: green - low overhead: normal (white/black) Cc: Peter Zijlstra Cc: Mike Galbraith Cc: Paul Mackerras Cc: Arnaldo Carvalho de Melo LKML-Reference: Signed-off-by: Ingo Molnar --- tools/perf/builtin-top.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'tools/perf/builtin-top.c') diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index be1698f1189..8ba24808a39 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -248,13 +248,16 @@ static void print_sym_table(void) sum_ksamples)); /* - * We color high-overhead entries in red, low-overhead - * entries in green - and keep the middle ground normal: + * We color high-overhead entries in red, mid-overhead + * entries in green - and keep the low overhead places + * normal: */ - if (pcnt >= 5.0) + if (pcnt >= 5.0) { color = PERF_COLOR_RED; - if (pcnt < 0.5) - color = PERF_COLOR_GREEN; + } else { + if (pcnt >= 0.5) + color = PERF_COLOR_GREEN; + } if (nr_counters == 1) printf("%20.2f - ", syme->weight); -- cgit v1.2.3