diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2009-07-02 14:14:35 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-07-02 15:38:38 -0400 |
commit | 24b57c6988c5791628c89a8838910991abc9cc1e (patch) | |
tree | 53e75c5bd9355f2f2fc8a3591158f452a24dfe30 /tools/perf | |
parent | 1e11fd82d247e4e48a1d6c49402214434538d3fd (diff) |
perf_counter tools: Display percents of hits in callchain with overhead colors
This adds the use of colors to signal at a glance the important
overhead thresholds in callchains hit rates.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Anton Blanchard <anton@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <1246558475-10624-3-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/builtin-report.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index c9dbe331549..283773d91aa 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -824,7 +824,7 @@ ipchain__fprintf_graph(FILE *fp, struct callchain_list *chain, int depth, | |||
824 | double percent; | 824 | double percent; |
825 | 825 | ||
826 | percent = hits * 100.0 / total_samples; | 826 | percent = hits * 100.0 / total_samples; |
827 | ret += fprintf(fp, "--%2.2f%%-- ", percent); | 827 | ret += percent_color_fprintf(fp, "--%2.2f%%-- ", percent); |
828 | } else | 828 | } else |
829 | ret += fprintf(fp, "%s", " "); | 829 | ret += fprintf(fp, "%s", " "); |
830 | } | 830 | } |
@@ -924,7 +924,8 @@ hist_entry_callchain__fprintf(FILE *fp, struct hist_entry *self, | |||
924 | chain = rb_entry(rb_node, struct callchain_node, rb_node); | 924 | chain = rb_entry(rb_node, struct callchain_node, rb_node); |
925 | percent = chain->hit * 100.0 / total_samples; | 925 | percent = chain->hit * 100.0 / total_samples; |
926 | if (callchain_mode == FLAT) { | 926 | if (callchain_mode == FLAT) { |
927 | ret += fprintf(fp, " %6.2f%%\n", percent); | 927 | ret += percent_color_fprintf(fp, " %6.2f%%\n", |
928 | percent); | ||
928 | ret += callchain__fprintf_flat(fp, chain, total_samples); | 929 | ret += callchain__fprintf_flat(fp, chain, total_samples); |
929 | } else if (callchain_mode == GRAPH) { | 930 | } else if (callchain_mode == GRAPH) { |
930 | ret += callchain__fprintf_graph(fp, chain, | 931 | ret += callchain__fprintf_graph(fp, chain, |