aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/hist.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2012-12-01 15:18:20 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-07-12 12:54:04 -0400
commite0af43d2486fc50208076cfd93af55615fd4adfd (patch)
tree982fda9b29e2f8cacb5f3e7b3dfba1327a3e6669 /tools/perf/ui/hist.c
parent9af303e22a317d1cc6f440e08f72428830708b37 (diff)
perf hists: Marking dummy hists entries
It does not make sense to make some computation (ratio, wdiff), when the hist_entry is 'dummy' - added via hists__link. Adding dummy field to struct hist_entry which indicates that it was added by hists__link and avoiding some of the processing for such entries. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Reviewed-by: Namhyung Kim <namhyung@kernel.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> 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/n/tip-g8bxml0n0pnqsrpyd98p0ird@git.kernel.org 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.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index 02313a9c4682..a359b75ce800 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -187,8 +187,11 @@ static int hpp__color_baseline(struct perf_hpp_fmt *fmt __maybe_unused,
187{ 187{
188 double percent = baseline_percent(he); 188 double percent = baseline_percent(he);
189 189
190 return percent_color_snprintf(hpp->buf, hpp->size, " %6.2f%%", 190 if (!he->dummy)
191 percent); 191 return percent_color_snprintf(hpp->buf, hpp->size,
192 " %6.2f%%", percent);
193 else
194 return scnprintf(hpp->buf, hpp->size, " ");
192} 195}
193 196
194static int hpp__entry_baseline(struct perf_hpp_fmt *_fmt __maybe_unused, 197static int hpp__entry_baseline(struct perf_hpp_fmt *_fmt __maybe_unused,
@@ -197,7 +200,10 @@ static int hpp__entry_baseline(struct perf_hpp_fmt *_fmt __maybe_unused,
197 double percent = baseline_percent(he); 200 double percent = baseline_percent(he);
198 const char *fmt = symbol_conf.field_sep ? "%.2f" : " %6.2f%%"; 201 const char *fmt = symbol_conf.field_sep ? "%.2f" : " %6.2f%%";
199 202
200 return scnprintf(hpp->buf, hpp->size, fmt, percent); 203 if (!he->dummy)
204 return scnprintf(hpp->buf, hpp->size, fmt, percent);
205 else
206 return scnprintf(hpp->buf, hpp->size, " ");
201} 207}
202 208
203static int hpp__header_period_baseline(struct perf_hpp_fmt *_fmt __maybe_unused, 209static int hpp__header_period_baseline(struct perf_hpp_fmt *_fmt __maybe_unused,
@@ -251,8 +257,7 @@ static int hpp__entry_delta(struct perf_hpp_fmt *_fmt __maybe_unused,
251 diff = he->diff.period_ratio_delta; 257 diff = he->diff.period_ratio_delta;
252 else 258 else
253 diff = perf_diff__compute_delta(he, pair); 259 diff = perf_diff__compute_delta(he, pair);
254 } else 260 }
255 diff = perf_diff__period_percent(he, he->stat.period);
256 261
257 if (fabs(diff) >= 0.01) 262 if (fabs(diff) >= 0.01)
258 scnprintf(buf, sizeof(buf), "%+4.2F%%", diff); 263 scnprintf(buf, sizeof(buf), "%+4.2F%%", diff);
@@ -282,7 +287,8 @@ static int hpp__entry_ratio(struct perf_hpp_fmt *_fmt __maybe_unused,
282 char buf[32] = " "; 287 char buf[32] = " ";
283 double ratio = 0.0; 288 double ratio = 0.0;
284 289
285 if (pair) { 290 /* No point for ratio number if we are dummy.. */
291 if (!he->dummy && pair) {
286 if (he->diff.computed) 292 if (he->diff.computed)
287 ratio = he->diff.period_ratio; 293 ratio = he->diff.period_ratio;
288 else 294 else
@@ -317,7 +323,8 @@ static int hpp__entry_wdiff(struct perf_hpp_fmt *_fmt __maybe_unused,
317 char buf[32] = " "; 323 char buf[32] = " ";
318 s64 wdiff = 0; 324 s64 wdiff = 0;
319 325
320 if (pair) { 326 /* No point for wdiff number if we are dummy.. */
327 if (!he->dummy && pair) {
321 if (he->diff.computed) 328 if (he->diff.computed)
322 wdiff = he->diff.wdiff; 329 wdiff = he->diff.wdiff;
323 else 330 else