[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1317921758-4154-12-git-send-email-acme@infradead.org>
Date: Thu, 6 Oct 2011 14:22:34 -0300
From: Arnaldo Carvalho de Melo <acme@...radead.org>
To: Ingo Molnar <mingo@...e.hu>
Cc: linux-kernel@...r.kernel.org,
Arnaldo Carvalho de Melo <acme@...hat.com>,
David Ahern <dsahern@...il.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Mike Galbraith <efault@....de>,
Paul Mackerras <paulus@...ba.org>,
Peter Zijlstra <peterz@...radead.org>,
Stephane Eranian <eranian@...gle.com>
Subject: [PATCH 11/15] perf annotate browser: Use -> to navigate on assembly lines
From: Arnaldo Carvalho de Melo <acme@...hat.com>
And add better explanations when the line isn't actionable, like non
assembly lines and on other instructions.
Suggested-by: Ingo Molnar <mingo@...e.hu>
Cc: David Ahern <dsahern@...il.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Mike Galbraith <efault@....de>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Stephane Eranian <eranian@...gle.com>
Link: http://lkml.kernel.org/n/tip-375n844b5wra7lgq08ou153j@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/ui/browsers/annotate.c | 27 +++++++++++++++++++++------
1 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/tools/perf/util/ui/browsers/annotate.c b/tools/perf/util/ui/browsers/annotate.c
index 77421ba..674b55e 100644
--- a/tools/perf/util/ui/browsers/annotate.c
+++ b/tools/perf/util/ui/browsers/annotate.c
@@ -184,8 +184,8 @@ static int annotate_browser__run(struct annotate_browser *self, int evidx,
int key;
if (ui_browser__show(&self->b, sym->name,
- "<-, -> or ESC: exit, TAB/shift+TAB: "
- "cycle hottest lines, H: Hottest") < 0)
+ "<- or ESC: exit, TAB/shift+TAB: "
+ "cycle hottest lines, H: Hottest, -> Line action") < 0)
return -1;
ui_browser__add_exit_keys(&self->b, exit_keys);
@@ -245,24 +245,39 @@ static int annotate_browser__run(struct annotate_browser *self, int evidx,
nd = self->curr_hot;
break;
case NEWT_KEY_ENTER:
- if (self->selection != NULL) {
+ case NEWT_KEY_RIGHT:
+ if (self->selection == NULL) {
+ ui_helpline__puts("Huh? No selection. Report to linux-kernel@...r.kernel.org");
+ continue;
+ }
+
+ if (self->selection->offset == -1) {
+ ui_helpline__puts("Actions are only available for assembly lines.");
+ continue;
+ } else {
char *s = strstr(self->selection->line, "callq ");
struct annotation *notes;
struct symbol *target;
u64 ip;
- if (s == NULL)
+ if (s == NULL) {
+ ui_helpline__puts("Actions are only available for the 'callq' instruction.");
continue;
+ }
s = strchr(s, ' ');
- if (s++ == NULL)
+ if (s++ == NULL) {
+ ui_helpline__puts("Invallid callq instruction.");
continue;
+ }
ip = strtoull(s, NULL, 16);
ip = ms->map->map_ip(ms->map, ip);
target = map__find_symbol(ms->map, ip, NULL);
- if (target == NULL)
+ if (target == NULL) {
+ ui_helpline__puts("The called function was not found.");
continue;
+ }
notes = symbol__annotation(target);
pthread_mutex_lock(¬es->lock);
--
1.6.2.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists