From: Arnaldo Carvalho de Melo Date: Thu, 28 Mar 2013 14:47:17 +0000 (-0300) Subject: perf map browser: Exit just on well known key presses X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d06f7911792780c6e973a137b766530c8d031aeb;p=linux-beck.git 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 Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Mike Galbraith Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-20xezxim2y4agmkx7f3sucll@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- 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) while (1) { key = ui_browser__run(&self->b, 0); - if (verbose && key == '/') - map_browser__search(self); - else + switch (key) { + case '/': + if (verbose) + map_browser__search(self); + default: break; + case K_LEFT: + case K_ESC: + case 'q': + case CTRL('c'): + goto out; + } } - +out: ui_browser__hide(&self->b); return key; }