Commit 7cc017ed authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by Ingo Molnar

perf top: Always show the DSO column, even if its all the same

Ingo found it confusing, and I agree with that, for 'perf
report' its OK because it is static, but for a tool refreshing
it the eventual switch from column to summary at the top may
seem confusing.
Suggested-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1259071517-3242-1-git-send-email-acme@infradead.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent e74328d3
...@@ -451,9 +451,8 @@ static void print_sym_table(void) ...@@ -451,9 +451,8 @@ static void print_sym_table(void)
struct sym_entry *syme, *n; struct sym_entry *syme, *n;
struct rb_root tmp = RB_ROOT; struct rb_root tmp = RB_ROOT;
struct rb_node *nd; struct rb_node *nd;
int sym_width = 0, dso_width = 0; int sym_width = 0, dso_width = 0, max_dso_width;
const int win_width = winsize.ws_col - 1; const int win_width = winsize.ws_col - 1;
struct dso *unique_dso = NULL, *first_dso = NULL;
samples = userspace_samples = 0; samples = userspace_samples = 0;
...@@ -539,11 +538,6 @@ static void print_sym_table(void) ...@@ -539,11 +538,6 @@ static void print_sym_table(void)
(int)syme->snap_count < count_filter) (int)syme->snap_count < count_filter)
continue; continue;
if (first_dso == NULL)
unique_dso = first_dso = syme->map->dso;
else if (syme->map->dso != first_dso)
unique_dso = NULL;
if (syme->map->dso->long_name_len > dso_width) if (syme->map->dso->long_name_len > dso_width)
dso_width = syme->map->dso->long_name_len; dso_width = syme->map->dso->long_name_len;
...@@ -553,14 +547,10 @@ static void print_sym_table(void) ...@@ -553,14 +547,10 @@ static void print_sym_table(void)
printed = 0; printed = 0;
if (unique_dso) max_dso_width = winsize.ws_col - sym_width - 29;
printf("DSO: %s\n", unique_dso->long_name); if (dso_width > max_dso_width)
else { dso_width = max_dso_width;
int max_dso_width = winsize.ws_col - sym_width - 29; putchar('\n');
if (dso_width > max_dso_width)
dso_width = max_dso_width;
putchar('\n');
}
if (nr_counters == 1) if (nr_counters == 1)
printf(" samples pcnt"); printf(" samples pcnt");
else else
...@@ -568,17 +558,13 @@ static void print_sym_table(void) ...@@ -568,17 +558,13 @@ static void print_sym_table(void)
if (verbose) if (verbose)
printf(" RIP "); printf(" RIP ");
printf(" %-*.*s", sym_width, sym_width, "function"); printf(" %-*.*s DSO\n", sym_width, sym_width, "function");
if (!unique_dso)
printf(" DSO");
putchar('\n');
printf(" %s _______ _____", printf(" %s _______ _____",
nr_counters == 1 ? " " : "______"); nr_counters == 1 ? " " : "______");
if (verbose) if (verbose)
printf(" ________________"); printf(" ________________");
printf(" %-*.*s", sym_width, sym_width, graph_line); printf(" %-*.*s", sym_width, sym_width, graph_line);
if (!unique_dso) printf(" %-*.*s", dso_width, dso_width, graph_line);
printf(" %-*.*s", dso_width, dso_width, graph_line);
puts("\n"); puts("\n");
for (nd = rb_first(&tmp); nd; nd = rb_next(nd)) { for (nd = rb_first(&tmp); nd; nd = rb_next(nd)) {
...@@ -603,12 +589,10 @@ static void print_sym_table(void) ...@@ -603,12 +589,10 @@ static void print_sym_table(void)
if (verbose) if (verbose)
printf(" %016llx", sym->start); printf(" %016llx", sym->start);
printf(" %-*.*s", sym_width, sym_width, sym->name); printf(" %-*.*s", sym_width, sym_width, sym->name);
if (!unique_dso) printf(" %-*.*s\n", dso_width, dso_width,
printf(" %-*.*s", dso_width, dso_width, dso_width >= syme->map->dso->long_name_len ?
dso_width >= syme->map->dso->long_name_len ? syme->map->dso->long_name :
syme->map->dso->long_name : syme->map->dso->short_name);
syme->map->dso->short_name);
printf("\n");
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment