Lines Matching refs:al

431 	struct annotation_line *al;  in annotated_source__get_line()  local
433 list_for_each_entry(al, &src->source, node) { in annotated_source__get_line()
434 if (al->offset == offset) in annotated_source__get_line()
435 return al; in annotated_source__get_line()
442 struct annotation_line *al; in annotation__count_insn() local
445 al = annotated_source__get_line(notes->src, start); in annotation__count_insn()
446 if (al == NULL) in annotation__count_insn()
449 list_for_each_entry_from(al, &notes->src->source, node) { in annotation__count_insn()
450 if (al->offset == -1) in annotation__count_insn()
452 if ((u64)al->offset > end) in annotation__count_insn()
475 struct annotation_line *al; in annotation__count_and_fill() local
483 al = annotated_source__get_line(notes->src, start); in annotation__count_and_fill()
484 if (al == NULL) in annotation__count_and_fill()
487 list_for_each_entry_from(al, &notes->src->source, node) { in annotation__count_and_fill()
488 if (al->offset == -1) in annotation__count_and_fill()
490 if ((u64)al->offset > end) in annotation__count_and_fill()
492 if (al->cycles && al->cycles->ipc == 0.0) { in annotation__count_and_fill()
493 al->cycles->ipc = ipc; in annotation__count_and_fill()
528 struct annotation_line *al; in annotation__compute_ipc() local
530 al = annotated_source__get_line(notes->src, offset); in annotation__compute_ipc()
531 if (al && al->cycles == NULL) { in annotation__compute_ipc()
532 al->cycles = zalloc(sizeof(*al->cycles)); in annotation__compute_ipc()
533 if (al->cycles == NULL) { in annotation__compute_ipc()
540 if (al && ch->num_aggr) { in annotation__compute_ipc()
541 al->cycles->avg = ch->cycles_aggr / ch->num_aggr; in annotation__compute_ipc()
542 al->cycles->max = ch->cycles_max; in annotation__compute_ipc()
543 al->cycles->min = ch->cycles_min; in annotation__compute_ipc()
545 if (al && notes->branch->br_cntr) { in annotation__compute_ipc()
546 if (!al->br_cntr) { in annotation__compute_ipc()
547 al->br_cntr = calloc(br_cntr_nr, sizeof(u64)); in annotation__compute_ipc()
548 if (!al->br_cntr) { in annotation__compute_ipc()
553 al->num_aggr = ch->num_aggr; in annotation__compute_ipc()
554 al->br_cntr_nr = br_cntr_nr; in annotation__compute_ipc()
555 al->evsel = evsel; in annotation__compute_ipc()
556 memcpy(al->br_cntr, &notes->branch->br_cntr[offset * br_cntr_nr], in annotation__compute_ipc()
567 struct annotation_line *al; in annotation__compute_ipc() local
569 al = annotated_source__get_line(notes->src, offset); in annotation__compute_ipc()
570 if (al) { in annotation__compute_ipc()
571 zfree(&al->cycles); in annotation__compute_ipc()
572 zfree(&al->br_cntr); in annotation__compute_ipc()
653 void annotation_line__add(struct annotation_line *al, struct list_head *head) in annotation_line__add() argument
655 list_add_tail(&al->node, head); in annotation_line__add()
752 s64 offset = dl->al.offset; in disasm_line__print()
758 color_fprintf(stdout, annotate__asm_color(br), "%s", dl->al.line); in disasm_line__print()
778 annotation_line__print(struct annotation_line *al, struct annotation_print_data *apd, in annotation_line__print() argument
783 struct disasm_line *dl = container_of(al, struct disasm_line, al); in annotation_line__print()
789 if (al->offset != -1) { in annotation_line__print()
794 for (i = 0; i < al->data_nr; i++) { in annotation_line__print()
797 percent = annotation_data__percent(&al->data[i], in annotation_line__print()
804 if (al->data_nr > nr_percent) in annotation_line__print()
805 nr_percent = al->data_nr; in annotation_line__print()
820 if (queue == al) in annotation_line__print()
830 struct annotation_data *data = &al->data[i]; in annotation_line__print()
879 if (al->path) { in annotation_line__print()
880 if (!prev_line || strcmp(prev_line, al->path)) { in annotation_line__print()
881 color_fprintf(stdout, color, " // %s", al->path); in annotation_line__print()
882 prev_line = al->path; in annotation_line__print()
895 if (!*al->line) in annotation_line__print()
899 al->line_nr, al->line); in annotation_line__print()
945 struct annotation_line *al, *next; in annotation__calc_percent() local
948 list_for_each_entry(al, &notes->src->source, node) { in annotation__calc_percent()
952 if (al->offset == -1) in annotation__calc_percent()
955 next = annotation_line__next(al, &notes->src->source); in annotation__calc_percent()
961 BUG_ON(i >= al->data_nr); in annotation__calc_percent()
967 data = &al->data[i++]; in annotation__calc_percent()
969 calc_percent(notes, evsel, data, al->offset, end); in annotation__calc_percent()
1062 static void insert_source_line(struct rb_root *root, struct annotation_line *al) in insert_source_line() argument
1074 ret = strcmp(iter->path, al->path); in insert_source_line()
1076 for (i = 0; i < al->data_nr; i++) { in insert_source_line()
1077 iter->data[i].percent_sum += annotation_data__percent(&al->data[i], in insert_source_line()
1089 for (i = 0; i < al->data_nr; i++) { in insert_source_line()
1090 al->data[i].percent_sum = annotation_data__percent(&al->data[i], in insert_source_line()
1094 rb_link_node(&al->rb_node, parent, p); in insert_source_line()
1095 rb_insert_color(&al->rb_node, root); in insert_source_line()
1111 static void __resort_source_line(struct rb_root *root, struct annotation_line *al) in __resort_source_line() argument
1121 if (cmp_source_line(al, iter)) in __resort_source_line()
1127 rb_link_node(&al->rb_node, parent, p); in __resort_source_line()
1128 rb_insert_color(&al->rb_node, root); in __resort_source_line()
1133 struct annotation_line *al; in resort_source_line() local
1140 al = rb_entry(node, struct annotation_line, rb_node); in resort_source_line()
1144 __resort_source_line(dest_root, al); in resort_source_line()
1151 struct annotation_line *al; in print_summary() local
1169 al = rb_entry(node, struct annotation_line, rb_node); in print_summary()
1170 for (i = 0; i < al->data_nr; i++) { in print_summary()
1171 percent = al->data[i].percent_sum; in print_summary()
1179 path = al->path; in print_summary()
1372 struct annotation_line *al; in symbol__annotate_fprintf2() local
1374 list_for_each_entry(al, &notes->src->source, node) { in symbol__annotate_fprintf2()
1375 if (annotation_line__filter(al)) in symbol__annotate_fprintf2()
1377 annotation_line__write(al, notes, &wops); in symbol__annotate_fprintf2()
1428 struct annotation_line *al; in symbol__annotate_decay_histogram() local
1431 list_for_each_entry(al, &notes->src->source, node) { in symbol__annotate_decay_histogram()
1434 if (al->offset == -1) in symbol__annotate_decay_histogram()
1437 entry = annotated_source__hist_entry(notes->src, evsel, al->offset); in symbol__annotate_decay_histogram()
1448 struct annotation_line *al, *n; in annotated_source__purge() local
1450 list_for_each_entry_safe(al, n, &as->source, node) { in annotated_source__purge()
1451 list_del_init(&al->node); in annotated_source__purge()
1452 disasm_line__free(disasm_line(al)); in annotated_source__purge()
1461 if (dl->al.offset == -1) in disasm_line__fprintf()
1462 return fprintf(fp, "%s\n", dl->al.line); in disasm_line__fprintf()
1464 printed = fprintf(fp, "%#" PRIx64 " %s", dl->al.offset, dl->ins.name); in disasm_line__fprintf()
1479 list_for_each_entry(pos, head, al.node) in disasm__fprintf()
1498 struct annotation_line *al; in annotation__mark_jump_targets() local
1504 list_for_each_entry(al, &notes->src->source, node) { in annotation__mark_jump_targets()
1508 dl = disasm_line(al); in annotation__mark_jump_targets()
1529 struct annotation_line *al; in annotation__set_index() local
1536 list_for_each_entry(al, &src->source, node) { in annotation__set_index()
1537 size_t line_len = strlen(al->line); in annotation__set_index()
1541 al->idx = src->nr_entries++; in annotation__set_index()
1542 if (al->offset != -1) in annotation__set_index()
1543 al->idx_asm = src->nr_asm_entries++; in annotation__set_index()
1545 al->idx_asm = -1; in annotation__set_index()
1561 struct annotation_line *al; in annotation__max_ins_name() local
1563 list_for_each_entry(al, &notes->src->source, node) { in annotation__max_ins_name()
1564 if (al->offset == -1) in annotation__max_ins_name()
1567 len = strlen(disasm_line(al)->ins.name); in annotation__max_ins_name()
1615 struct annotation_line *al; in annotation__calc_lines() local
1618 list_for_each_entry(al, &notes->src->source, node) { in annotation__calc_lines()
1623 for (i = 0; i < al->data_nr; i++) { in annotation__calc_lines()
1626 percent = annotation_data__percent(&al->data[i], in annotation__calc_lines()
1637 al->path = get_srcline(map__dso(ms->map), addr + al->offset, NULL, in annotation__calc_lines()
1638 false, true, ms->sym->start + al->offset); in annotation__calc_lines()
1639 insert_source_line(&tmp_root, al); in annotation__calc_lines()
1727 static double annotation_line__max_percent(struct annotation_line *al, in annotation_line__max_percent() argument
1733 for (i = 0; i < al->data_nr; i++) { in annotation_line__max_percent()
1736 percent = annotation_data__percent(&al->data[i], in annotation_line__max_percent()
1757 fwd = dl->ops.target.offset > dl->al.offset; in disasm_line__write()
1938 static void __annotation_line__write(struct annotation_line *al, struct annotation *notes, in __annotation_line__write() argument
1948 double percent_max = annotation_line__max_percent(al, percent_type); in __annotation_line__write()
1955 if (first_line && (al->offset == -1 || percent_max == 0.0)) { in __annotation_line__write()
1956 if (notes->branch && al->cycles) { in __annotation_line__write()
1957 if (al->cycles->ipc == 0.0 && al->cycles->avg == 0) in __annotation_line__write()
1963 if (al->offset != -1 && percent_max != 0.0) { in __annotation_line__write()
1966 for (i = 0; i < al->data_nr; i++) { in __annotation_line__write()
1969 percent = annotation_data__percent(&al->data[i], percent_type); in __annotation_line__write()
1973 obj__printf(obj, "%11" PRIu64 " ", al->data[i].he.period); in __annotation_line__write()
1976 al->data[i].he.nr_samples); in __annotation_line__write()
1994 if (al->cycles && al->cycles->ipc) in __annotation_line__write()
1995 obj__printf(obj, "%*.2f ", ANNOTATION__IPC_WIDTH - 1, al->cycles->ipc); in __annotation_line__write()
2002 if (al->cycles && al->cycles->avg) in __annotation_line__write()
2004 ANNOTATION__CYCLES_WIDTH - 1, al->cycles->avg); in __annotation_line__write()
2013 if (al->cycles) { in __annotation_line__write()
2018 al->cycles->avg, al->cycles->min, in __annotation_line__write()
2019 al->cycles->max); in __annotation_line__write()
2042 if (!annotation_br_cntr_entry(&buf, al->br_cntr_nr, al->br_cntr, in __annotation_line__write()
2043 al->num_aggr, al->evsel)) { in __annotation_line__write()
2050 if (show_title && !*al->line) { in __annotation_line__write()
2058 if (!*al->line) in __annotation_line__write()
2060 else if (al->offset == -1) { in __annotation_line__write()
2061 if (al->line_nr && annotate_opts.show_linenr) in __annotation_line__write()
2063 notes->src->widths.addr + 1, al->line_nr); in __annotation_line__write()
2068 obj__printf(obj, "%-*s", width - printed - pcnt_width - cycles_width + 1, al->line); in __annotation_line__write()
2070 u64 addr = al->offset; in __annotation_line__write()
2079 if (al->jump_sources && in __annotation_line__write()
2085 al->jump_sources); in __annotation_line__write()
2086 prev = obj__set_jumps_percent_color(obj, al->jump_sources, in __annotation_line__write()
2094 } else if (ins__is_call(&disasm_line(al)->ins) && in __annotation_line__write()
2111 disasm_line__write(disasm_line(al), notes, obj, bf, sizeof(bf), obj__printf, obj__write_graph); in __annotation_line__write()
2118 void annotation_line__write(struct annotation_line *al, struct annotation *notes, in annotation_line__write() argument
2121 __annotation_line__write(al, notes, wops->first_line, wops->current_entry, in annotation_line__write()
2555 list_for_each_entry(dl, &notes->src->source, al.node) { in find_disasm_line()
2556 if (dl->al.offset == -1) in find_disasm_line()
2559 if (sym->start + dl->al.offset == ip) { in find_disasm_line()
2630 if (curr == list_first_entry(sources, struct disasm_line, al.node)) in annotation__prev_asm_line()
2633 prev = list_prev_entry(curr, al.node); in annotation__prev_asm_line()
2634 while (prev->al.offset == -1 && in annotation__prev_asm_line()
2635 prev != list_first_entry(sources, struct disasm_line, al.node)) in annotation__prev_asm_line()
2636 prev = list_prev_entry(prev, al.node); in annotation__prev_asm_line()
2638 if (prev->al.offset == -1) in annotation__prev_asm_line()
2650 if (curr == list_last_entry(sources, struct disasm_line, al.node)) in annotation__next_asm_line()
2653 next = list_next_entry(curr, al.node); in annotation__next_asm_line()
2654 while (next->al.offset == -1 && in annotation__next_asm_line()
2655 next != list_last_entry(sources, struct disasm_line, al.node)) in annotation__next_asm_line()
2656 next = list_next_entry(next, al.node); in annotation__next_asm_line()
2658 if (next->al.offset == -1) in annotation__next_asm_line()
2683 addr = ip + (next->al.offset - dl->al.offset) + offset; in annotate_calc_pcrel()
2737 .ip = ms->sym->start + dl->al.offset, in __hist_entry__get_data_type()
2866 if (dl->al.offset > 0) { in hist_entry__get_data_type()
2909 s64 begin_offset = link->bb->begin->al.offset; in basic_block_has_offset()
2910 s64 end_offset = link->bb->end->al.offset; in basic_block_has_offset()
2921 s64 offset = dl->al.offset; in is_new_basic_block()
2975 if (basic_block_has_offset(&bb_data->visited, dl->al.offset)) in process_basic_block()
2979 struct disasm_line, al.node); in process_basic_block()
2980 if (last_dl->al.offset == -1) in process_basic_block()
2986 list_for_each_entry_from(dl, &notes->src->source, al.node) { in process_basic_block()
2988 if (dl->al.offset == -1) in process_basic_block()
2991 if (sym->start + dl->al.offset == target) { in process_basic_block()