aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/stdio
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2012-10-04 08:49:37 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-10-04 12:28:49 -0400
commit5395a04841fcdd9220177f2c21353fe6d4cd0729 (patch)
tree5a382c4664dcda284c3aa963eca28148b419cb41 /tools/perf/ui/stdio
parentdd464345f330c1103f93daad309e8b44845e96cf (diff)
perf hists: Separate overhead and baseline columns
Currently the overhead and baseline columns are handled within single function and the distinction is made by 'baseline hists' pointer passed by 'struct perf_hpp::ptr'. Since hists pointer is now part of each hist_entry, it's possible to locate paired hists pointer directly from the passed struct hist_entry pointer. Also separating those 2 columns makes the code more obvious. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Ingo Molnar <mingo@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1349354994-17853-4-git-send-email-namhyung@kernel.org Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/stdio')
-rw-r--r--tools/perf/ui/stdio/hist.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c
index d7405f064e88..0aa6776caba5 100644
--- a/tools/perf/ui/stdio/hist.c
+++ b/tools/perf/ui/stdio/hist.c
@@ -353,6 +353,7 @@ size_t hists__fprintf(struct hists *hists, struct hists *pair,
353 .size = sizeof(bf), 353 .size = sizeof(bf),
354 .ptr = pair, 354 .ptr = pair,
355 }; 355 };
356 bool first = true;
356 357
357 init_rem_hits(); 358 init_rem_hits();
358 359
@@ -364,8 +365,10 @@ size_t hists__fprintf(struct hists *hists, struct hists *pair,
364 if (!perf_hpp__format[idx].cond) 365 if (!perf_hpp__format[idx].cond)
365 continue; 366 continue;
366 367
367 if (idx) 368 if (!first)
368 fprintf(fp, "%s", sep ?: " "); 369 fprintf(fp, "%s", sep ?: " ");
370 else
371 first = false;
369 372
370 perf_hpp__format[idx].header(&dummy_hpp); 373 perf_hpp__format[idx].header(&dummy_hpp);
371 fprintf(fp, "%s", bf); 374 fprintf(fp, "%s", bf);
@@ -400,6 +403,8 @@ size_t hists__fprintf(struct hists *hists, struct hists *pair,
400 if (sep) 403 if (sep)
401 goto print_entries; 404 goto print_entries;
402 405
406 first = true;
407
403 fprintf(fp, "# "); 408 fprintf(fp, "# ");
404 for (idx = 0; idx < PERF_HPP__MAX_INDEX; idx++) { 409 for (idx = 0; idx < PERF_HPP__MAX_INDEX; idx++) {
405 unsigned int i; 410 unsigned int i;
@@ -407,8 +412,10 @@ size_t hists__fprintf(struct hists *hists, struct hists *pair,
407 if (!perf_hpp__format[idx].cond) 412 if (!perf_hpp__format[idx].cond)
408 continue; 413 continue;
409 414
410 if (idx) 415 if (!first)
411 fprintf(fp, "%s", sep ?: " "); 416 fprintf(fp, "%s", sep ?: " ");
417 else
418 first = false;
412 419
413 width = perf_hpp__format[idx].width(&dummy_hpp); 420 width = perf_hpp__format[idx].width(&dummy_hpp);
414 for (i = 0; i < width; i++) 421 for (i = 0; i < width; i++)