aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/browsers/annotate.c
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@kernel.org>2017-10-11 11:01:55 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-11-16 12:49:48 -0500
commit9213afbdf9562cd108e7ed03bd960d8acdfb49c1 (patch)
tree09b06fec95ca9d160fdd6dd70e80464dadc7a459 /tools/perf/ui/browsers/annotate.c
parenta5ef27020b4bc0785fabb2591eb670d3bc641257 (diff)
perf annotate browser: Use struct annotation_line in find functions
Use struct annotation_line in find functions: annotate_browser__find_string annotate_browser__find_string_reverse 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-33-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.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index fb83deb8c909..8f75e56aedc2 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -606,23 +606,23 @@ static bool annotate_browser__jump(struct annotate_browser *browser)
606} 606}
607 607
608static 608static
609struct disasm_line *annotate_browser__find_string(struct annotate_browser *browser, 609struct annotation_line *annotate_browser__find_string(struct annotate_browser *browser,
610 char *s, s64 *idx) 610 char *s, s64 *idx)
611{ 611{
612 struct map_symbol *ms = browser->b.priv; 612 struct map_symbol *ms = browser->b.priv;
613 struct symbol *sym = ms->sym; 613 struct symbol *sym = ms->sym;
614 struct annotation *notes = symbol__annotation(sym); 614 struct annotation *notes = symbol__annotation(sym);
615 struct disasm_line *pos = disasm_line(browser->selection); 615 struct annotation_line *al = browser->selection;
616 616
617 *idx = browser->b.index; 617 *idx = browser->b.index;
618 list_for_each_entry_continue(pos, &notes->src->source, al.node) { 618 list_for_each_entry_continue(al, &notes->src->source, node) {
619 if (disasm_line__filter(&browser->b, &pos->al.node)) 619 if (disasm_line__filter(&browser->b, &al->node))
620 continue; 620 continue;
621 621
622 ++*idx; 622 ++*idx;
623 623
624 if (pos->al.line && strstr(pos->al.line, s) != NULL) 624 if (al->line && strstr(al->line, s) != NULL)
625 return pos; 625 return al;
626 } 626 }
627 627
628 return NULL; 628 return NULL;
@@ -630,38 +630,38 @@ struct disasm_line *annotate_browser__find_string(struct annotate_browser *brows
630 630
631static bool __annotate_browser__search(struct annotate_browser *browser) 631static bool __annotate_browser__search(struct annotate_browser *browser)
632{ 632{
633 struct disasm_line *dl; 633 struct annotation_line *al;
634 s64 idx; 634 s64 idx;
635 635
636 dl = annotate_browser__find_string(browser, browser->search_bf, &idx); 636 al = annotate_browser__find_string(browser, browser->search_bf, &idx);
637 if (dl == NULL) { 637 if (al == NULL) {
638 ui_helpline__puts("String not found!"); 638 ui_helpline__puts("String not found!");
639 return false; 639 return false;
640 } 640 }
641 641
642 annotate_browser__set_top(browser, dl, idx); 642 annotate_browser__set_top(browser, disasm_line(al), idx);
643 browser->searching_backwards = false; 643 browser->searching_backwards = false;
644 return true; 644 return true;
645} 645}
646 646
647static 647static
648struct disasm_line *annotate_browser__find_string_reverse(struct annotate_browser *browser, 648struct annotation_line *annotate_browser__find_string_reverse(struct annotate_browser *browser,
649 char *s, s64 *idx) 649 char *s, s64 *idx)
650{ 650{
651 struct map_symbol *ms = browser->b.priv; 651 struct map_symbol *ms = browser->b.priv;
652 struct symbol *sym = ms->sym; 652 struct symbol *sym = ms->sym;
653 struct annotation *notes = symbol__annotation(sym); 653 struct annotation *notes = symbol__annotation(sym);
654 struct disasm_line *pos = disasm_line(browser->selection); 654 struct annotation_line *al = browser->selection;
655 655
656 *idx = browser->b.index; 656 *idx = browser->b.index;
657 list_for_each_entry_continue_reverse(pos, &notes->src->source, al.node) { 657 list_for_each_entry_continue_reverse(al, &notes->src->source, node) {
658 if (disasm_line__filter(&browser->b, &pos->al.node)) 658 if (disasm_line__filter(&browser->b, &al->node))
659 continue; 659 continue;
660 660
661 --*idx; 661 --*idx;
662 662
663 if (pos->al.line && strstr(pos->al.line, s) != NULL) 663 if (al->line && strstr(al->line, s) != NULL)
664 return pos; 664 return al;
665 } 665 }
666 666
667 return NULL; 667 return NULL;
@@ -669,16 +669,16 @@ struct disasm_line *annotate_browser__find_string_reverse(struct annotate_browse
669 669
670static bool __annotate_browser__search_reverse(struct annotate_browser *browser) 670static bool __annotate_browser__search_reverse(struct annotate_browser *browser)
671{ 671{
672 struct disasm_line *dl; 672 struct annotation_line *al;
673 s64 idx; 673 s64 idx;
674 674
675 dl = annotate_browser__find_string_reverse(browser, browser->search_bf, &idx); 675 al = annotate_browser__find_string_reverse(browser, browser->search_bf, &idx);
676 if (dl == NULL) { 676 if (al == NULL) {
677 ui_helpline__puts("String not found!"); 677 ui_helpline__puts("String not found!");
678 return false; 678 return false;
679 } 679 }
680 680
681 annotate_browser__set_top(browser, dl, idx); 681 annotate_browser__set_top(browser, disasm_line(al), idx);
682 browser->searching_backwards = true; 682 browser->searching_backwards = true;
683 return true; 683 return true;
684} 684}