aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-top.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r--tools/perf/builtin-top.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 9e0d2645ae13..c6ccda52117d 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -99,6 +99,7 @@ static void perf_top__resize(struct perf_top *top)
99 99
100static int perf_top__parse_source(struct perf_top *top, struct hist_entry *he) 100static int perf_top__parse_source(struct perf_top *top, struct hist_entry *he)
101{ 101{
102 struct perf_evsel *evsel = hists_to_evsel(he->hists);
102 struct symbol *sym; 103 struct symbol *sym;
103 struct annotation *notes; 104 struct annotation *notes;
104 struct map *map; 105 struct map *map;
@@ -137,7 +138,7 @@ static int perf_top__parse_source(struct perf_top *top, struct hist_entry *he)
137 return err; 138 return err;
138 } 139 }
139 140
140 err = symbol__disassemble(sym, map, NULL, 0, NULL, NULL); 141 err = symbol__annotate(sym, map, evsel, 0, NULL);
141 if (err == 0) { 142 if (err == 0) {
142out_assign: 143out_assign:
143 top->sym_filter_entry = he; 144 top->sym_filter_entry = he;
@@ -229,6 +230,7 @@ static void perf_top__record_precise_ip(struct perf_top *top,
229static void perf_top__show_details(struct perf_top *top) 230static void perf_top__show_details(struct perf_top *top)
230{ 231{
231 struct hist_entry *he = top->sym_filter_entry; 232 struct hist_entry *he = top->sym_filter_entry;
233 struct perf_evsel *evsel = hists_to_evsel(he->hists);
232 struct annotation *notes; 234 struct annotation *notes;
233 struct symbol *symbol; 235 struct symbol *symbol;
234 int more; 236 int more;
@@ -241,6 +243,8 @@ static void perf_top__show_details(struct perf_top *top)
241 243
242 pthread_mutex_lock(&notes->lock); 244 pthread_mutex_lock(&notes->lock);
243 245
246 symbol__calc_percent(symbol, evsel);
247
244 if (notes->src == NULL) 248 if (notes->src == NULL)
245 goto out_unlock; 249 goto out_unlock;
246 250
@@ -412,7 +416,7 @@ static void perf_top__print_mapped_keys(struct perf_top *top)
412 fprintf(stdout, "\t[S] stop annotation.\n"); 416 fprintf(stdout, "\t[S] stop annotation.\n");
413 417
414 fprintf(stdout, 418 fprintf(stdout,
415 "\t[K] hide kernel_symbols symbols. \t(%s)\n", 419 "\t[K] hide kernel symbols. \t(%s)\n",
416 top->hide_kernel_symbols ? "yes" : "no"); 420 top->hide_kernel_symbols ? "yes" : "no");
417 fprintf(stdout, 421 fprintf(stdout,
418 "\t[U] hide user symbols. \t(%s)\n", 422 "\t[U] hide user symbols. \t(%s)\n",
@@ -903,7 +907,7 @@ try_again:
903 } 907 }
904 } 908 }
905 909
906 if (perf_evlist__mmap(evlist, opts->mmap_pages, false) < 0) { 910 if (perf_evlist__mmap(evlist, opts->mmap_pages) < 0) {
907 ui__error("Failed to mmap with %d (%s)\n", 911 ui__error("Failed to mmap with %d (%s)\n",
908 errno, str_error_r(errno, msg, sizeof(msg))); 912 errno, str_error_r(errno, msg, sizeof(msg)));
909 goto out_err; 913 goto out_err;