From 894accf569f16e10d9aa013a0f42d689df0c1dac Mon Sep 17 00:00:00 2001 From: Jiri Olsa Date: Fri, 5 Oct 2012 16:44:47 +0200 Subject: [PATCH] --- yaml --- r: 338860 b: refs/heads/master c: 6e92349d5a814a3f633a43d9d6bd3b199ef3ad72 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/tools/perf/ui/hist.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 91ee1b6e8a3a..25020662bf74 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d88c48f9b5bfcbd2e296b2d240e8cb0aec99f042 +refs/heads/master: 6e92349d5a814a3f633a43d9d6bd3b199ef3ad72 diff --git a/trunk/tools/perf/ui/hist.c b/trunk/tools/perf/ui/hist.c index 305eb79f4af4..4f5f4756faac 100644 --- a/trunk/tools/perf/ui/hist.c +++ b/trunk/tools/perf/ui/hist.c @@ -179,7 +179,10 @@ static int hpp__color_baseline(struct perf_hpp *hpp, struct hist_entry *he) { double percent = baseline_percent(he); - return percent_color_snprintf(hpp->buf, hpp->size, " %6.2f%%", percent); + if (he->pair) + return percent_color_snprintf(hpp->buf, hpp->size, " %6.2f%%", percent); + else + return scnprintf(hpp->buf, hpp->size, " "); } static int hpp__entry_baseline(struct perf_hpp *hpp, struct hist_entry *he) @@ -187,7 +190,10 @@ static int hpp__entry_baseline(struct perf_hpp *hpp, struct hist_entry *he) double percent = baseline_percent(he); const char *fmt = symbol_conf.field_sep ? "%.2f" : " %6.2f%%"; - return scnprintf(hpp->buf, hpp->size, fmt, percent); + if (he->pair || symbol_conf.field_sep) + return scnprintf(hpp->buf, hpp->size, fmt, percent); + else + return scnprintf(hpp->buf, hpp->size, " "); } static int hpp__header_samples(struct perf_hpp *hpp)