mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@elte.hu>, Mike Galbraith <efault@gmx.de>,
	Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Stephane Eranian <eranian@google.com>,
	Tom Zanussi <tzanussi@gmail.com>
Subject: [PATCH 1/6] perf top browser: Fix up exit keys
Date: Tue,  1 Mar 2011 14:03:42 -0300	[thread overview]
Message-ID: <1298999027-30673-2-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1298999027-30673-1-git-send-email-acme@infradead.org>

From: Arnaldo Carvalho de Melo <acme@redhat.com>

The left key was exiting 'perf top --tui' when it really shouldn't, it
was too easy to leave the live annotation window and then press one too
many <- and get out of the tool altogether.

Do just like the report TUI does, ignore the left key for exit and also
ask the user when pressing ESC if that is really what is wanted.

Reported-by: Mike Galbraith <efault@gmx.de>
Suggested-by: Ingo Molnar <mingo@elte.hu>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/ui/browsers/top.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/tools/perf/util/ui/browsers/top.c b/tools/perf/util/ui/browsers/top.c
index 2f47224..e9381ec 100644
--- a/tools/perf/util/ui/browsers/top.c
+++ b/tools/perf/util/ui/browsers/top.c
@@ -10,6 +10,7 @@
 #include "../../annotate.h"
 #include "../helpline.h"
 #include "../libslang.h"
+#include "../util.h"
 #include "../../evlist.h"
 #include "../../hist.h"
 #include "../../sort.h"
@@ -174,6 +175,12 @@ static int perf_top_browser__run(struct perf_top_browser *browser)
 			if (browser->selection)
 				perf_top_browser__annotate(browser);
 			break;
+		case NEWT_KEY_LEFT:
+			continue;
+		case NEWT_KEY_ESCAPE:
+			if (!ui__dialog_yesno("Do you really want to exit?"))
+				continue;
+			/* Fall thru */
 		default:
 			goto out;
 		}
-- 
1.6.2.5


  reply	other threads:[~2011-03-01 17:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-01 17:03 [GIT PULL 0/6] perf/core top tui fixes and improvements Arnaldo Carvalho de Melo
2011-03-01 17:03 ` Arnaldo Carvalho de Melo [this message]
2011-03-01 17:03 ` [PATCH 2/6] perf ui browser: Introduce ui_browser__show_title Arnaldo Carvalho de Melo
2011-03-01 17:03 ` [PATCH 3/6] perf top browser: Handle empty active symbols list Arnaldo Carvalho de Melo
2011-03-01 17:03 ` [PATCH 4/6] perf tui: Make ui__warning modal Arnaldo Carvalho de Melo
2011-03-01 17:03 ` [PATCH 5/6] perf top: Fix reporting of invalid --vmlinux Arnaldo Carvalho de Melo
2011-03-01 17:03 ` [PATCH 6/6] perf top tui: Wait till the first sample to refresh the screen Arnaldo Carvalho de Melo
2011-03-02  7:07 ` [GIT PULL 0/6] perf/core top tui fixes and improvements Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1298999027-30673-2-git-send-email-acme@infradead.org \
    --to=acme@infradead.org \
    --cc=acme@redhat.com \
    --cc=efault@gmx.de \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    --cc=peterz@infradead.org \
    --cc=tzanussi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®