diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-10-26 10:04:37 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-10-26 11:15:07 -0400 |
commit | 4610e4137b5fb93042a248928a2c0049ef7d4190 (patch) | |
tree | 163cd2366d5870a67619aa4774cfc04cf7a97d6f /tools/perf/util/ui/browsers/hists.c | |
parent | 0458122db0a2ebd1d3779469cb6184d8b195be09 (diff) |
perf ui browser: Handle K_RESIZE in dialog windows
Just provide wrappers for things like ui__warning, ui__dialog_yesno and
if they return K_RESIZE, refresh dimensions, redraw the entries, etc.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-3ih7hyk9weryxaxb501sfq4u@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/ui/browsers/hists.c')
-rw-r--r-- | tools/perf/util/ui/browsers/hists.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/tools/perf/util/ui/browsers/hists.c b/tools/perf/util/ui/browsers/hists.c index 44210d471719..b8733c0770cd 100644 --- a/tools/perf/util/ui/browsers/hists.c +++ b/tools/perf/util/ui/browsers/hists.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include "../browser.h" | 17 | #include "../browser.h" |
18 | #include "../helpline.h" | 18 | #include "../helpline.h" |
19 | #include "../util.h" | 19 | #include "../util.h" |
20 | #include "../ui.h" | ||
20 | #include "map.h" | 21 | #include "map.h" |
21 | 22 | ||
22 | struct hist_browser { | 23 | struct hist_browser { |
@@ -882,7 +883,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | |||
882 | goto out_free_stack; | 883 | goto out_free_stack; |
883 | case 'a': | 884 | case 'a': |
884 | if (!browser->has_symbols) { | 885 | if (!browser->has_symbols) { |
885 | ui__warning( | 886 | ui_browser__warning(&browser->b, |
886 | "Annotation is only available for symbolic views, " | 887 | "Annotation is only available for symbolic views, " |
887 | "include \"sym\" in --sort to use it."); | 888 | "include \"sym\" in --sort to use it."); |
888 | continue; | 889 | continue; |
@@ -900,7 +901,8 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | |||
900 | case K_F1: | 901 | case K_F1: |
901 | case 'h': | 902 | case 'h': |
902 | case '?': | 903 | case '?': |
903 | ui__help_window("h/?/F1 Show this window\n" | 904 | ui_browser__help_window(&browser->b, |
905 | "h/?/F1 Show this window\n" | ||
904 | "UP/DOWN/PGUP\n" | 906 | "UP/DOWN/PGUP\n" |
905 | "PGDN/SPACE Navigate\n" | 907 | "PGDN/SPACE Navigate\n" |
906 | "q/ESC/CTRL+C Exit browser\n\n" | 908 | "q/ESC/CTRL+C Exit browser\n\n" |
@@ -939,7 +941,8 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | |||
939 | } | 941 | } |
940 | case K_ESC: | 942 | case K_ESC: |
941 | if (!left_exits && | 943 | if (!left_exits && |
942 | !ui__dialog_yesno("Do you really want to exit?")) | 944 | !ui_browser__dialog_yesno(&browser->b, |
945 | "Do you really want to exit?")) | ||
943 | continue; | 946 | continue; |
944 | /* Fall thru */ | 947 | /* Fall thru */ |
945 | case 'q': | 948 | case 'q': |
@@ -992,6 +995,7 @@ add_exit_option: | |||
992 | 995 | ||
993 | if (choice == annotate) { | 996 | if (choice == annotate) { |
994 | struct hist_entry *he; | 997 | struct hist_entry *he; |
998 | int err; | ||
995 | do_annotate: | 999 | do_annotate: |
996 | he = hist_browser__selected_entry(browser); | 1000 | he = hist_browser__selected_entry(browser); |
997 | if (he == NULL) | 1001 | if (he == NULL) |
@@ -1000,10 +1004,12 @@ do_annotate: | |||
1000 | * Don't let this be freed, say, by hists__decay_entry. | 1004 | * Don't let this be freed, say, by hists__decay_entry. |
1001 | */ | 1005 | */ |
1002 | he->used = true; | 1006 | he->used = true; |
1003 | hist_entry__tui_annotate(he, evsel->idx, nr_events, | 1007 | err = hist_entry__tui_annotate(he, evsel->idx, nr_events, |
1004 | timer, arg, delay_secs); | 1008 | timer, arg, delay_secs); |
1005 | he->used = false; | 1009 | he->used = false; |
1006 | ui_browser__update_nr_entries(&browser->b, browser->hists->nr_entries); | 1010 | ui_browser__update_nr_entries(&browser->b, browser->hists->nr_entries); |
1011 | if (err) | ||
1012 | ui_browser__handle_resize(&browser->b); | ||
1007 | } else if (choice == browse_map) | 1013 | } else if (choice == browse_map) |
1008 | map__browse(browser->selection->map); | 1014 | map__browse(browser->selection->map); |
1009 | else if (choice == zoom_dso) { | 1015 | else if (choice == zoom_dso) { |
@@ -1132,7 +1138,8 @@ browse_hists: | |||
1132 | pos = list_entry(pos->node.prev, struct perf_evsel, node); | 1138 | pos = list_entry(pos->node.prev, struct perf_evsel, node); |
1133 | goto browse_hists; | 1139 | goto browse_hists; |
1134 | case K_ESC: | 1140 | case K_ESC: |
1135 | if (!ui__dialog_yesno("Do you really want to exit?")) | 1141 | if (!ui_browser__dialog_yesno(&menu->b, |
1142 | "Do you really want to exit?")) | ||
1136 | continue; | 1143 | continue; |
1137 | /* Fall thru */ | 1144 | /* Fall thru */ |
1138 | case 'q': | 1145 | case 'q': |
@@ -1144,7 +1151,8 @@ browse_hists: | |||
1144 | case K_LEFT: | 1151 | case K_LEFT: |
1145 | continue; | 1152 | continue; |
1146 | case K_ESC: | 1153 | case K_ESC: |
1147 | if (!ui__dialog_yesno("Do you really want to exit?")) | 1154 | if (!ui_browser__dialog_yesno(&menu->b, |
1155 | "Do you really want to exit?")) | ||
1148 | continue; | 1156 | continue; |
1149 | /* Fall thru */ | 1157 | /* Fall thru */ |
1150 | case 'q': | 1158 | case 'q': |