diff options
-rw-r--r-- | builtin-top.c | 6 | ||||
-rw-r--r-- | util/annotate.c | 31 | ||||
-rw-r--r-- | util/annotate.h | 7 | ||||
-rw-r--r-- | util/hist.c | 6 |
4 files changed, 46 insertions, 4 deletions
diff --git a/builtin-top.c b/builtin-top.c index c2c2aaa0dd2..ccbe437fd56 100644 --- a/builtin-top.c +++ b/builtin-top.c @@ -193,7 +193,13 @@ static int parse_source(struct sym_entry *syme) return err; } + /* ANDROID_CHANGE_BEGIN */ +#if 0 err = symbol__annotate(sym, syme->map, 0); +#else + err = symbol__annotate(sym, syme->map, 0, false); +#endif + /* ANDROID_CHANGE_END */ if (err == 0) { out_assign: top.sym_filter_entry = syme; diff --git a/util/annotate.c b/util/annotate.c index 77b996719df..787722e605d 100644 --- a/util/annotate.c +++ b/util/annotate.c @@ -256,7 +256,14 @@ static int symbol__parse_objdump_line(struct symbol *sym, struct map *map, return 0; } +/* ANDROID_CHANGE_BEGIN */ +#if 0 int symbol__annotate(struct symbol *sym, struct map *map, size_t privsize) +#else +int symbol__annotate(struct symbol *sym, struct map *map, size_t privsize, + bool print_lines) +#endif +/* ANDROID_CHANGE_END */ { struct dso *dso = map->dso; char *filename = dso__build_id_filename(dso, NULL, 0); @@ -322,7 +329,7 @@ fallback: pr_debug("annotating [%p] %30s : [%p] %30s\n", dso, dso->long_name, sym, sym->name); - /* ANDROID_CHANGE_BEGIN */ + /* ANDROID_CHANGE_BEGIN */ #if 0 snprintf(command, sizeof(command), "objdump --start-address=0x%016" PRIx64 @@ -333,12 +340,13 @@ fallback: #else snprintf(command, sizeof(command), "arm-eabi-objdump --start-address=0x%016" PRIx64 - " --stop-address=0x%016" PRIx64 " -d -C %s|grep -v %s|expand", + " --stop-address=0x%016" PRIx64 " -d%c -C %s|grep -v %s|expand", map__rip_2objdump(map, sym->start), map__rip_2objdump(map, sym->end), + print_lines ? 'S' : ' ', symfs_filename, filename); #endif - /* ANDROID_CHANGE_END */ + /* ANDROID_CHANGE_END */ pr_debug("Executing: %s\n", command); @@ -409,7 +417,14 @@ static int symbol__get_source_line(struct symbol *sym, struct map *map, if (!notes->src->lines) return -1; + /* ANDORID_CHANGE_BEGIN */ +#if 0 start = map->unmap_ip(map, sym->start); +#else + /* Use relative start address */ + start = sym->start; +#endif + /* ANDORID_CHANGE_END */ for (i = 0; i < len; i++) { char *path = NULL; @@ -422,7 +437,8 @@ static int symbol__get_source_line(struct symbol *sym, struct map *map, continue; offset = start + i; - sprintf(cmd, "addr2line -e %s %016" PRIx64, filename, offset); + sprintf(cmd, "arm-eabi-addr2line -e %s%s %016" PRIx64, symbol_conf.symfs, + filename, offset); fp = popen(cmd, "r"); if (!fp) continue; @@ -594,8 +610,15 @@ int symbol__tty_annotate(struct symbol *sym, struct map *map, int evidx, struct rb_root source_line = RB_ROOT; u64 len; + /* ANDROID_CHANGE_BEGIN */ +#if 0 if (symbol__annotate(sym, map, 0) < 0) return -1; +#else + if (symbol__annotate(sym, map, 0, print_lines) < 0) + return -1; +#endif + /* ANDROID_CHANGE_END */ len = sym->end - sym->start; diff --git a/util/annotate.h b/util/annotate.h index 5a979dfd039..319b122cadd 100644 --- a/util/annotate.h +++ b/util/annotate.h @@ -85,7 +85,14 @@ int symbol__inc_addr_samples(struct symbol *sym, struct map *map, int symbol__alloc_hist(struct symbol *sym, int nevents); void symbol__annotate_zero_histograms(struct symbol *sym); +/* ANDROID_CHANGE_BEGIN */ +#if 0 int symbol__annotate(struct symbol *sym, struct map *map, size_t privsize); +#else +int symbol__annotate(struct symbol *sym, struct map *map, size_t privsize, + bool print_lines); +#endif +/* ANDROID_CHANGE_END */ int symbol__annotate_init(struct map *map __used, struct symbol *sym); int symbol__annotate_printf(struct symbol *sym, struct map *map, int evidx, bool full_paths, int min_pcnt, int max_lines, diff --git a/util/hist.c b/util/hist.c index 627a02e03c5..f779fe28574 100644 --- a/util/hist.c +++ b/util/hist.c @@ -969,7 +969,13 @@ int hist_entry__inc_addr_samples(struct hist_entry *he, int evidx, u64 ip) int hist_entry__annotate(struct hist_entry *he, size_t privsize) { + /* ANDROID_CHANGE_BEGIN */ +#if 0 return symbol__annotate(he->ms.sym, he->ms.map, privsize); +#else + return symbol__annotate(he->ms.sym, he->ms.map, privsize, false); +#endif + /* ANDROID_CHANGE_END */ } void hists__inc_nr_events(struct hists *self, u32 type) |