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, ¬es->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, ¬es->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, ¬es->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()
780 annotation_line__print(struct annotation_line *al, struct annotation_print_data *apd, in annotation_line__print() argument
785 struct disasm_line *dl = container_of(al, struct disasm_line, al); in annotation_line__print()
791 if (al->offset != -1) { in annotation_line__print()
796 for (i = 0; i < al->data_nr; i++) { in annotation_line__print()
799 percent = annotation_data__percent(&al->data[i], in annotation_line__print()
806 if (al->data_nr > nr_percent) in annotation_line__print()
807 nr_percent = al->data_nr; in annotation_line__print()
822 if (queue == al) in annotation_line__print()
832 struct annotation_data *data = &al->data[i]; in annotation_line__print()
881 if (al->path) { in annotation_line__print()
882 if (!prev_line || strcmp(prev_line, al->path)) { in annotation_line__print()
883 color_fprintf(stdout, color, " // %s", al->path); in annotation_line__print()
884 prev_line = al->path; in annotation_line__print()
897 if (!*al->line) in annotation_line__print()
901 al->line_nr, al->line); in annotation_line__print()
947 struct annotation_line *al, *next; in annotation__calc_percent() local
950 list_for_each_entry(al, ¬es->src->source, node) { in annotation__calc_percent()
954 if (al->offset == -1) in annotation__calc_percent()
957 next = annotation_line__next(al, ¬es->src->source); in annotation__calc_percent()
963 BUG_ON(i >= al->data_nr); in annotation__calc_percent()
969 data = &al->data[i++]; in annotation__calc_percent()
971 calc_percent(notes, evsel, data, al->offset, end); in annotation__calc_percent()
1063 static void insert_source_line(struct rb_root *root, struct annotation_line *al) in insert_source_line() argument
1075 ret = strcmp(iter->path, al->path); in insert_source_line()
1077 for (i = 0; i < al->data_nr; i++) { in insert_source_line()
1078 iter->data[i].percent_sum += annotation_data__percent(&al->data[i], in insert_source_line()
1090 for (i = 0; i < al->data_nr; i++) { in insert_source_line()
1091 al->data[i].percent_sum = annotation_data__percent(&al->data[i], in insert_source_line()
1095 rb_link_node(&al->rb_node, parent, p); in insert_source_line()
1096 rb_insert_color(&al->rb_node, root); in insert_source_line()
1112 static void __resort_source_line(struct rb_root *root, struct annotation_line *al) in __resort_source_line() argument
1122 if (cmp_source_line(al, iter)) in __resort_source_line()
1128 rb_link_node(&al->rb_node, parent, p); in __resort_source_line()
1129 rb_insert_color(&al->rb_node, root); in __resort_source_line()
1134 struct annotation_line *al; in resort_source_line() local
1141 al = rb_entry(node, struct annotation_line, rb_node); in resort_source_line()
1145 __resort_source_line(dest_root, al); in resort_source_line()
1152 struct annotation_line *al; in print_summary() local
1170 al = rb_entry(node, struct annotation_line, rb_node); in print_summary()
1171 for (i = 0; i < al->data_nr; i++) { in print_summary()
1172 percent = al->data[i].percent_sum; in print_summary()
1180 path = al->path; in print_summary()
1373 struct annotation_line *al; in symbol__annotate_fprintf2() local
1380 list_for_each_entry(al, ¬es->src->source, node) { in symbol__annotate_fprintf2()
1381 if (annotation_line__filter(al)) in symbol__annotate_fprintf2()
1383 annotation_line__write(al, notes, &wops, apd); in symbol__annotate_fprintf2()
1442 struct annotation_line *al; in symbol__annotate_decay_histogram() local
1445 list_for_each_entry(al, ¬es->src->source, node) { in symbol__annotate_decay_histogram()
1448 if (al->offset == -1) in symbol__annotate_decay_histogram()
1451 entry = annotated_source__hist_entry(notes->src, evsel, al->offset); in symbol__annotate_decay_histogram()
1462 struct annotation_line *al, *n; in annotated_source__purge() local
1464 list_for_each_entry_safe(al, n, &as->source, node) { in annotated_source__purge()
1465 list_del_init(&al->node); in annotated_source__purge()
1466 disasm_line__free(disasm_line(al)); in annotated_source__purge()
1475 if (dl->al.offset == -1) in disasm_line__fprintf()
1476 return fprintf(fp, "%s\n", dl->al.line); in disasm_line__fprintf()
1478 printed = fprintf(fp, "%#" PRIx64 " %s", dl->al.offset, dl->ins.name); in disasm_line__fprintf()
1493 list_for_each_entry(pos, head, al.node) in disasm__fprintf()
1512 struct annotation_line *al; in annotation__mark_jump_targets() local
1518 list_for_each_entry(al, ¬es->src->source, node) { in annotation__mark_jump_targets()
1522 dl = disasm_line(al); in annotation__mark_jump_targets()
1543 struct annotation_line *al; in annotation__set_index() local
1550 list_for_each_entry(al, &src->source, node) { in annotation__set_index()
1551 size_t line_len = strlen(al->line); in annotation__set_index()
1555 al->idx = src->nr_entries++; in annotation__set_index()
1556 if (al->offset != -1) in annotation__set_index()
1557 al->idx_asm = src->nr_asm_entries++; in annotation__set_index()
1559 al->idx_asm = -1; in annotation__set_index()
1575 struct annotation_line *al; in annotation__max_ins_name() local
1577 list_for_each_entry(al, ¬es->src->source, node) { in annotation__max_ins_name()
1578 if (al->offset == -1) in annotation__max_ins_name()
1581 len = strlen(disasm_line(al)->ins.name); in annotation__max_ins_name()
1629 struct annotation_line *al; in annotation__calc_lines() local
1632 list_for_each_entry(al, ¬es->src->source, node) { in annotation__calc_lines()
1637 for (i = 0; i < al->data_nr; i++) { in annotation__calc_lines()
1640 percent = annotation_data__percent(&al->data[i], in annotation__calc_lines()
1651 al->path = get_srcline(map__dso(ms->map), addr + al->offset, NULL, in annotation__calc_lines()
1652 false, true, ms->sym->start + al->offset); in annotation__calc_lines()
1653 insert_source_line(&tmp_root, al); in annotation__calc_lines()
1745 static double annotation_line__max_percent(struct annotation_line *al, in annotation_line__max_percent() argument
1751 for (i = 0; i < al->data_nr; i++) { in annotation_line__max_percent()
1754 percent = annotation_data__percent(&al->data[i], in annotation_line__max_percent()
1775 fwd = dl->ops.target.offset > dl->al.offset; in disasm_line__write()
1977 hashmap__find(apd->type_hash, dl->al.offset, &entry); in disasm_line__snprint_type_info()
1992 hashmap__add(apd->type_hash, dl->al.offset, entry); in disasm_line__snprint_type_info()
2011 void annotation_line__write(struct annotation_line *al, struct annotation *notes, in annotation_line__write() argument
2017 double percent_max = annotation_line__max_percent(al, annotate_opts.percent_type); in annotation_line__write()
2031 if (wops->first_line && (al->offset == -1 || percent_max == 0.0)) { in annotation_line__write()
2032 if (notes->branch && al->cycles) { in annotation_line__write()
2033 if (al->cycles->ipc == 0.0 && al->cycles->avg == 0) in annotation_line__write()
2039 if (al->offset != -1 && percent_max != 0.0) { in annotation_line__write()
2042 for (i = 0; i < al->data_nr; i++) { in annotation_line__write()
2045 percent = annotation_data__percent(&al->data[i], in annotation_line__write()
2050 obj__printf(obj, "%11" PRIu64 " ", al->data[i].he.period); in annotation_line__write()
2053 al->data[i].he.nr_samples); in annotation_line__write()
2072 if (al->cycles && al->cycles->ipc) in annotation_line__write()
2073 obj__printf(obj, "%*.2f ", ANNOTATION__IPC_WIDTH - 1, al->cycles->ipc); in annotation_line__write()
2080 if (al->cycles && al->cycles->avg) in annotation_line__write()
2082 ANNOTATION__CYCLES_WIDTH - 1, al->cycles->avg); in annotation_line__write()
2091 if (al->cycles) { in annotation_line__write()
2096 al->cycles->avg, al->cycles->min, in annotation_line__write()
2097 al->cycles->max); in annotation_line__write()
2120 if (!annotation_br_cntr_entry(&buf, al->br_cntr_nr, al->br_cntr, in annotation_line__write()
2121 al->num_aggr, al->evsel)) { in annotation_line__write()
2128 if (show_title && !*al->line) { in annotation_line__write()
2138 if (!*al->line) in annotation_line__write()
2140 else if (al->offset == -1) { in annotation_line__write()
2141 if (al->line_nr && annotate_opts.show_linenr) in annotation_line__write()
2143 notes->src->widths.addr + 1, al->line_nr); in annotation_line__write()
2149 obj__printf(obj, "%-*s", width, al->line); in annotation_line__write()
2151 u64 addr = al->offset; in annotation_line__write()
2160 if (al->jump_sources && in annotation_line__write()
2166 al->jump_sources); in annotation_line__write()
2167 prev = obj__set_jumps_percent_color(obj, al->jump_sources, in annotation_line__write()
2175 } else if (ins__is_call(&disasm_line(al)->ins) && in annotation_line__write()
2194 printed = disasm_line__write(disasm_line(al), notes, obj, bf, sizeof(bf), in annotation_line__write()
2200 disasm_line__snprint_type_info(disasm_line(al), bf, sizeof(bf), apd); in annotation_line__write()
2632 list_for_each_entry(dl, ¬es->src->source, al.node) { in find_disasm_line()
2633 if (dl->al.offset == -1) in find_disasm_line()
2636 if (sym->start + dl->al.offset == ip) { in find_disasm_line()
2721 if (curr == list_first_entry(sources, struct disasm_line, al.node)) in annotation__prev_asm_line()
2724 prev = list_prev_entry(curr, al.node); in annotation__prev_asm_line()
2725 while (prev->al.offset == -1 && in annotation__prev_asm_line()
2726 prev != list_first_entry(sources, struct disasm_line, al.node)) in annotation__prev_asm_line()
2727 prev = list_prev_entry(prev, al.node); in annotation__prev_asm_line()
2729 if (prev->al.offset == -1) in annotation__prev_asm_line()
2741 if (curr == list_last_entry(sources, struct disasm_line, al.node)) in annotation__next_asm_line()
2744 next = list_next_entry(curr, al.node); in annotation__next_asm_line()
2745 while (next->al.offset == -1 && in annotation__next_asm_line()
2746 next != list_last_entry(sources, struct disasm_line, al.node)) in annotation__next_asm_line()
2747 next = list_next_entry(next, al.node); in annotation__next_asm_line()
2749 if (next->al.offset == -1) in annotation__next_asm_line()
2774 addr = ip + (next->al.offset - dl->al.offset) + offset; in annotate_calc_pcrel()
2834 .ip = ms->sym->start + dl->al.offset, in __hist_entry__get_data_type()
2963 if (dl->al.offset > 0) { in hist_entry__get_data_type()
3006 s64 begin_offset = link->bb->begin->al.offset; in basic_block_has_offset()
3007 s64 end_offset = link->bb->end->al.offset; in basic_block_has_offset()
3018 s64 offset = dl->al.offset; in is_new_basic_block()
3072 if (basic_block_has_offset(&bb_data->visited, dl->al.offset)) in process_basic_block()
3076 struct disasm_line, al.node); in process_basic_block()
3077 if (last_dl->al.offset == -1) in process_basic_block()
3083 list_for_each_entry_from(dl, ¬es->src->source, al.node) { in process_basic_block()
3085 if (dl->al.offset == -1) in process_basic_block()
3088 if (sym->start + dl->al.offset == target) { in process_basic_block()