diff options
author | Jiri Olsa <jolsa@kernel.org> | 2016-01-18 12:24:07 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-02-03 18:24:07 +0300 |
commit | 1945c3e734cd1f01535dc76de47c38bbe9a87352 (patch) | |
tree | d6c2de181e6215f219045e81b16ca65e3fb37b2e /tools/perf/ui/hist.c | |
parent | 3ee60c3b18bd4bf30ea9b70e7542116bb5c205ba (diff) | |
download | linux-1945c3e734cd1f01535dc76de47c38bbe9a87352.tar.xz |
perf hists: Allocate output sort field
Currently we use static output fields, because we have single global
list of all sort/output fields.
We will add hists specific sort and output lists in following patches,
so we need all format entries to be dynamically allocated. Adding
support to allocate output sort field.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1453109064-1026-10-git-send-email-jolsa@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.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c index b0fcaecb7d1d..c877c52ff4bc 100644 --- a/tools/perf/ui/hist.c +++ b/tools/perf/ui/hist.c @@ -533,11 +533,23 @@ void perf_hpp__column_disable(unsigned col) void perf_hpp__cancel_cumulate(void) { + struct perf_hpp_fmt *fmt, *acc, *ovh, *tmp; + if (is_strict_order(field_order)) return; - perf_hpp__column_disable(PERF_HPP__OVERHEAD_ACC); - perf_hpp__format[PERF_HPP__OVERHEAD].name = "Overhead"; + ovh = &perf_hpp__format[PERF_HPP__OVERHEAD]; + acc = &perf_hpp__format[PERF_HPP__OVERHEAD_ACC]; + + perf_hpp__for_each_format_safe(fmt, tmp) { + if (acc->equal(acc, fmt)) { + perf_hpp__column_unregister(fmt); + continue; + } + + if (ovh->equal(ovh, fmt)) + fmt->name = "Overhead"; + } } static bool fmt_equal(struct perf_hpp_fmt *a, struct perf_hpp_fmt *b) |