[PATCH 2/3] perf top: Fix the 'E' hotkey, select among multiple events

From: Arnaldo Carvalho de Melo
Date: Mon Oct 17 2011 - 09:54:45 EST


From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

We were not recognizing 'E' as a hotkey due to a bug introduced when
switching to the new, hist_entry based top. Fix it by returning that 'E'
is mapped if evlist->nr_entries > 1.

Reported-by: Mike Galbraith <efault@xxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Mike Galbraith <efault@xxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Stephane Eranian <eranian@xxxxxxxxxx>
Link: http://lkml.kernel.org/n/tip-zcx055vnhagddvqlaqxvdhtb@xxxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/builtin-top.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index bf368f1..7a87171 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -438,6 +438,7 @@ static int key_mapped(int c)
case 'S':
return 1;
case 'E':
+ return top.evlist->nr_entries > 1 ? 1 : 0;
default:
break;
}
--
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/