aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/hist.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2012-10-05 10:44:47 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-10-05 13:15:19 -0400
commit6e92349d5a814a3f633a43d9d6bd3b199ef3ad72 (patch)
tree382e1d5484253229c13e4b5dae44fc50888ff07f /tools/perf/ui/hist.c
parentd88c48f9b5bfcbd2e296b2d240e8cb0aec99f042 (diff)
perf diff: Display empty space for non paired samples
Currently in 'Baseline' and 'Period Base' columns zero values are displayed in case no pair is found for the sample. This might be confusing, using empty space instead. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1349448287-18919-9-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/hist.c')
-rw-r--r--tools/perf/ui/hist.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index 305eb79f4af4..4f5f4756faac 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -179,7 +179,10 @@ static int hpp__color_baseline(struct perf_hpp *hpp, struct hist_entry *he)
179{ 179{
180 double percent = baseline_percent(he); 180 double percent = baseline_percent(he);
181 181
182 return percent_color_snprintf(hpp->buf, hpp->size, " %6.2f%%", percent); 182 if (he->pair)
183 return percent_color_snprintf(hpp->buf, hpp->size, " %6.2f%%", percent);
184 else
185 return scnprintf(hpp->buf, hpp->size, " ");
183} 186}
184 187
185static int hpp__entry_baseline(struct perf_hpp *hpp, struct hist_entry *he) 188static 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)
187 double percent = baseline_percent(he); 190 double percent = baseline_percent(he);
188 const char *fmt = symbol_conf.field_sep ? "%.2f" : " %6.2f%%"; 191 const char *fmt = symbol_conf.field_sep ? "%.2f" : " %6.2f%%";
189 192
190 return scnprintf(hpp->buf, hpp->size, fmt, percent); 193 if (he->pair || symbol_conf.field_sep)
194 return scnprintf(hpp->buf, hpp->size, fmt, percent);
195 else
196 return scnprintf(hpp->buf, hpp->size, " ");
191} 197}
192 198
193static int hpp__header_samples(struct perf_hpp *hpp) 199static int hpp__header_samples(struct perf_hpp *hpp)