Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269051
b: refs/heads/master
c: 234a537
h: refs/heads/master
i:
  269049: 827daab
  269047: a3e93f6
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo committed Oct 7, 2011
1 parent 188f400 commit 78b585e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e39622ceb169467dbe3d11491745aa1f7f3a92ad
refs/heads/master: 234a5375f6e7dee1f8bd5a7a2f5107c1c265ad8e
27 changes: 21 additions & 6 deletions trunk/tools/perf/util/ui/browsers/annotate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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@vger.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(&notes->lock);
Expand Down

0 comments on commit 78b585e

Please sign in to comment.