diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-03-17 06:31:45 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-03-17 06:31:48 -0400 |
commit | e4713e93b125497e9ba44d93de1bd9d8e5ad8946 (patch) | |
tree | c57f865a10fc1b2419f83bcbbe4a46ee711a60a3 /tools/perf/builtin-top.c | |
parent | 984763cb90d4b5444baa0c3e43feff7926bf1834 (diff) | |
parent | a6b84574eed7e4fd8cb8dac2d0926fe2cf34b941 (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.c | 13 |
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) | |||
464 | struct sym_entry *syme, *n; | 464 | struct sym_entry *syme, *n; |
465 | struct rb_root tmp = RB_ROOT; | 465 | struct rb_root tmp = RB_ROOT; |
466 | struct rb_node *nd; | 466 | struct rb_node *nd; |
467 | int sym_width = 0, dso_width = 0, max_dso_width; | 467 | int sym_width = 0, dso_width = 0, dso_short_width = 0; |
468 | const int win_width = winsize.ws_col - 1; | 468 | const int win_width = winsize.ws_col - 1; |
469 | 469 | ||
470 | samples = userspace_samples = exact_samples = 0; | 470 | samples = userspace_samples = exact_samples = 0; |
@@ -555,15 +555,20 @@ static void print_sym_table(void) | |||
555 | if (syme->map->dso->long_name_len > dso_width) | 555 | if (syme->map->dso->long_name_len > dso_width) |
556 | dso_width = syme->map->dso->long_name_len; | 556 | dso_width = syme->map->dso->long_name_len; |
557 | 557 | ||
558 | if (syme->map->dso->short_name_len > dso_short_width) | ||
559 | dso_short_width = syme->map->dso->short_name_len; | ||
560 | |||
558 | if (syme->name_len > sym_width) | 561 | if (syme->name_len > sym_width) |
559 | sym_width = syme->name_len; | 562 | sym_width = syme->name_len; |
560 | } | 563 | } |
561 | 564 | ||
562 | printed = 0; | 565 | printed = 0; |
563 | 566 | ||
564 | max_dso_width = winsize.ws_col - sym_width - 29; | 567 | if (sym_width + dso_width > winsize.ws_col - 29) { |
565 | if (dso_width > max_dso_width) | 568 | dso_width = dso_short_width; |
566 | dso_width = max_dso_width; | 569 | if (sym_width + dso_width > winsize.ws_col - 29) |
570 | sym_width = winsize.ws_col - dso_width - 29; | ||
571 | } | ||
567 | putchar('\n'); | 572 | putchar('\n'); |
568 | if (nr_counters == 1) | 573 | if (nr_counters == 1) |
569 | printf(" samples pcnt"); | 574 | printf(" samples pcnt"); |