Lines Matching refs:al

429 	struct annotation_line *al;  in annotated_source__get_line()  local
431 list_for_each_entry(al, &src->source, node) { in annotated_source__get_line()
432 if (al->offset == offset) in annotated_source__get_line()
433 return al; in annotated_source__get_line()
440 struct annotation_line *al; in annotation__count_insn() local
443 al = annotated_source__get_line(notes->src, start); in annotation__count_insn()
444 if (al == NULL) in annotation__count_insn()
447 list_for_each_entry_from(al, &notes->src->source, node) { in annotation__count_insn()
448 if (al->offset == -1) in annotation__count_insn()
450 if ((u64)al->offset > end) in annotation__count_insn()
473 struct annotation_line *al; in annotation__count_and_fill() local
481 al = annotated_source__get_line(notes->src, start); in annotation__count_and_fill()
482 if (al == NULL) in annotation__count_and_fill()
485 list_for_each_entry_from(al, &notes->src->source, node) { in annotation__count_and_fill()
486 if (al->offset == -1) in annotation__count_and_fill()
488 if ((u64)al->offset > end) in annotation__count_and_fill()
490 if (al->cycles && al->cycles->ipc == 0.0) { in annotation__count_and_fill()
491 al->cycles->ipc = ipc; in annotation__count_and_fill()
526 struct annotation_line *al; in annotation__compute_ipc() local
528 al = annotated_source__get_line(notes->src, offset); in annotation__compute_ipc()
529 if (al && al->cycles == NULL) { in annotation__compute_ipc()
530 al->cycles = zalloc(sizeof(*al->cycles)); in annotation__compute_ipc()
531 if (al->cycles == NULL) { in annotation__compute_ipc()
538 if (al && ch->num_aggr) { in annotation__compute_ipc()
539 al->cycles->avg = ch->cycles_aggr / ch->num_aggr; in annotation__compute_ipc()
540 al->cycles->max = ch->cycles_max; in annotation__compute_ipc()
541 al->cycles->min = ch->cycles_min; in annotation__compute_ipc()
543 if (al && notes->branch->br_cntr) { in annotation__compute_ipc()
544 if (!al->br_cntr) { in annotation__compute_ipc()
545 al->br_cntr = calloc(br_cntr_nr, sizeof(u64)); in annotation__compute_ipc()
546 if (!al->br_cntr) { in annotation__compute_ipc()
551 al->num_aggr = ch->num_aggr; in annotation__compute_ipc()
552 al->br_cntr_nr = br_cntr_nr; in annotation__compute_ipc()
553 al->evsel = evsel; in annotation__compute_ipc()
554 memcpy(al->br_cntr, &notes->branch->br_cntr[offset * br_cntr_nr], in annotation__compute_ipc()
565 struct annotation_line *al; in annotation__compute_ipc() local
567 al = annotated_source__get_line(notes->src, offset); in annotation__compute_ipc()
568 if (al) { in annotation__compute_ipc()
569 zfree(&al->cycles); in annotation__compute_ipc()
570 zfree(&al->br_cntr); in annotation__compute_ipc()
651 void annotation_line__add(struct annotation_line *al, struct list_head *head) in annotation_line__add() argument
653 list_add_tail(&al->node, head); in annotation_line__add()
750 s64 offset = dl->al.offset; in disasm_line__print()
756 color_fprintf(stdout, annotate__asm_color(br), "%s", dl->al.line); in disasm_line__print()
762 annotation_line__print(struct annotation_line *al, struct symbol *sym, u64 start, in annotation_line__print() argument
767 struct disasm_line *dl = container_of(al, struct disasm_line, al); in annotation_line__print()
771 if (al->offset != -1) { in annotation_line__print()
776 for (i = 0; i < al->data_nr; i++) { in annotation_line__print()
779 percent = annotation_data__percent(&al->data[i], in annotation_line__print()
786 if (al->data_nr > nr_percent) in annotation_line__print()
787 nr_percent = al->data_nr; in annotation_line__print()
797 if (queue == al) in annotation_line__print()
808 struct annotation_data *data = &al->data[i]; in annotation_line__print()
833 if (al->path) { in annotation_line__print()
834 if (!prev_line || strcmp(prev_line, al->path)) { in annotation_line__print()
835 color_fprintf(stdout, color, " // %s", al->path); in annotation_line__print()
836 prev_line = al->path; in annotation_line__print()
849 if (!*al->line) in annotation_line__print()
852 printf(" %*s: %-*d %s\n", width, " ", addr_fmt_width, al->line_nr, al->line); in annotation_line__print()
899 struct annotation_line *al, *next; in annotation__calc_percent() local
902 list_for_each_entry(al, &notes->src->source, node) { in annotation__calc_percent()
906 if (al->offset == -1) in annotation__calc_percent()
909 next = annotation_line__next(al, &notes->src->source); in annotation__calc_percent()
915 BUG_ON(i >= al->data_nr); in annotation__calc_percent()
921 data = &al->data[i++]; in annotation__calc_percent()
923 calc_percent(notes, evsel, data, al->offset, end); in annotation__calc_percent()
1016 static void insert_source_line(struct rb_root *root, struct annotation_line *al) in insert_source_line() argument
1028 ret = strcmp(iter->path, al->path); in insert_source_line()
1030 for (i = 0; i < al->data_nr; i++) { in insert_source_line()
1031 iter->data[i].percent_sum += annotation_data__percent(&al->data[i], in insert_source_line()
1043 for (i = 0; i < al->data_nr; i++) { in insert_source_line()
1044 al->data[i].percent_sum = annotation_data__percent(&al->data[i], in insert_source_line()
1048 rb_link_node(&al->rb_node, parent, p); in insert_source_line()
1049 rb_insert_color(&al->rb_node, root); in insert_source_line()
1065 static void __resort_source_line(struct rb_root *root, struct annotation_line *al) in __resort_source_line() argument
1075 if (cmp_source_line(al, iter)) in __resort_source_line()
1081 rb_link_node(&al->rb_node, parent, p); in __resort_source_line()
1082 rb_insert_color(&al->rb_node, root); in __resort_source_line()
1087 struct annotation_line *al; in resort_source_line() local
1094 al = rb_entry(node, struct annotation_line, rb_node); in resort_source_line()
1098 __resort_source_line(dest_root, al); in resort_source_line()
1105 struct annotation_line *al; in print_summary() local
1123 al = rb_entry(node, struct annotation_line, rb_node); in print_summary()
1124 for (i = 0; i < al->data_nr; i++) { in print_summary()
1125 percent = al->data[i].percent_sum; in print_summary()
1133 path = al->path; in print_summary()
1323 struct annotation_line *al; in symbol__annotate_fprintf2() local
1325 list_for_each_entry(al, &notes->src->source, node) { in symbol__annotate_fprintf2()
1326 if (annotation_line__filter(al)) in symbol__annotate_fprintf2()
1328 annotation_line__write(al, notes, &wops); in symbol__annotate_fprintf2()
1379 struct annotation_line *al; in symbol__annotate_decay_histogram() local
1382 list_for_each_entry(al, &notes->src->source, node) { in symbol__annotate_decay_histogram()
1385 if (al->offset == -1) in symbol__annotate_decay_histogram()
1388 entry = annotated_source__hist_entry(notes->src, evidx, al->offset); in symbol__annotate_decay_histogram()
1399 struct annotation_line *al, *n; in annotated_source__purge() local
1401 list_for_each_entry_safe(al, n, &as->source, node) { in annotated_source__purge()
1402 list_del_init(&al->node); in annotated_source__purge()
1403 disasm_line__free(disasm_line(al)); in annotated_source__purge()
1411 if (dl->al.offset == -1) in disasm_line__fprintf()
1412 return fprintf(fp, "%s\n", dl->al.line); in disasm_line__fprintf()
1414 printed = fprintf(fp, "%#" PRIx64 " %s", dl->al.offset, dl->ins.name); in disasm_line__fprintf()
1429 list_for_each_entry(pos, head, al.node) in disasm__fprintf()
1448 struct annotation_line *al; in annotation__mark_jump_targets() local
1454 list_for_each_entry(al, &notes->src->source, node) { in annotation__mark_jump_targets()
1458 dl = disasm_line(al); in annotation__mark_jump_targets()
1479 struct annotation_line *al; in annotation__set_index() local
1486 list_for_each_entry(al, &src->source, node) { in annotation__set_index()
1487 size_t line_len = strlen(al->line); in annotation__set_index()
1491 al->idx = src->nr_entries++; in annotation__set_index()
1492 if (al->offset != -1) in annotation__set_index()
1493 al->idx_asm = src->nr_asm_entries++; in annotation__set_index()
1495 al->idx_asm = -1; in annotation__set_index()
1511 struct annotation_line *al; in annotation__max_ins_name() local
1513 list_for_each_entry(al, &notes->src->source, node) { in annotation__max_ins_name()
1514 if (al->offset == -1) in annotation__max_ins_name()
1517 len = strlen(disasm_line(al)->ins.name); in annotation__max_ins_name()
1565 struct annotation_line *al; in annotation__calc_lines() local
1568 list_for_each_entry(al, &notes->src->source, node) { in annotation__calc_lines()
1573 for (i = 0; i < al->data_nr; i++) { in annotation__calc_lines()
1576 percent = annotation_data__percent(&al->data[i], in annotation__calc_lines()
1587 al->path = get_srcline(map__dso(ms->map), addr + al->offset, NULL, in annotation__calc_lines()
1588 false, true, ms->sym->start + al->offset); in annotation__calc_lines()
1589 insert_source_line(&tmp_root, al); in annotation__calc_lines()
1675 static double annotation_line__max_percent(struct annotation_line *al, in annotation_line__max_percent() argument
1681 for (i = 0; i < al->data_nr; i++) { in annotation_line__max_percent()
1684 percent = annotation_data__percent(&al->data[i], in annotation_line__max_percent()
1705 fwd = dl->ops.target.offset > dl->al.offset; in disasm_line__write()
1886 static void __annotation_line__write(struct annotation_line *al, struct annotation *notes, in __annotation_line__write() argument
1896 double percent_max = annotation_line__max_percent(al, percent_type); in __annotation_line__write()
1903 if (first_line && (al->offset == -1 || percent_max == 0.0)) { in __annotation_line__write()
1904 if (notes->branch && al->cycles) { in __annotation_line__write()
1905 if (al->cycles->ipc == 0.0 && al->cycles->avg == 0) in __annotation_line__write()
1911 if (al->offset != -1 && percent_max != 0.0) { in __annotation_line__write()
1914 for (i = 0; i < al->data_nr; i++) { in __annotation_line__write()
1917 percent = annotation_data__percent(&al->data[i], percent_type); in __annotation_line__write()
1921 obj__printf(obj, "%11" PRIu64 " ", al->data[i].he.period); in __annotation_line__write()
1924 al->data[i].he.nr_samples); in __annotation_line__write()
1942 if (al->cycles && al->cycles->ipc) in __annotation_line__write()
1943 obj__printf(obj, "%*.2f ", ANNOTATION__IPC_WIDTH - 1, al->cycles->ipc); in __annotation_line__write()
1950 if (al->cycles && al->cycles->avg) in __annotation_line__write()
1952 ANNOTATION__CYCLES_WIDTH - 1, al->cycles->avg); in __annotation_line__write()
1961 if (al->cycles) { in __annotation_line__write()
1966 al->cycles->avg, al->cycles->min, in __annotation_line__write()
1967 al->cycles->max); in __annotation_line__write()
1990 if (!annotation_br_cntr_entry(&buf, al->br_cntr_nr, al->br_cntr, in __annotation_line__write()
1991 al->num_aggr, al->evsel)) { in __annotation_line__write()
1998 if (show_title && !*al->line) { in __annotation_line__write()
2006 if (!*al->line) in __annotation_line__write()
2008 else if (al->offset == -1) { in __annotation_line__write()
2009 if (al->line_nr && annotate_opts.show_linenr) in __annotation_line__write()
2011 notes->src->widths.addr + 1, al->line_nr); in __annotation_line__write()
2016 obj__printf(obj, "%-*s", width - printed - pcnt_width - cycles_width + 1, al->line); in __annotation_line__write()
2018 u64 addr = al->offset; in __annotation_line__write()
2027 if (al->jump_sources && in __annotation_line__write()
2033 al->jump_sources); in __annotation_line__write()
2034 prev = obj__set_jumps_percent_color(obj, al->jump_sources, in __annotation_line__write()
2042 } else if (ins__is_call(&disasm_line(al)->ins) && in __annotation_line__write()
2059 disasm_line__write(disasm_line(al), notes, obj, bf, sizeof(bf), obj__printf, obj__write_graph); in __annotation_line__write()
2066 void annotation_line__write(struct annotation_line *al, struct annotation *notes, in annotation_line__write() argument
2069 __annotation_line__write(al, notes, wops->first_line, wops->current_entry, in annotation_line__write()
2429 list_for_each_entry(dl, &notes->src->source, al.node) { in find_disasm_line()
2430 if (dl->al.offset == -1) in find_disasm_line()
2433 if (sym->start + dl->al.offset == ip) { in find_disasm_line()
2504 if (curr == list_first_entry(sources, struct disasm_line, al.node)) in annotation__prev_asm_line()
2507 prev = list_prev_entry(curr, al.node); in annotation__prev_asm_line()
2508 while (prev->al.offset == -1 && in annotation__prev_asm_line()
2509 prev != list_first_entry(sources, struct disasm_line, al.node)) in annotation__prev_asm_line()
2510 prev = list_prev_entry(prev, al.node); in annotation__prev_asm_line()
2512 if (prev->al.offset == -1) in annotation__prev_asm_line()
2524 if (curr == list_last_entry(sources, struct disasm_line, al.node)) in annotation__next_asm_line()
2527 next = list_next_entry(curr, al.node); in annotation__next_asm_line()
2528 while (next->al.offset == -1 && in annotation__next_asm_line()
2529 next != list_last_entry(sources, struct disasm_line, al.node)) in annotation__next_asm_line()
2530 next = list_next_entry(next, al.node); in annotation__next_asm_line()
2532 if (next->al.offset == -1) in annotation__next_asm_line()
2557 addr = ip + (next->al.offset - dl->al.offset) + offset; in annotate_calc_pcrel()
2672 .ip = ms->sym->start + dl->al.offset, in hist_entry__get_data_type()
2682 ip = ms->sym->start + dl->al.offset; in hist_entry__get_data_type()
2724 if (dl->al.offset > 0) { in hist_entry__get_data_type()
2765 s64 begin_offset = link->bb->begin->al.offset; in basic_block_has_offset()
2766 s64 end_offset = link->bb->end->al.offset; in basic_block_has_offset()
2777 s64 offset = dl->al.offset; in is_new_basic_block()
2831 if (basic_block_has_offset(&bb_data->visited, dl->al.offset)) in process_basic_block()
2835 struct disasm_line, al.node); in process_basic_block()
2836 if (last_dl->al.offset == -1) in process_basic_block()
2842 list_for_each_entry_from(dl, &notes->src->source, al.node) { in process_basic_block()
2844 if (dl->al.offset == -1) in process_basic_block()
2847 if (sym->start + dl->al.offset == target) { in process_basic_block()