diff options
Diffstat (limited to 'tools/perf/ui/browsers/annotate.c')
-rw-r--r-- | tools/perf/ui/browsers/annotate.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index cc64d3f7fc36..08545ae46992 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c | |||
@@ -428,6 +428,14 @@ static void annotate_browser__init_asm_mode(struct annotate_browser *browser) | |||
428 | browser->b.nr_entries = browser->nr_asm_entries; | 428 | browser->b.nr_entries = browser->nr_asm_entries; |
429 | } | 429 | } |
430 | 430 | ||
431 | #define SYM_TITLE_MAX_SIZE (PATH_MAX + 64) | ||
432 | |||
433 | static int sym_title(struct symbol *sym, struct map *map, char *title, | ||
434 | size_t sz) | ||
435 | { | ||
436 | return snprintf(title, sz, "%s %s", sym->name, map->dso->long_name); | ||
437 | } | ||
438 | |||
431 | static bool annotate_browser__callq(struct annotate_browser *browser, | 439 | static bool annotate_browser__callq(struct annotate_browser *browser, |
432 | struct perf_evsel *evsel, | 440 | struct perf_evsel *evsel, |
433 | struct hist_browser_timer *hbt) | 441 | struct hist_browser_timer *hbt) |
@@ -438,6 +446,7 @@ static bool annotate_browser__callq(struct annotate_browser *browser, | |||
438 | struct annotation *notes; | 446 | struct annotation *notes; |
439 | struct symbol *target; | 447 | struct symbol *target; |
440 | u64 ip; | 448 | u64 ip; |
449 | char title[SYM_TITLE_MAX_SIZE]; | ||
441 | 450 | ||
442 | if (!ins__is_call(dl->ins)) | 451 | if (!ins__is_call(dl->ins)) |
443 | return false; | 452 | return false; |
@@ -461,7 +470,8 @@ static bool annotate_browser__callq(struct annotate_browser *browser, | |||
461 | 470 | ||
462 | pthread_mutex_unlock(¬es->lock); | 471 | pthread_mutex_unlock(¬es->lock); |
463 | symbol__tui_annotate(target, ms->map, evsel, hbt); | 472 | symbol__tui_annotate(target, ms->map, evsel, hbt); |
464 | ui_browser__show_title(&browser->b, sym->name); | 473 | sym_title(sym, ms->map, title, sizeof(title)); |
474 | ui_browser__show_title(&browser->b, title); | ||
465 | return true; | 475 | return true; |
466 | } | 476 | } |
467 | 477 | ||
@@ -495,7 +505,7 @@ static bool annotate_browser__jump(struct annotate_browser *browser) | |||
495 | 505 | ||
496 | dl = annotate_browser__find_offset(browser, dl->ops.target.offset, &idx); | 506 | dl = annotate_browser__find_offset(browser, dl->ops.target.offset, &idx); |
497 | if (dl == NULL) { | 507 | if (dl == NULL) { |
498 | ui_helpline__puts("Invallid jump offset"); | 508 | ui_helpline__puts("Invalid jump offset"); |
499 | return true; | 509 | return true; |
500 | } | 510 | } |
501 | 511 | ||
@@ -653,8 +663,10 @@ static int annotate_browser__run(struct annotate_browser *browser, | |||
653 | const char *help = "Press 'h' for help on key bindings"; | 663 | const char *help = "Press 'h' for help on key bindings"; |
654 | int delay_secs = hbt ? hbt->refresh : 0; | 664 | int delay_secs = hbt ? hbt->refresh : 0; |
655 | int key; | 665 | int key; |
666 | char title[SYM_TITLE_MAX_SIZE]; | ||
656 | 667 | ||
657 | if (ui_browser__show(&browser->b, sym->name, help) < 0) | 668 | sym_title(sym, ms->map, title, sizeof(title)); |
669 | if (ui_browser__show(&browser->b, title, help) < 0) | ||
658 | return -1; | 670 | return -1; |
659 | 671 | ||
660 | annotate_browser__calc_percent(browser, evsel); | 672 | annotate_browser__calc_percent(browser, evsel); |
@@ -720,7 +732,7 @@ static int annotate_browser__run(struct annotate_browser *browser, | |||
720 | "s Toggle source code view\n" | 732 | "s Toggle source code view\n" |
721 | "/ Search string\n" | 733 | "/ Search string\n" |
722 | "r Run available scripts\n" | 734 | "r Run available scripts\n" |
723 | "? Search previous string\n"); | 735 | "? Search string backwards\n"); |
724 | continue; | 736 | continue; |
725 | case 'r': | 737 | case 'r': |
726 | { | 738 | { |