Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304807
b: refs/heads/master
c: e235f3f
h: refs/heads/master
i:
  304805: d16d163
  304803: 4979e0a
  304799: 991e46a
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo committed Apr 7, 2012
1 parent 57ded32 commit b6edcaa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 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: 058b4cc9af574c072988a38a7a5ee93df881e5aa
refs/heads/master: e235f3f3bf238eb092ad2fe7c35c6d7fd5dc2aeb
15 changes: 12 additions & 3 deletions trunk/tools/perf/util/ui/browsers/annotate.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ struct annotate_browser {
int nr_asm_entries;
int nr_entries;
bool hide_src_code;
bool use_offset;
};

struct objdump_line_rb_node {
Expand Down Expand Up @@ -82,10 +83,13 @@ static void annotate_browser__write(struct ui_browser *self, void *entry, int ro
slsmg_write_nstring(ol->line, width - 18);
else {
char bf[64];
u64 addr = ab->start + ol->offset;
int printed = scnprintf(bf, sizeof(bf), " %" PRIx64 ":", addr);
int color = -1;
u64 addr = ol->offset;
int printed, color = -1;

if (!ab->use_offset)
addr += ab->start;

printed = scnprintf(bf, sizeof(bf), " %" PRIx64 ":", addr);
if (change_color)
color = ui_browser__set_color(self, HE_COLORSET_ADDR);
slsmg_write_nstring(bf, printed);
Expand Down Expand Up @@ -250,6 +254,7 @@ static int annotate_browser__run(struct annotate_browser *self, int evidx,
struct symbol *sym = ms->sym;
const char *help = "<-/ESC: Exit, TAB/shift+TAB: Cycle hot lines, "
"H: Go to hottest line, ->/ENTER: Line action, "
"O: Toggle offset view, "
"S: Toggle source code view";
int key;

Expand Down Expand Up @@ -310,6 +315,10 @@ static int annotate_browser__run(struct annotate_browser *self, int evidx,
if (annotate_browser__toggle_source(self))
ui_helpline__puts(help);
continue;
case 'O':
case 'o':
self->use_offset = !self->use_offset;
continue;
case K_ENTER:
case K_RIGHT:
if (self->selection == NULL) {
Expand Down

0 comments on commit b6edcaa

Please sign in to comment.