diff options
author | Jiri Olsa <jolsa@kernel.org> | 2017-10-11 11:01:56 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-11-16 12:49:49 -0500 |
commit | ec03a77d7d28a2c2de246f67322c5d916852dd9d (patch) | |
tree | d1608fde15aff97a55b1b731ab82589fc48c64a5 /tools/perf/ui/browsers/annotate.c | |
parent | 9213afbdf9562cd108e7ed03bd960d8acdfb49c1 (diff) |
perf annotate browser: Use struct annotation_line in browser top
Use struct annotation_line in browser::b::top.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20171011150158.11895-34-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/browsers/annotate.c')
-rw-r--r-- | tools/perf/ui/browsers/annotate.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index 8f75e56aedc2..f0f27cf9db85 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c | |||
@@ -390,7 +390,7 @@ static void disasm_rb_tree__insert(struct rb_root *root, struct annotation_line | |||
390 | } | 390 | } |
391 | 391 | ||
392 | static void annotate_browser__set_top(struct annotate_browser *browser, | 392 | static void annotate_browser__set_top(struct annotate_browser *browser, |
393 | struct disasm_line *pos, u32 idx) | 393 | struct annotation_line *pos, u32 idx) |
394 | { | 394 | { |
395 | unsigned back; | 395 | unsigned back; |
396 | 396 | ||
@@ -399,16 +399,16 @@ static void annotate_browser__set_top(struct annotate_browser *browser, | |||
399 | browser->b.top_idx = browser->b.index = idx; | 399 | browser->b.top_idx = browser->b.index = idx; |
400 | 400 | ||
401 | while (browser->b.top_idx != 0 && back != 0) { | 401 | while (browser->b.top_idx != 0 && back != 0) { |
402 | pos = list_entry(pos->al.node.prev, struct disasm_line, al.node); | 402 | pos = list_entry(pos->node.prev, struct annotation_line, node); |
403 | 403 | ||
404 | if (disasm_line__filter(&browser->b, &pos->al.node)) | 404 | if (disasm_line__filter(&browser->b, &pos->node)) |
405 | continue; | 405 | continue; |
406 | 406 | ||
407 | --browser->b.top_idx; | 407 | --browser->b.top_idx; |
408 | --back; | 408 | --back; |
409 | } | 409 | } |
410 | 410 | ||
411 | browser->b.top = &pos->al; | 411 | browser->b.top = pos; |
412 | browser->b.navkeypressed = true; | 412 | browser->b.navkeypressed = true; |
413 | } | 413 | } |
414 | 414 | ||
@@ -416,11 +416,11 @@ static void annotate_browser__set_rb_top(struct annotate_browser *browser, | |||
416 | struct rb_node *nd) | 416 | struct rb_node *nd) |
417 | { | 417 | { |
418 | struct browser_line *bpos; | 418 | struct browser_line *bpos; |
419 | struct disasm_line *pos; | 419 | struct annotation_line *pos; |
420 | u32 idx; | 420 | u32 idx; |
421 | 421 | ||
422 | pos = rb_entry(nd, struct disasm_line, al.rb_node); | 422 | pos = rb_entry(nd, struct annotation_line, rb_node); |
423 | bpos = browser_line(&pos->al); | 423 | bpos = browser_line(pos); |
424 | 424 | ||
425 | idx = bpos->idx; | 425 | idx = bpos->idx; |
426 | if (annotate_browser__opts.hide_src_code) | 426 | if (annotate_browser__opts.hide_src_code) |
@@ -472,13 +472,13 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser, | |||
472 | 472 | ||
473 | static bool annotate_browser__toggle_source(struct annotate_browser *browser) | 473 | static bool annotate_browser__toggle_source(struct annotate_browser *browser) |
474 | { | 474 | { |
475 | struct disasm_line *dl; | 475 | struct annotation_line *al; |
476 | struct browser_line *bl; | 476 | struct browser_line *bl; |
477 | off_t offset = browser->b.index - browser->b.top_idx; | 477 | off_t offset = browser->b.index - browser->b.top_idx; |
478 | 478 | ||
479 | browser->b.seek(&browser->b, offset, SEEK_CUR); | 479 | browser->b.seek(&browser->b, offset, SEEK_CUR); |
480 | dl = list_entry(browser->b.top, struct disasm_line, al.node); | 480 | al = list_entry(browser->b.top, struct annotation_line, node); |
481 | bl = browser_line(&dl->al); | 481 | bl = browser_line(al); |
482 | 482 | ||
483 | if (annotate_browser__opts.hide_src_code) { | 483 | if (annotate_browser__opts.hide_src_code) { |
484 | if (bl->idx_asm < offset) | 484 | if (bl->idx_asm < offset) |
@@ -600,7 +600,7 @@ static bool annotate_browser__jump(struct annotate_browser *browser) | |||
600 | return true; | 600 | return true; |
601 | } | 601 | } |
602 | 602 | ||
603 | annotate_browser__set_top(browser, dl, idx); | 603 | annotate_browser__set_top(browser, &dl->al, idx); |
604 | 604 | ||
605 | return true; | 605 | return true; |
606 | } | 606 | } |
@@ -639,7 +639,7 @@ static bool __annotate_browser__search(struct annotate_browser *browser) | |||
639 | return false; | 639 | return false; |
640 | } | 640 | } |
641 | 641 | ||
642 | annotate_browser__set_top(browser, disasm_line(al), idx); | 642 | annotate_browser__set_top(browser, al, idx); |
643 | browser->searching_backwards = false; | 643 | browser->searching_backwards = false; |
644 | return true; | 644 | return true; |
645 | } | 645 | } |
@@ -678,7 +678,7 @@ static bool __annotate_browser__search_reverse(struct annotate_browser *browser) | |||
678 | return false; | 678 | return false; |
679 | } | 679 | } |
680 | 680 | ||
681 | annotate_browser__set_top(browser, disasm_line(al), idx); | 681 | annotate_browser__set_top(browser, al, idx); |
682 | browser->searching_backwards = true; | 682 | browser->searching_backwards = true; |
683 | return true; | 683 | return true; |
684 | } | 684 | } |