aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index e8c98179fe45..c9dbe3315497 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -947,25 +947,10 @@ hist_entry__fprintf(FILE *fp, struct hist_entry *self, u64 total_samples)
947 if (exclude_other && !self->parent) 947 if (exclude_other && !self->parent)
948 return 0; 948 return 0;
949 949
950 if (total_samples) { 950 if (total_samples)
951 double percent = self->count * 100.0 / total_samples; 951 ret = percent_color_fprintf(fp, " %6.2f%%",
952 char *color = PERF_COLOR_NORMAL;
953
954 /*
955 * We color high-overhead entries in red, mid-overhead
956 * entries in green - and keep the low overhead places
957 * normal:
958 */
959 if (percent >= 5.0) {
960 color = PERF_COLOR_RED;
961 } else {
962 if (percent >= 0.5)
963 color = PERF_COLOR_GREEN;
964 }
965
966 ret = color_fprintf(fp, color, " %6.2f%%",
967 (self->count * 100.0) / total_samples); 952 (self->count * 100.0) / total_samples);
968 } else 953 else
969 ret = fprintf(fp, "%12Ld ", self->count); 954 ret = fprintf(fp, "%12Ld ", self->count);
970 955
971 list_for_each_entry(se, &hist_entry__sort_list, list) { 956 list_for_each_entry(se, &hist_entry__sort_list, list) {