diff options
-rw-r--r-- | tools/perf/util/annotate.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 3aa555ff9d89..809b4c50beae 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c | |||
@@ -1236,6 +1236,7 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map, | |||
1236 | struct dso *dso = map->dso; | 1236 | struct dso *dso = map->dso; |
1237 | char *filename; | 1237 | char *filename; |
1238 | const char *d_filename; | 1238 | const char *d_filename; |
1239 | const char *evsel_name = perf_evsel__name(evsel); | ||
1239 | struct annotation *notes = symbol__annotation(sym); | 1240 | struct annotation *notes = symbol__annotation(sym); |
1240 | struct disasm_line *pos, *queue = NULL; | 1241 | struct disasm_line *pos, *queue = NULL; |
1241 | u64 start = map__rip_2objdump(map, sym->start); | 1242 | u64 start = map__rip_2objdump(map, sym->start); |
@@ -1243,7 +1244,7 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map, | |||
1243 | int more = 0; | 1244 | int more = 0; |
1244 | u64 len; | 1245 | u64 len; |
1245 | int width = 8; | 1246 | int width = 8; |
1246 | int namelen; | 1247 | int namelen, evsel_name_len, graph_dotted_len; |
1247 | 1248 | ||
1248 | filename = strdup(dso->long_name); | 1249 | filename = strdup(dso->long_name); |
1249 | if (!filename) | 1250 | if (!filename) |
@@ -1256,14 +1257,17 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map, | |||
1256 | 1257 | ||
1257 | len = symbol__size(sym); | 1258 | len = symbol__size(sym); |
1258 | namelen = strlen(d_filename); | 1259 | namelen = strlen(d_filename); |
1260 | evsel_name_len = strlen(evsel_name); | ||
1259 | 1261 | ||
1260 | if (perf_evsel__is_group_event(evsel)) | 1262 | if (perf_evsel__is_group_event(evsel)) |
1261 | width *= evsel->nr_members; | 1263 | width *= evsel->nr_members; |
1262 | 1264 | ||
1263 | printf(" %-*.*s| Source code & Disassembly of %s\n", | 1265 | printf(" %-*.*s| Source code & Disassembly of %s for %s\n", |
1264 | width, width, "Percent", d_filename); | 1266 | width, width, "Percent", d_filename, evsel_name); |
1265 | printf("-%-*.*s-------------------------------------\n", | 1267 | |
1266 | width+namelen, width+namelen, graph_dotted_line); | 1268 | graph_dotted_len = width + namelen + evsel_name_len; |
1269 | printf("-%-*.*s-----------------------------------------\n", | ||
1270 | graph_dotted_len, graph_dotted_len, graph_dotted_line); | ||
1267 | 1271 | ||
1268 | if (verbose) | 1272 | if (verbose) |
1269 | symbol__annotate_hits(sym, evsel); | 1273 | symbol__annotate_hits(sym, evsel); |