All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL 0/2] perf tui improvements
@ 2010-05-17  0:10 Arnaldo Carvalho de Melo
  2010-05-17  0:10 ` [PATCH 1/2] perf tui: Make <- exit menus too Arnaldo Carvalho de Melo
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-05-17  0:10 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: linux-kernel, Arnaldo Carvalho de Melo

Hi Ingo,

        Please pull from:

git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 perf

Regards,

- Arnaldo

Arnaldo Carvalho de Melo (2):
  perf tui: Make <- exit menus too
  perf tui: Add help window to show key associations

 tools/perf/util/newt.c |   63 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 61 insertions(+), 2 deletions(-)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] perf tui: Make <- exit menus too
  2010-05-17  0:10 [GIT PULL 0/2] perf tui improvements Arnaldo Carvalho de Melo
@ 2010-05-17  0:10 ` Arnaldo Carvalho de Melo
  2010-05-17  0:10 ` [PATCH 2/2] perf tui: Add help window to show key associations Arnaldo Carvalho de Melo
  2010-05-17  6:18 ` [GIT PULL 0/2] perf tui improvements Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-05-17  0:10 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo,
	Frédéric Weisbecker, Mike Galbraith, Paul Mackerras,
	Peter Zijlstra, Tom Zanussi

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

In fact it is now added to the hot key list when newt_form__new is used,
allowing us to remove the explicit assignment in all its users.

The visible change is that <- will exit the menu that pops up when -> is
pressed (and Enter when callchains are not being used).

