aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2013-03-28 10:47:17 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-04-01 11:23:55 -0400
commitd06f7911792780c6e973a137b766530c8d031aeb (patch)
tree69ff786e4280456345a03de9f70f85baf0e34d66 /tools
parent6692c262df4f087b1f0d3a57b31ef4cee9b1c6cb (diff)
perf map browser: Exit just on well known key presses
Initial motivation was to avoid the confusing exit when when '/' is pressed in non verbose mode, as specified in the help line searches are only available in verbose mode. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> 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-20xezxim2y4agmkx7f3sucll@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/ui/browsers/map.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/perf/ui/browsers/map.c b/tools/perf/ui/browsers/map.c
index 10b549c0eefb..95c7cfb8f2c6 100644
--- a/tools/perf/ui/browsers/map.c
+++ b/tools/perf/ui/browsers/map.c
@@ -80,12 +80,20 @@ static int map_browser__run(struct map_browser *self)
80 while (1) { 80 while (1) {
81 key = ui_browser__run(&self->b, 0); 81 key = ui_browser__run(&self->b, 0);
82 82
83 if (verbose && key == '/') 83 switch (key) {
84 map_browser__search(self); 84 case '/':
85 else 85 if (verbose)
86 map_browser__search(self);
87 default:
86 break; 88 break;
89 case K_LEFT:
90 case K_ESC:
91 case 'q':
92 case CTRL('c'):
93 goto out;
94 }
87 } 95 }
88 96out:
89 ui_browser__hide(&self->b); 97 ui_browser__hide(&self->b);
90 return key; 98 return key;
91} 99}