perf sort: Make column width code per hists instance
They were globals, and since we support multiple hists and sessions
at the same time, it doesn't make sense to calculate those values
considereing all symbols in all sessions.
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
diff --git a/tools/perf/util/newt.c b/tools/perf/util/newt.c
index 7979003..ab6eb36 100644
--- a/tools/perf/util/newt.c
+++ b/tools/perf/util/newt.c
@@ -692,7 +692,8 @@
}
static size_t hist_entry__append_browser(struct hist_entry *self,
- newtComponent tree, u64 total)
+ newtComponent tree,
+ struct hists *hists)
{
char s[256];
size_t ret;
@@ -700,8 +701,8 @@
if (symbol_conf.exclude_other && !self->parent)
return 0;
- ret = hist_entry__snprintf(self, s, sizeof(s), NULL,
- false, 0, false, total);
+ ret = hist_entry__snprintf(self, s, sizeof(s), hists, NULL,
+ false, 0, false, hists->stats.total_period);
if (symbol_conf.use_callchain) {
int indexes[2];
@@ -842,7 +843,7 @@
if (h->filtered)
continue;
- len = hist_entry__append_browser(h, self->tree, hists->stats.total_period);
+ len = hist_entry__append_browser(h, self->tree, hists);
if (len > max_len)
max_len = len;
if (symbol_conf.use_callchain)