Suggested-by: Ingo Molnar <mingo@elte.hu>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/newt.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/newt.c b/tools/perf/util/newt.c
index 6974431..59a63e4 100644
--- a/tools/perf/util/newt.c
+++ b/tools/perf/util/newt.c
@@ -118,6 +118,7 @@ int browser__show_help(const char *format, va_list ap)
 
 static void newt_form__set_exit_keys(newtComponent self)
 {
+	newtFormAddHotKey(self, NEWT_KEY_LEFT);
 	newtFormAddHotKey(self, NEWT_KEY_ESCAPE);
 	newtFormAddHotKey(self, 'Q');
 	newtFormAddHotKey(self, 'q');
@@ -323,7 +324,6 @@ static int ui_browser__run(struct ui_browser *self, const char *title,
 	newtFormAddHotKey(self->form, NEWT_KEY_PGDN);
 	newtFormAddHotKey(self->form, NEWT_KEY_HOME);
 	newtFormAddHotKey(self->form, NEWT_KEY_END);
-	newtFormAddHotKey(self->form, NEWT_KEY_LEFT);
 
 	if (ui_browser__refresh_entries(self) < 0)
 		return -1;
@@ -757,7 +757,6 @@ static int hist_browser__populate(struct hist_browser *self, struct hists *hists
 	newtFormAddHotKey(self->form, 'T');
 	newtFormAddHotKey(self->form, 't');
 	newtFormAddHotKey(self->form, NEWT_KEY_RIGHT);
-	newtFormAddHotKey(self->form, NEWT_KEY_LEFT);
 	newtFormAddComponents(self->form, self->tree, NULL);
 	self->selection = newt__symbol_tree_get_current(self->tree);
 
-- 
1.6.2.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] perf tui: Add help window to show key associations
  2010-05-17  0:10 [GIT PULL 0/2] perf tui improvements Arnaldo Carvalho de Melo
  2010-05-17  0:10 ` [PATCH 1/2] perf tui: Make <- exit menus too Arnaldo Carvalho de Melo
@ 2010-05-17  0:10 ` Arnaldo Carvalho de Melo
  2010-05-17  6:18 ` [GIT PULL 0/2] perf tui improvements Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2010-05-17  0:10 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: linux-kernel, Arnaldo Carvalho de Melo,
	Frédéric Weisbecker, Mike Galbraith, Paul Mackerras,
	Peter Zijlstra, Tom Zanussi

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

Suggested-by: Ingo Molnar <mingo@elte.hu>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/newt.c |   60 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 0 deletions(-)

diff --git a/tools/perf/util/newt.c b/tools/perf/util/newt.c
index 59a63e4..2001d26 100644
--- a/tools/perf/util/newt.c
+++ b/tools/perf/util/newt.c
@@ -167,6 +167,48 @@ out_destroy_form:
 	return rc;
 }
 
+static int ui__help_window(const char *text)
+{
+	struct newtExitStruct es;
+	newtComponent tb, form = newt_form__new();
+	int rc = -1;
+	int max_len = 0, nr_lines = 0;
+	const char *t;
+
+	if (form == NULL)
+		return -1;
+
+	t = text;
+	while (1) {
+		const char *sep = strchr(t, '\n');
+		int len;
+
+		if (sep == NULL)
+			sep = strchr(t, '\0');
+		len = sep - t;
+		if (max_len < len)
+			max_len = len;
+		++nr_lines;
+		if (*sep == '\0')
+			break;
+		t = sep + 1;
+	}
+
+	tb = newtTextbox(0, 0, max_len, nr_lines, 0);
+	if (tb == NULL)
+		goto out_destroy_form;
+
+	newtTextboxSetText(tb, text);
+	newtFormAddComponent(form, tb);
+	newtCenteredWindow(max_len, nr_lines, NULL);
+	newtFormRun(form, &es);
+	newtPopWindow();
+	rc = 0;
+out_destroy_form:
+	newtFormDestroy(form);
+	return rc;
+}
+
 static bool dialog_yesno(const char *msg)
 {
 	/* newtWinChoice should really be accepting const char pointers... */
@@ -756,6 +798,10 @@ static int hist_browser__populate(struct hist_browser *self, struct hists *hists
 	newtFormAddHotKey(self->form, 'd');
 	newtFormAddHotKey(self->form, 'T');
 	newtFormAddHotKey(self->form, 't');
+	newtFormAddHotKey(self->form, '?');
+	newtFormAddHotKey(self->form, 'H');
+	newtFormAddHotKey(self->form, 'h');
+	newtFormAddHotKey(self->form, NEWT_KEY_F1);
 	newtFormAddHotKey(self->form, NEWT_KEY_RIGHT);
 	newtFormAddComponents(self->form, self->tree, NULL);
 	self->selection = newt__symbol_tree_get_current(self->tree);
@@ -842,6 +888,9 @@ int hists__browse(struct hists *self, const char *helpline, const char *input_na
 		dso = browser->selection->map ? browser->selection->map->dso : NULL;
 
 		if (es.reason == NEWT_EXIT_HOTKEY) {
+			if (es.u.key == NEWT_KEY_F1)
+				goto do_help;
+
 			switch (toupper(es.u.key)) {
 			case 'A':
 				goto do_annotate;
@@ -849,6 +898,17 @@ int hists__browse(struct hists *self, const char *helpline, const char *input_na
 				goto zoom_dso;
 			case 'T':
 				goto zoom_thread;
+			case 'H':
+			case '?':
+do_help:
+				ui__help_window("->        Zoom into DSO/Threads & Annotate current symbol\n"
+						"<-        Zoom out\n"
+						"a         Annotate current symbol\n"
+						"h/?/F1    Show this window\n"
+						"d         Zoom into current DSO\n"
+						"t         Zoom into current Thread\n"
+						"q/CTRL+C  Exit browser");
+				continue;
 			default:;
 			}
 			if (toupper(es.u.key) == 'Q' ||
-- 
1.6.2.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [GIT PULL 0/2] perf tui improvements
  2010-05-17  0:10 [GIT PULL 0/2] perf tui improvements Arnaldo Carvalho de Melo
  2010-05-17  0:10 ` [PATCH 1/2] perf tui: Make <- exit menus too Arnaldo Carvalho de Melo
  2010-05-17  0:10 ` [PATCH 2/2] perf tui: Add help window to show key associations Arnaldo Carvalho de Melo
@ 2010-05-17  6:18 ` Ingo Molnar
  2 siblings, 0 replies; 4+ messages in thread
From: Ingo Molnar @ 2010-05-17  6:18 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: linux-kernel


* Arnaldo Carvalho de Melo <acme@infradead.org> wrote:

> Hi Ingo,
> 
>         Please pull from:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 perf
> 
> Regards,
> 
> - Arnaldo
> 
> Arnaldo Carvalho de Melo (2):
>   perf tui: Make <- exit menus too
>   perf tui: Add help window to show key associations
> 
>  tools/perf/util/newt.c |   63 ++++++++++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 61 insertions(+), 2 deletions(-)

Pulled, thanks Arnaldo!

	Ingo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-05-17  6:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-17  0:10 [GIT PULL 0/2] perf tui improvements Arnaldo Carvalho de Melo
2010-05-17  0:10 ` [PATCH 1/2] perf tui: Make <- exit menus too Arnaldo Carvalho de Melo
2010-05-17  0:10 ` [PATCH 2/2] perf tui: Add help window to show key associations Arnaldo Carvalho de Melo
2010-05-17  6:18 ` [GIT PULL 0/2] perf tui improvements Ingo Molnar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.