diff options
author | Jiri Olsa <jolsa@redhat.com> | 2012-10-04 21:49:37 +0900 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-10-04 13:28:49 -0300 |
commit | 5395a04841fcdd9220177f2c21353fe6d4cd0729 (patch) | |
tree | 5a382c4664dcda284c3aa963eca28148b419cb41 /tools/perf/ui/stdio | |
parent | dd464345f330c1103f93daad309e8b44845e96cf (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.c | 11 |
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, .size = sizeof(bf), .ptr = pair, }; + bool first = true; init_rem_hits(); @@ -364,8 +365,10 @@ size_t hists__fprintf(struct hists *hists, struct hists *pair, if (!perf_hpp__format[idx].cond) continue; - if (idx) + if (!first) fprintf(fp, "%s", sep ?: " "); + else + first = false; perf_hpp__format[idx].header(&dummy_hpp); fprintf(fp, "%s", bf); @@ -400,6 +403,8 @@ size_t hists__fprintf(struct hists *hists, struct hists *pair, if (sep) goto print_entries; + first = true; + fprintf(fp, "# "); for (idx = 0; idx < PERF_HPP__MAX_INDEX; idx++) { unsigned int i; @@ -407,8 +412,10 @@ size_t hists__fprintf(struct hists *hists, struct hists *pair, if (!perf_hpp__format[idx].cond) continue; - if (idx) + if (!first) fprintf(fp, "%s", sep ?: " "); + else + first = false; width = perf_hpp__format[idx].width(&dummy_hpp); for (i = 0; i < width; i++) |