aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/ui/browsers
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-10-13 07:52:46 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-10-13 07:52:46 -0400
commit3af6e33867b3814a73c3f3ba991a13d7304ad23a (patch)
tree28f0f4071736faca07252439a0037e27f0895a53 /tools/perf/util/ui/browsers
parent33e27312aeb05798572ccc456a76321125e8d7cb (diff)
perf ui browser: Handle SIGWINCH
To do that we needed to stop using newtForm, as we don't want libnewt to catch the xterm resize signal. Remove some more newt calls and instead use the underlying libslang directly. In time tools/perf will use just libslang. 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-h1824yjiru5n2ivz4bseizwj@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/ui/browsers')
-rw-r--r--tools/perf/util/ui/browsers/annotate.c5
-rw-r--r--tools/perf/util/ui/browsers/hists.c12
-rw-r--r--tools/perf/util/ui/browsers/map.c3
3 files changed, 5 insertions, 15 deletions
diff --git a/tools/perf/util/ui/browsers/annotate.c b/tools/perf/util/ui/browsers/annotate.c
index 674b55e686fd..1967fbf73998 100644
--- a/tools/perf/util/ui/browsers/annotate.c
+++ b/tools/perf/util/ui/browsers/annotate.c
@@ -196,11 +196,8 @@ static int annotate_browser__run(struct annotate_browser *self, int evidx,
196 196
197 nd = self->curr_hot; 197 nd = self->curr_hot;
198 198
199 if (delay_secs != 0)
200 newtFormSetTimer(self->b.form, delay_secs * 1000);
201
202 while (1) { 199 while (1) {
203 key = ui_browser__run(&self->b); 200 key = ui_browser__run(&self->b, delay_secs);
204 201
205 if (delay_secs != 0) { 202 if (delay_secs != 0) {
206 annotate_browser__calc_percent(self, evidx); 203 annotate_browser__calc_percent(self, evidx);
diff --git a/tools/perf/util/ui/browsers/hists.c b/tools/perf/util/ui/browsers/hists.c
index fdc3c90696dc..603d6ee5a0d7 100644
--- a/tools/perf/util/ui/browsers/hists.c
+++ b/tools/perf/util/ui/browsers/hists.c
@@ -301,7 +301,6 @@ static int hist_browser__run(struct hist_browser *self, const char *ev_name,
301 void(*timer)(void *arg), void *arg, int delay_secs) 301 void(*timer)(void *arg), void *arg, int delay_secs)
302{ 302{
303 int key; 303 int key;
304 int delay_msecs = delay_secs * 1000;
305 char title[160]; 304 char title[160];
306 int sym_exit_keys[] = { 'a', 'h', 'C', 'd', 'E', 't', 0, }; 305 int sym_exit_keys[] = { 'a', 'h', 'C', 'd', 'E', 't', 0, };
307 int exit_keys[] = { '?', 'h', 'D', NEWT_KEY_LEFT, NEWT_KEY_RIGHT, 306 int exit_keys[] = { '?', 'h', 'D', NEWT_KEY_LEFT, NEWT_KEY_RIGHT,
@@ -318,15 +317,12 @@ static int hist_browser__run(struct hist_browser *self, const char *ev_name,
318 "Press '?' for help on key bindings") < 0) 317 "Press '?' for help on key bindings") < 0)
319 return -1; 318 return -1;
320 319
321 if (timer != NULL)
322 newtFormSetTimer(self->b.form, delay_msecs);
323
324 ui_browser__add_exit_keys(&self->b, exit_keys); 320 ui_browser__add_exit_keys(&self->b, exit_keys);
325 if (self->has_symbols) 321 if (self->has_symbols)
326 ui_browser__add_exit_keys(&self->b, sym_exit_keys); 322 ui_browser__add_exit_keys(&self->b, sym_exit_keys);
327 323
328 while (1) { 324 while (1) {
329 key = ui_browser__run(&self->b); 325 key = ui_browser__run(&self->b, delay_secs);
330 326
331 switch (key) { 327 switch (key) {
332 case -1: 328 case -1:
@@ -1061,7 +1057,6 @@ static int perf_evsel_menu__run(struct perf_evsel_menu *menu,
1061 void(*timer)(void *arg), void *arg, int delay_secs) 1057 void(*timer)(void *arg), void *arg, int delay_secs)
1062{ 1058{
1063 int exit_keys[] = { NEWT_KEY_ENTER, NEWT_KEY_RIGHT, 0, }; 1059 int exit_keys[] = { NEWT_KEY_ENTER, NEWT_KEY_RIGHT, 0, };
1064 int delay_msecs = delay_secs * 1000;
1065 struct perf_evlist *evlist = menu->b.priv; 1060 struct perf_evlist *evlist = menu->b.priv;
1066 struct perf_evsel *pos; 1061 struct perf_evsel *pos;
1067 const char *ev_name, *title = "Available samples"; 1062 const char *ev_name, *title = "Available samples";
@@ -1071,13 +1066,10 @@ static int perf_evsel_menu__run(struct perf_evsel_menu *menu,
1071 "ESC: exit, ENTER|->: Browse histograms") < 0) 1066 "ESC: exit, ENTER|->: Browse histograms") < 0)
1072 return -1; 1067 return -1;
1073 1068
1074 if (timer != NULL)
1075 newtFormSetTimer(menu->b.form, delay_msecs);
1076
1077 ui_browser__add_exit_keys(&menu->b, exit_keys); 1069 ui_browser__add_exit_keys(&menu->b, exit_keys);
1078 1070
1079 while (1) { 1071 while (1) {
1080 key = ui_browser__run(&menu->b); 1072 key = ui_browser__run(&menu->b, delay_secs);
1081 1073
1082 switch (key) { 1074 switch (key) {
1083 case -1: 1075 case -1:
diff --git a/tools/perf/util/ui/browsers/map.c b/tools/perf/util/ui/browsers/map.c
index 8462bffe20bc..499db76bac2f 100644
--- a/tools/perf/util/ui/browsers/map.c
+++ b/tools/perf/util/ui/browsers/map.c
@@ -1,5 +1,6 @@
1#include "../libslang.h" 1#include "../libslang.h"
2#include <elf.h> 2#include <elf.h>
3#include <newt.h>
3#include <inttypes.h> 4#include <inttypes.h>
4#include <sys/ttydefaults.h> 5#include <sys/ttydefaults.h>
5#include <ctype.h> 6#include <ctype.h>
@@ -112,7 +113,7 @@ static int map_browser__run(struct map_browser *self)
112 ui_browser__add_exit_key(&self->b, '/'); 113 ui_browser__add_exit_key(&self->b, '/');
113 114
114 while (1) { 115 while (1) {
115 key = ui_browser__run(&self->b); 116 key = ui_browser__run(&self->b, 0);
116 117
117 if (verbose && key == '/') 118 if (verbose && key == '/')
118 map_browser__search(self); 119 map_browser__search(self);