summaryrefslogtreecommitdiff
path: root/tools/perf/builtin-top.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2010-03-17 11:31:45 +0100
committerIngo Molnar <mingo@elte.hu>2010-03-17 11:31:48 +0100
commite4713e93b125497e9ba44d93de1bd9d8e5ad8946 (patch)
treec57f865a10fc1b2419f83bcbbe4a46ee711a60a3 /tools/perf/builtin-top.c
parent984763cb90d4b5444baa0c3e43feff7926bf1834 (diff)
parenta6b84574eed7e4fd8cb8dac2d0926fe2cf34b941 (diff)
Merge branch 'perf/urgent' into perf/core
Merge reason: We'll be queueing dependent changes. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r--tools/perf/builtin-top.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index c968bd3391e0..887ebbf5d1ff 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -464,7 +464,7 @@ static void print_sym_table(void)
struct sym_entry *syme, *n;
struct rb_root tmp = RB_ROOT;
struct rb_node *nd;
- int sym_width = 0, dso_width = 0, max_dso_width;
+ int sym_width = 0, dso_width = 0, dso_short_width = 0;
const int win_width = winsize.ws_col - 1;
samples = userspace_samples = exact_samples = 0;
@@ -555,15 +555,20 @@ static void print_sym_table(void)
if (syme->map->dso->long_name_len > dso_width)
dso_width = syme->map->dso->long_name_len;
+ if (syme->map->dso->short_name_len > dso_short_width)
+ dso_short_width = syme->map->dso->short_name_len;
+
if (syme->name_len > sym_width)
sym_width = syme->name_len;
}
printed = 0;
- max_dso_width = winsize.ws_col - sym_width - 29;
- if (dso_width > max_dso_width)
- dso_width = max_dso_width;
+ if (sym_width + dso_width > winsize.ws_col - 29) {
+ dso_width = dso_short_width;
+ if (sym_width + dso_width > winsize.ws_col - 29)
+ sym_width = winsize.ws_col - dso_width - 29;
+ }
putchar('\n');
if (nr_counters == 1)
printf(" samples pcnt");