From b2b7e9eb2983e24b0296a93171f811d95f044fbc Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Mon, 17 Oct 2011 09:10:24 -0200 Subject: [PATCH] perf top: Fix the 'E' hotkey, select among multiple events 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 Cc: David Ahern Cc: Frederic Weisbecker Cc: Mike Galbraith Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-zcx055vnhagddvqlaqxvdhtb@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-top.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index bf368f1663d1..7a871714d44e 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; } -- 2.20.1