diff options
Diffstat (limited to 'tools/perf/ui/browsers/annotate.c')
-rw-r--r-- | tools/perf/ui/browsers/annotate.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index 28f8aab73aee..3eff17f703f3 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c | |||
@@ -386,9 +386,8 @@ static void annotate_browser__init_asm_mode(struct annotate_browser *browser) | |||
386 | browser->b.nr_entries = browser->nr_asm_entries; | 386 | browser->b.nr_entries = browser->nr_asm_entries; |
387 | } | 387 | } |
388 | 388 | ||
389 | static bool annotate_browser__callq(struct annotate_browser *browser, | 389 | static bool annotate_browser__callq(struct annotate_browser *browser, int evidx, |
390 | int evidx, void (*timer)(void *arg), | 390 | struct hist_browser_timer *hbt) |
391 | void *arg, int delay_secs) | ||
392 | { | 391 | { |
393 | struct map_symbol *ms = browser->b.priv; | 392 | struct map_symbol *ms = browser->b.priv; |
394 | struct disasm_line *dl = browser->selection; | 393 | struct disasm_line *dl = browser->selection; |
@@ -418,7 +417,7 @@ static bool annotate_browser__callq(struct annotate_browser *browser, | |||
418 | } | 417 | } |
419 | 418 | ||
420 | pthread_mutex_unlock(¬es->lock); | 419 | pthread_mutex_unlock(¬es->lock); |
421 | symbol__tui_annotate(target, ms->map, evidx, timer, arg, delay_secs); | 420 | symbol__tui_annotate(target, ms->map, evidx, hbt); |
422 | ui_browser__show_title(&browser->b, sym->name); | 421 | ui_browser__show_title(&browser->b, sym->name); |
423 | return true; | 422 | return true; |
424 | } | 423 | } |
@@ -602,13 +601,13 @@ static void annotate_browser__update_addr_width(struct annotate_browser *browser | |||
602 | } | 601 | } |
603 | 602 | ||
604 | static int annotate_browser__run(struct annotate_browser *browser, int evidx, | 603 | static int annotate_browser__run(struct annotate_browser *browser, int evidx, |
605 | void(*timer)(void *arg), | 604 | struct hist_browser_timer *hbt) |
606 | void *arg, int delay_secs) | ||
607 | { | 605 | { |
608 | struct rb_node *nd = NULL; | 606 | struct rb_node *nd = NULL; |
609 | struct map_symbol *ms = browser->b.priv; | 607 | struct map_symbol *ms = browser->b.priv; |
610 | struct symbol *sym = ms->sym; | 608 | struct symbol *sym = ms->sym; |
611 | const char *help = "Press 'h' for help on key bindings"; | 609 | const char *help = "Press 'h' for help on key bindings"; |
610 | int delay_secs = hbt ? hbt->refresh : 0; | ||
612 | int key; | 611 | int key; |
613 | 612 | ||
614 | if (ui_browser__show(&browser->b, sym->name, help) < 0) | 613 | if (ui_browser__show(&browser->b, sym->name, help) < 0) |
@@ -639,8 +638,8 @@ static int annotate_browser__run(struct annotate_browser *browser, int evidx, | |||
639 | 638 | ||
640 | switch (key) { | 639 | switch (key) { |
641 | case K_TIMER: | 640 | case K_TIMER: |
642 | if (timer != NULL) | 641 | if (hbt) |
643 | timer(arg); | 642 | hbt->timer(hbt->arg); |
644 | 643 | ||
645 | if (delay_secs != 0) | 644 | if (delay_secs != 0) |
646 | symbol__annotate_decay_histogram(sym, evidx); | 645 | symbol__annotate_decay_histogram(sym, evidx); |
@@ -740,7 +739,7 @@ show_help: | |||
740 | goto show_sup_ins; | 739 | goto show_sup_ins; |
741 | goto out; | 740 | goto out; |
742 | } else if (!(annotate_browser__jump(browser) || | 741 | } else if (!(annotate_browser__jump(browser) || |
743 | annotate_browser__callq(browser, evidx, timer, arg, delay_secs))) { | 742 | annotate_browser__callq(browser, evidx, hbt))) { |
744 | show_sup_ins: | 743 | show_sup_ins: |
745 | ui_helpline__puts("Actions are only available for 'callq', 'retq' & jump instructions."); | 744 | ui_helpline__puts("Actions are only available for 'callq', 'retq' & jump instructions."); |
746 | } | 745 | } |
@@ -763,10 +762,9 @@ out: | |||
763 | } | 762 | } |
764 | 763 | ||
765 | int hist_entry__tui_annotate(struct hist_entry *he, int evidx, | 764 | int hist_entry__tui_annotate(struct hist_entry *he, int evidx, |
766 | void(*timer)(void *arg), void *arg, int delay_secs) | 765 | struct hist_browser_timer *hbt) |
767 | { | 766 | { |
768 | return symbol__tui_annotate(he->ms.sym, he->ms.map, evidx, | 767 | return symbol__tui_annotate(he->ms.sym, he->ms.map, evidx, hbt); |
769 | timer, arg, delay_secs); | ||
770 | } | 768 | } |
771 | 769 | ||
772 | static void annotate_browser__mark_jump_targets(struct annotate_browser *browser, | 770 | static void annotate_browser__mark_jump_targets(struct annotate_browser *browser, |
@@ -816,8 +814,7 @@ static inline int width_jumps(int n) | |||
816 | } | 814 | } |
817 | 815 | ||
818 | int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx, | 816 | int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx, |
819 | void(*timer)(void *arg), void *arg, | 817 | struct hist_browser_timer *hbt) |
820 | int delay_secs) | ||
821 | { | 818 | { |
822 | struct disasm_line *pos, *n; | 819 | struct disasm_line *pos, *n; |
823 | struct annotation *notes; | 820 | struct annotation *notes; |
@@ -899,7 +896,7 @@ int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx, | |||
899 | 896 | ||
900 | annotate_browser__update_addr_width(&browser); | 897 | annotate_browser__update_addr_width(&browser); |
901 | 898 | ||
902 | ret = annotate_browser__run(&browser, evidx, timer, arg, delay_secs); | 899 | ret = annotate_browser__run(&browser, evidx, hbt); |
903 | list_for_each_entry_safe(pos, n, ¬es->src->source, node) { | 900 | list_for_each_entry_safe(pos, n, ¬es->src->source, node) { |
904 | list_del(&pos->node); | 901 | list_del(&pos->node); |
905 | disasm_line__free(pos); | 902 | disasm_line__free(pos); |