Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169645
b: refs/heads/master
c: 1a105f7
h: refs/heads/master
i:
  169643: faef681
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo authored and Ingo Molnar committed Nov 19, 2009
1 parent 5387d5e commit 66bf37c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 13cc5079f235906e60577dbce8da2f9607e67e93
refs/heads/master: 1a105f743d9fa5f7b8eeeca0afb789951164a361
43 changes: 32 additions & 11 deletions trunk/tools/perf/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,9 @@ 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;
int sym_width = 0, dso_width = 0;
const int win_width = winsize.ws_col - 1;
struct dso *unique_dso = NULL, *first_dso = NULL;

samples = userspace_samples = 0;

Expand Down Expand Up @@ -509,7 +510,7 @@ static void print_sym_table(void)
printf(", %d CPUs)\n", nr_cpus);
}

printf("%-*.*s\n\n", win_width, win_width, graph_dotted_line);
printf("%-*.*s\n", win_width, win_width, graph_dotted_line);

if (sym_filter_entry) {
show_details(sym_filter_entry);
Expand All @@ -525,28 +526,47 @@ static void print_sym_table(void)
(int)syme->snap_count < count_filter)
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)
dso_width = syme->map->dso->long_name_len;

if (syme->name_len > sym_width)
sym_width = syme->name_len;
}

printed = 0;

if (unique_dso)
printf("DSO: %s\n", unique_dso->long_name);
else {
int max_dso_width = winsize.ws_col - sym_width - 29;
if (dso_width > max_dso_width)
dso_width = max_dso_width;
putchar('\n');
}
if (nr_counters == 1)
printf(" samples pcnt");
else
printf(" weight samples pcnt");

dso_width = winsize.ws_col - sym_width - 29;

if (verbose)
printf(" RIP ");
printf(" %-*.*s DSO\n", sym_width, sym_width, "function");
printf(" %-*.*s", sym_width, sym_width, "function");
if (!unique_dso)
printf(" DSO");
putchar('\n');
printf(" %s _______ _____",
nr_counters == 1 ? " " : "______");
if (verbose)
printf(" ________________");
printf(" %-*.*s %-*.*s\n\n", sym_width, sym_width, graph_line,
dso_width, dso_width, graph_line);
printf(" %-*.*s", sym_width, sym_width, graph_line);
if (!unique_dso)
printf(" %-*.*s", dso_width, dso_width, graph_line);
puts("\n");

for (nd = rb_first(&tmp); nd; nd = rb_next(nd)) {
struct symbol *sym;
Expand All @@ -570,10 +590,11 @@ static void print_sym_table(void)
if (verbose)
printf(" %016llx", sym->start);
printf(" %-*.*s", sym_width, sym_width, sym->name);
printf(" %-*.*s", dso_width, dso_width,
dso_width >= syme->map->dso->long_name_len ?
syme->map->dso->long_name :
syme->map->dso->short_name);
if (!unique_dso)
printf(" %-*.*s", dso_width, dso_width,
dso_width >= syme->map->dso->long_name_len ?
syme->map->dso->long_name :
syme->map->dso->short_name);
printf("\n");
}
}
Expand Down

0 comments on commit 66bf37c

Please sign in to comment.