aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-10-06 08:45:29 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-10-07 16:00:42 -0400
commit234a5375f6e7dee1f8bd5a7a2f5107c1c265ad8e (patch)
tree37ad38d0d639fce72b1811ebac6cdd7fddc6b19e /tools
parente39622ceb169467dbe3d11491745aa1f7f3a92ad (diff)
perf annotate browser: Use -> to navigate on assembly lines
And add better explanations when the line isn't actionable, like non assembly lines and on other instructions. Suggested-by: Ingo Molnar <mingo@elte.hu> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-375n844b5wra7lgq08ou153j@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/ui/browsers/annotate.c27
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 77421bab8fdd..674b55e686fd 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,
184 int key; 184 int key;
185 185
186 if (ui_browser__show(&self->b, sym->name, 186 if (ui_browser__show(&self->b, sym->name,
187 "<-, -> or ESC: exit, TAB/shift+TAB: " 187 "<- or ESC: exit, TAB/shift+TAB: "
188 "cycle hottest lines, H: Hottest") < 0) 188 "cycle hottest lines, H: Hottest, -> Line action") < 0)
189 return -1; 189 return -1;
190 190
191 ui_browser__add_exit_keys(&self->b, exit_keys); 191 ui_browser__add_exit_keys(&self->b, exit_keys);
@@ -245,24 +245,39 @@ static int annotate_browser__run(struct annotate_browser *self, int evidx,
245 nd = self->curr_hot; 245 nd = self->curr_hot;
246 break; 246 break;
247 case NEWT_KEY_ENTER: 247 case NEWT_KEY_ENTER:
248 if (self->selection != NULL) { 248 case NEWT_KEY_RIGHT:
249 if (self->selection == NULL) {
250 ui_helpline__puts("Huh? No selection. Report to linux-kernel@vger.kernel.org");
251 continue;
252 }
253
254 if (self->selection->offset == -1) {
255 ui_helpline__puts("Actions are only available for assembly lines.");
256 continue;
257 } else {
249 char *s = strstr(self->selection->line, "callq "); 258 char *s = strstr(self->selection->line, "callq ");
250 struct annotation *notes; 259 struct annotation *notes;
251 struct symbol *target; 260 struct symbol *target;
252 u64 ip; 261 u64 ip;
253 262
254 if (s == NULL) 263 if (s == NULL) {
264 ui_helpline__puts("Actions are only available for the 'callq' instruction.");
255 continue; 265 continue;
266 }
256 267
257 s = strchr(s, ' '); 268 s = strchr(s, ' ');
258 if (s++ == NULL) 269 if (s++ == NULL) {
270 ui_helpline__puts("Invallid callq instruction.");
259 continue; 271 continue;
272 }
260 273
261 ip = strtoull(s, NULL, 16); 274 ip = strtoull(s, NULL, 16);
262 ip = ms->map->map_ip(ms->map, ip); 275 ip = ms->map->map_ip(ms->map, ip);
263 target = map__find_symbol(ms->map, ip, NULL); 276 target = map__find_symbol(ms->map, ip, NULL);
264 if (target == NULL) 277 if (target == NULL) {
278 ui_helpline__puts("The called function was not found.");
265 continue; 279 continue;
280 }
266 281
267 notes = symbol__annotation(target); 282 notes = symbol__annotation(target);
268 pthread_mutex_lock(&notes->lock); 283 pthread_mutex_lock(&notes->lock);