diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2012-11-02 01:50:05 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-11-05 12:03:58 -0500 |
commit | 9783adf777a445a1e9d0db4857a3a896a9f42d4a (patch) | |
tree | 0d3256acbcdba290afa018cce86456f21febe58b /tools | |
parent | 48ed0ece1b8063313284812ef048b26c3c4250af (diff) |
perf tools: Introduce struct hist_browser_timer
Currently various hist browser functions receive 3 arguments for
refreshing histogram but only used from a few places. Also it's only
for perf top command so that it can be NULL for other (and probably
most) cases. Pack them into a struct in order to reduce number of those
unused arguments.
This is a mechanical change and does not intend a functional change.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: David Ahern <dsahern@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Irina Tirdea <irina.tirdea@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1351835406-15208-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-annotate.c | 2 | ||||
-rw-r--r-- | tools/perf/builtin-report.c | 4 | ||||
-rw-r--r-- | tools/perf/builtin-top.c | 9 | ||||
-rw-r--r-- | tools/perf/ui/browsers/annotate.c | 27 | ||||
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 43 | ||||
-rw-r--r-- | tools/perf/ui/gtk/browser.c | 4 | ||||
-rw-r--r-- | tools/perf/util/annotate.h | 8 | ||||
-rw-r--r-- | tools/perf/util/hist.h | 28 |
8 files changed, 58 insertions, 67 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index cb234765ce3d..dc870cf31b79 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c | |||
@@ -139,7 +139,7 @@ find_next: | |||
139 | } | 139 | } |
140 | 140 | ||
141 | if (use_browser > 0) { | 141 | if (use_browser > 0) { |
142 | key = hist_entry__tui_annotate(he, evidx, NULL, NULL, 0); | 142 | key = hist_entry__tui_annotate(he, evidx, NULL); |
143 | switch (key) { | 143 | switch (key) { |
144 | case K_RIGHT: | 144 | case K_RIGHT: |
145 | next = rb_next(nd); | 145 | next = rb_next(nd); |
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index f07eae73e692..234f34d466e3 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -428,10 +428,10 @@ static int __cmd_report(struct perf_report *rep) | |||
428 | if (use_browser > 0) { | 428 | if (use_browser > 0) { |
429 | if (use_browser == 1) { | 429 | if (use_browser == 1) { |
430 | perf_evlist__tui_browse_hists(session->evlist, help, | 430 | perf_evlist__tui_browse_hists(session->evlist, help, |
431 | NULL, NULL, 0); | 431 | NULL); |
432 | } else if (use_browser == 2) { | 432 | } else if (use_browser == 2) { |
433 | perf_evlist__gtk_browse_hists(session->evlist, help, | 433 | perf_evlist__gtk_browse_hists(session->evlist, help, |
434 | NULL, NULL, 0); | 434 | NULL); |
435 | } | 435 | } |
436 | } else | 436 | } else |
437 | perf_evlist__tty_browse_hists(session->evlist, rep, help); | 437 | perf_evlist__tty_browse_hists(session->evlist, rep, help); |
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index f2ecd498c72d..102b43c9905d 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -582,6 +582,11 @@ static void *display_thread_tui(void *arg) | |||
582 | struct perf_evsel *pos; | 582 | struct perf_evsel *pos; |
583 | struct perf_top *top = arg; | 583 | struct perf_top *top = arg; |
584 | const char *help = "For a higher level overview, try: perf top --sort comm,dso"; | 584 | const char *help = "For a higher level overview, try: perf top --sort comm,dso"; |
585 | struct hist_browser_timer hbt = { | ||
586 | .timer = perf_top__sort_new_samples, | ||
587 | .arg = top, | ||
588 | .refresh = top->delay_secs, | ||
589 | }; | ||
585 | 590 | ||
586 | perf_top__sort_new_samples(top); | 591 | perf_top__sort_new_samples(top); |
587 | 592 | ||
@@ -593,9 +598,7 @@ static void *display_thread_tui(void *arg) | |||
593 | list_for_each_entry(pos, &top->evlist->entries, node) | 598 | list_for_each_entry(pos, &top->evlist->entries, node) |
594 | pos->hists.uid_filter_str = top->target.uid_str; | 599 | pos->hists.uid_filter_str = top->target.uid_str; |
595 | 600 | ||
596 | perf_evlist__tui_browse_hists(top->evlist, help, | 601 | perf_evlist__tui_browse_hists(top->evlist, help, &hbt); |
597 | perf_top__sort_new_samples, | ||
598 | top, top->delay_secs); | ||
599 | 602 | ||
600 | exit_browser(0); | 603 | exit_browser(0); |
601 | exit(0); | 604 | exit(0); |
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); |
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 082078ae9a6b..c7d32edb8057 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -310,10 +310,11 @@ static void ui_browser__warn_lost_events(struct ui_browser *browser) | |||
310 | } | 310 | } |
311 | 311 | ||
312 | static int hist_browser__run(struct hist_browser *browser, const char *ev_name, | 312 | static int hist_browser__run(struct hist_browser *browser, const char *ev_name, |
313 | void(*timer)(void *arg), void *arg, int delay_secs) | 313 | struct hist_browser_timer *hbt) |
314 | { | 314 | { |
315 | int key; | 315 | int key; |
316 | char title[160]; | 316 | char title[160]; |
317 | int delay_secs = hbt ? hbt->refresh : 0; | ||
317 | 318 | ||
318 | browser->b.entries = &browser->hists->entries; | 319 | browser->b.entries = &browser->hists->entries; |
319 | browser->b.nr_entries = browser->hists->nr_entries; | 320 | browser->b.nr_entries = browser->hists->nr_entries; |
@@ -330,7 +331,7 @@ static int hist_browser__run(struct hist_browser *browser, const char *ev_name, | |||
330 | 331 | ||
331 | switch (key) { | 332 | switch (key) { |
332 | case K_TIMER: | 333 | case K_TIMER: |
333 | timer(arg); | 334 | hbt->timer(hbt->arg); |
334 | ui_browser__update_nr_entries(&browser->b, browser->hists->nr_entries); | 335 | ui_browser__update_nr_entries(&browser->b, browser->hists->nr_entries); |
335 | 336 | ||
336 | if (browser->hists->stats.nr_lost_warned != | 337 | if (browser->hists->stats.nr_lost_warned != |
@@ -1136,8 +1137,7 @@ static inline bool is_report_browser(void *timer) | |||
1136 | static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | 1137 | static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, |
1137 | const char *helpline, const char *ev_name, | 1138 | const char *helpline, const char *ev_name, |
1138 | bool left_exits, | 1139 | bool left_exits, |
1139 | void(*timer)(void *arg), void *arg, | 1140 | struct hist_browser_timer *hbt) |
1140 | int delay_secs) | ||
1141 | { | 1141 | { |
1142 | struct hists *hists = &evsel->hists; | 1142 | struct hists *hists = &evsel->hists; |
1143 | struct hist_browser *browser = hist_browser__new(hists); | 1143 | struct hist_browser *browser = hist_browser__new(hists); |
@@ -1148,6 +1148,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | |||
1148 | int key = -1; | 1148 | int key = -1; |
1149 | char buf[64]; | 1149 | char buf[64]; |
1150 | char script_opt[64]; | 1150 | char script_opt[64]; |
1151 | int delay_secs = hbt ? hbt->refresh : 0; | ||
1151 | 1152 | ||
1152 | if (browser == NULL) | 1153 | if (browser == NULL) |
1153 | return -1; | 1154 | return -1; |
@@ -1170,7 +1171,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | |||
1170 | 1171 | ||
1171 | nr_options = 0; | 1172 | nr_options = 0; |
1172 | 1173 | ||
1173 | key = hist_browser__run(browser, ev_name, timer, arg, delay_secs); | 1174 | key = hist_browser__run(browser, ev_name, hbt); |
1174 | 1175 | ||
1175 | if (browser->he_selection != NULL) { | 1176 | if (browser->he_selection != NULL) { |
1176 | thread = hist_browser__selected_thread(browser); | 1177 | thread = hist_browser__selected_thread(browser); |
@@ -1220,7 +1221,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | |||
1220 | } | 1221 | } |
1221 | continue; | 1222 | continue; |
1222 | case 'r': | 1223 | case 'r': |
1223 | if (is_report_browser(timer)) | 1224 | if (is_report_browser(hbt)) |
1224 | goto do_scripts; | 1225 | goto do_scripts; |
1225 | continue; | 1226 | continue; |
1226 | case K_F1: | 1227 | case K_F1: |
@@ -1388,8 +1389,7 @@ do_annotate: | |||
1388 | * Don't let this be freed, say, by hists__decay_entry. | 1389 | * Don't let this be freed, say, by hists__decay_entry. |
1389 | */ | 1390 | */ |
1390 | he->used = true; | 1391 | he->used = true; |
1391 | err = hist_entry__tui_annotate(he, evsel->idx, | 1392 | err = hist_entry__tui_annotate(he, evsel->idx, hbt); |
1392 | timer, arg, delay_secs); | ||
1393 | he->used = false; | 1393 | he->used = false; |
1394 | /* | 1394 | /* |
1395 | * offer option to annotate the other branch source or target | 1395 | * offer option to annotate the other branch source or target |
@@ -1512,11 +1512,12 @@ static void perf_evsel_menu__write(struct ui_browser *browser, | |||
1512 | 1512 | ||
1513 | static int perf_evsel_menu__run(struct perf_evsel_menu *menu, | 1513 | static int perf_evsel_menu__run(struct perf_evsel_menu *menu, |
1514 | int nr_events, const char *help, | 1514 | int nr_events, const char *help, |
1515 | void(*timer)(void *arg), void *arg, int delay_secs) | 1515 | struct hist_browser_timer *hbt) |
1516 | { | 1516 | { |
1517 | struct perf_evlist *evlist = menu->b.priv; | 1517 | struct perf_evlist *evlist = menu->b.priv; |
1518 | struct perf_evsel *pos; | 1518 | struct perf_evsel *pos; |
1519 | const char *ev_name, *title = "Available samples"; | 1519 | const char *ev_name, *title = "Available samples"; |
1520 | int delay_secs = hbt ? hbt->refresh : 0; | ||
1520 | int key; | 1521 | int key; |
1521 | 1522 | ||
1522 | if (ui_browser__show(&menu->b, title, | 1523 | if (ui_browser__show(&menu->b, title, |
@@ -1528,7 +1529,7 @@ static int perf_evsel_menu__run(struct perf_evsel_menu *menu, | |||
1528 | 1529 | ||
1529 | switch (key) { | 1530 | switch (key) { |
1530 | case K_TIMER: | 1531 | case K_TIMER: |
1531 | timer(arg); | 1532 | hbt->timer(hbt->arg); |
1532 | 1533 | ||
1533 | if (!menu->lost_events_warned && menu->lost_events) { | 1534 | if (!menu->lost_events_warned && menu->lost_events) { |
1534 | ui_browser__warn_lost_events(&menu->b); | 1535 | ui_browser__warn_lost_events(&menu->b); |
@@ -1546,12 +1547,11 @@ browse_hists: | |||
1546 | * Give the calling tool a chance to populate the non | 1547 | * Give the calling tool a chance to populate the non |
1547 | * default evsel resorted hists tree. | 1548 | * default evsel resorted hists tree. |
1548 | */ | 1549 | */ |
1549 | if (timer) | 1550 | if (hbt) |
1550 | timer(arg); | 1551 | hbt->timer(hbt->arg); |
1551 | ev_name = perf_evsel__name(pos); | 1552 | ev_name = perf_evsel__name(pos); |
1552 | key = perf_evsel__hists_browse(pos, nr_events, help, | 1553 | key = perf_evsel__hists_browse(pos, nr_events, help, |
1553 | ev_name, true, timer, | 1554 | ev_name, true, hbt); |
1554 | arg, delay_secs); | ||
1555 | ui_browser__show_title(&menu->b, title); | 1555 | ui_browser__show_title(&menu->b, title); |
1556 | switch (key) { | 1556 | switch (key) { |
1557 | case K_TAB: | 1557 | case K_TAB: |
@@ -1599,8 +1599,7 @@ out: | |||
1599 | 1599 | ||
1600 | static int __perf_evlist__tui_browse_hists(struct perf_evlist *evlist, | 1600 | static int __perf_evlist__tui_browse_hists(struct perf_evlist *evlist, |
1601 | const char *help, | 1601 | const char *help, |
1602 | void(*timer)(void *arg), void *arg, | 1602 | struct hist_browser_timer *hbt) |
1603 | int delay_secs) | ||
1604 | { | 1603 | { |
1605 | struct perf_evsel *pos; | 1604 | struct perf_evsel *pos; |
1606 | struct perf_evsel_menu menu = { | 1605 | struct perf_evsel_menu menu = { |
@@ -1624,23 +1623,19 @@ static int __perf_evlist__tui_browse_hists(struct perf_evlist *evlist, | |||
1624 | menu.b.width = line_len; | 1623 | menu.b.width = line_len; |
1625 | } | 1624 | } |
1626 | 1625 | ||
1627 | return perf_evsel_menu__run(&menu, evlist->nr_entries, help, timer, | 1626 | return perf_evsel_menu__run(&menu, evlist->nr_entries, help, hbt); |
1628 | arg, delay_secs); | ||
1629 | } | 1627 | } |
1630 | 1628 | ||
1631 | int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help, | 1629 | int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help, |
1632 | void(*timer)(void *arg), void *arg, | 1630 | struct hist_browser_timer *hbt) |
1633 | int delay_secs) | ||
1634 | { | 1631 | { |
1635 | if (evlist->nr_entries == 1) { | 1632 | if (evlist->nr_entries == 1) { |
1636 | struct perf_evsel *first = list_entry(evlist->entries.next, | 1633 | struct perf_evsel *first = list_entry(evlist->entries.next, |
1637 | struct perf_evsel, node); | 1634 | struct perf_evsel, node); |
1638 | const char *ev_name = perf_evsel__name(first); | 1635 | const char *ev_name = perf_evsel__name(first); |
1639 | return perf_evsel__hists_browse(first, evlist->nr_entries, help, | 1636 | return perf_evsel__hists_browse(first, evlist->nr_entries, help, |
1640 | ev_name, false, timer, arg, | 1637 | ev_name, false, hbt); |
1641 | delay_secs); | ||
1642 | } | 1638 | } |
1643 | 1639 | ||
1644 | return __perf_evlist__tui_browse_hists(evlist, help, | 1640 | return __perf_evlist__tui_browse_hists(evlist, help, hbt); |
1645 | timer, arg, delay_secs); | ||
1646 | } | 1641 | } |
diff --git a/tools/perf/ui/gtk/browser.c b/tools/perf/ui/gtk/browser.c index 4125c6284114..253b6219a39e 100644 --- a/tools/perf/ui/gtk/browser.c +++ b/tools/perf/ui/gtk/browser.c | |||
@@ -237,9 +237,7 @@ static GtkWidget *perf_gtk__setup_statusbar(void) | |||
237 | 237 | ||
238 | int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist, | 238 | int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist, |
239 | const char *help, | 239 | const char *help, |
240 | void (*timer) (void *arg)__maybe_unused, | 240 | struct hist_browser_timer *hbt __maybe_unused) |
241 | void *arg __maybe_unused, | ||
242 | int delay_secs __maybe_unused) | ||
243 | { | 241 | { |
244 | struct perf_evsel *pos; | 242 | struct perf_evsel *pos; |
245 | GtkWidget *vbox; | 243 | GtkWidget *vbox; |
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index a4dd25a61a07..c6272011625a 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <stdint.h> | 5 | #include <stdint.h> |
6 | #include "types.h" | 6 | #include "types.h" |
7 | #include "symbol.h" | 7 | #include "symbol.h" |
8 | #include "hist.h" | ||
8 | #include <linux/list.h> | 9 | #include <linux/list.h> |
9 | #include <linux/rbtree.h> | 10 | #include <linux/rbtree.h> |
10 | #include <pthread.h> | 11 | #include <pthread.h> |
@@ -140,14 +141,13 @@ int symbol__tty_annotate(struct symbol *sym, struct map *map, int evidx, | |||
140 | 141 | ||
141 | #ifdef NEWT_SUPPORT | 142 | #ifdef NEWT_SUPPORT |
142 | int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx, | 143 | int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx, |
143 | void(*timer)(void *arg), void *arg, int delay_secs); | 144 | struct hist_browser_timer *hbt); |
144 | #else | 145 | #else |
145 | static inline int symbol__tui_annotate(struct symbol *sym __maybe_unused, | 146 | static inline int symbol__tui_annotate(struct symbol *sym __maybe_unused, |
146 | struct map *map __maybe_unused, | 147 | struct map *map __maybe_unused, |
147 | int evidx __maybe_unused, | 148 | int evidx __maybe_unused, |
148 | void(*timer)(void *arg) __maybe_unused, | 149 | struct hist_browser_timer *hbt |
149 | void *arg __maybe_unused, | 150 | __maybe_unused) |
150 | int delay_secs __maybe_unused) | ||
151 | { | 151 | { |
152 | return 0; | 152 | return 0; |
153 | } | 153 | } |
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index b87460971736..96664cce7c7b 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h | |||
@@ -157,22 +157,25 @@ int hist_entry__period_snprintf(struct perf_hpp *hpp, struct hist_entry *he, | |||
157 | 157 | ||
158 | struct perf_evlist; | 158 | struct perf_evlist; |
159 | 159 | ||
160 | struct hist_browser_timer { | ||
161 | void (*timer)(void *arg); | ||
162 | void *arg; | ||
163 | int refresh; | ||
164 | }; | ||
165 | |||
160 | #ifdef NEWT_SUPPORT | 166 | #ifdef NEWT_SUPPORT |
161 | #include "../ui/keysyms.h" | 167 | #include "../ui/keysyms.h" |
162 | int hist_entry__tui_annotate(struct hist_entry *he, int evidx, | 168 | int hist_entry__tui_annotate(struct hist_entry *he, int evidx, |
163 | void(*timer)(void *arg), void *arg, int delay_secs); | 169 | struct hist_browser_timer *hbt); |
164 | 170 | ||
165 | int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help, | 171 | int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help, |
166 | void(*timer)(void *arg), void *arg, | 172 | struct hist_browser_timer *hbt); |
167 | int refresh); | ||
168 | int script_browse(const char *script_opt); | 173 | int script_browse(const char *script_opt); |
169 | #else | 174 | #else |
170 | static inline | 175 | static inline |
171 | int perf_evlist__tui_browse_hists(struct perf_evlist *evlist __maybe_unused, | 176 | int perf_evlist__tui_browse_hists(struct perf_evlist *evlist __maybe_unused, |
172 | const char *help __maybe_unused, | 177 | const char *help __maybe_unused, |
173 | void(*timer)(void *arg) __maybe_unused, | 178 | struct hist_browser_timer *hbt __maybe_unused) |
174 | void *arg __maybe_unused, | ||
175 | int refresh __maybe_unused) | ||
176 | { | 179 | { |
177 | return 0; | 180 | return 0; |
178 | } | 181 | } |
@@ -180,10 +183,8 @@ int perf_evlist__tui_browse_hists(struct perf_evlist *evlist __maybe_unused, | |||
180 | static inline int hist_entry__tui_annotate(struct hist_entry *self | 183 | static inline int hist_entry__tui_annotate(struct hist_entry *self |
181 | __maybe_unused, | 184 | __maybe_unused, |
182 | int evidx __maybe_unused, | 185 | int evidx __maybe_unused, |
183 | void(*timer)(void *arg) | 186 | struct hist_browser_timer *hbt |
184 | __maybe_unused, | 187 | __maybe_unused) |
185 | void *arg __maybe_unused, | ||
186 | int delay_secs __maybe_unused) | ||
187 | { | 188 | { |
188 | return 0; | 189 | return 0; |
189 | } | 190 | } |
@@ -199,15 +200,12 @@ static inline int script_browse(const char *script_opt) | |||
199 | 200 | ||
200 | #ifdef GTK2_SUPPORT | 201 | #ifdef GTK2_SUPPORT |
201 | int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist, const char *help, | 202 | int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist, const char *help, |
202 | void(*timer)(void *arg), void *arg, | 203 | struct hist_browser_timer *hbt __maybe_unused); |
203 | int refresh); | ||
204 | #else | 204 | #else |
205 | static inline | 205 | static inline |
206 | int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist __maybe_unused, | 206 | int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist __maybe_unused, |
207 | const char *help __maybe_unused, | 207 | const char *help __maybe_unused, |
208 | void(*timer)(void *arg) __maybe_unused, | 208 | struct hist_browser_timer *hbt __maybe_unused) |
209 | void *arg __maybe_unused, | ||
210 | int refresh __maybe_unused) | ||
211 | { | 209 | { |
212 | return 0; | 210 | return 0; |
213 | } | 211 | } |