Lines Matching refs:al

1060 			struct annotation_line *al = notes->offsets[offset];  in annotation__count_and_fill()  local
1062 if (al && al->ipc == 0.0) { in annotation__count_and_fill()
1063 al->ipc = ipc; in annotation__count_and_fill()
1094 struct annotation_line *al; in annotation__compute_ipc() local
1098 al = notes->offsets[offset]; in annotation__compute_ipc()
1099 if (al && ch->num_aggr) { in annotation__compute_ipc()
1100 al->cycles = ch->cycles_aggr / ch->num_aggr; in annotation__compute_ipc()
1101 al->cycles_max = ch->cycles_max; in annotation__compute_ipc()
1102 al->cycles_min = ch->cycles_min; in annotation__compute_ipc()
1172 static void annotation_line__init(struct annotation_line *al, in annotation_line__init() argument
1176 al->offset = args->offset; in annotation_line__init()
1177 al->line = strdup(args->line); in annotation_line__init()
1178 al->line_nr = args->line_nr; in annotation_line__init()
1179 al->fileloc = args->fileloc; in annotation_line__init()
1180 al->data_nr = nr; in annotation_line__init()
1183 static void annotation_line__exit(struct annotation_line *al) in annotation_line__exit() argument
1185 free_srcline(al->path); in annotation_line__exit()
1186 zfree(&al->line); in annotation_line__exit()
1191 struct annotation_line *al; in disasm_line_size() local
1193 return (sizeof(struct disasm_line) + (sizeof(al->data[0]) * nr)); in disasm_line_size()
1219 annotation_line__init(&dl->al, args, nr); in disasm_line__new()
1220 if (dl->al.line == NULL) in disasm_line__new()
1224 if (disasm_line__parse(dl->al.line, &dl->ins.name, &dl->ops.raw) < 0) in disasm_line__new()
1233 zfree(&dl->al.line); in disasm_line__new()
1246 annotation_line__exit(&dl->al); in disasm_line__free()
1269 static void annotation_line__add(struct annotation_line *al, struct list_head *head) in annotation_line__add() argument
1271 list_add_tail(&al->node, head); in annotation_line__add()
1368 s64 offset = dl->al.offset; in disasm_line__print()
1374 color_fprintf(stdout, annotate__asm_color(br), "%s", dl->al.line); in disasm_line__print()
1380 annotation_line__print(struct annotation_line *al, struct symbol *sym, u64 start, in annotation_line__print() argument
1385 struct disasm_line *dl = container_of(al, struct disasm_line, al); in annotation_line__print()
1388 if (al->offset != -1) { in annotation_line__print()
1394 for (i = 0; i < al->data_nr; i++) { in annotation_line__print()
1397 percent = annotation_data__percent(&al->data[i], in annotation_line__print()
1404 if (al->data_nr > nr_percent) in annotation_line__print()
1405 nr_percent = al->data_nr; in annotation_line__print()
1415 if (queue == al) in annotation_line__print()
1426 struct annotation_data *data = &al->data[i]; in annotation_line__print()
1451 if (al->path) { in annotation_line__print()
1452 if (!prev_line || strcmp(prev_line, al->path)) { in annotation_line__print()
1453 color_fprintf(stdout, color, " // %s", al->path); in annotation_line__print()
1454 prev_line = al->path; in annotation_line__print()
1470 if (!*al->line) in annotation_line__print()
1473 printf(" %*s: %-*d %s\n", width, " ", addr_fmt_width, al->line_nr, al->line); in annotation_line__print()
1560 annotation_line__add(&dl->al, &notes->src->source); in symbol__parse_objdump_line()
1577 dl = list_entry(list->prev, struct disasm_line, al.node); in delete_last_nop()
1583 if (!strstr(dl->al.line, " nop ") && in delete_last_nop()
1584 !strstr(dl->al.line, " nopl ") && in delete_last_nop()
1585 !strstr(dl->al.line, " nopw ")) in delete_last_nop()
1589 list_del_init(&dl->al.node); in delete_last_nop()
1832 annotation_line__add(&dl->al, in symbol__disassemble_bpf()
1844 annotation_line__add(&dl->al, &notes->src->source); in symbol__disassemble_bpf()
1878 annotation_line__add(&dl->al, &notes->src->source); in symbol__disassemble_bpf_image()
2158 struct annotation_line *al, *next; in annotation__calc_percent() local
2161 list_for_each_entry(al, &notes->src->source, node) { in annotation__calc_percent()
2165 if (al->offset == -1) in annotation__calc_percent()
2168 next = annotation_line__next(al, &notes->src->source); in annotation__calc_percent()
2176 BUG_ON(i >= al->data_nr); in annotation__calc_percent()
2179 data = &al->data[i++]; in annotation__calc_percent()
2181 calc_percent(sym_hist, hists, data, al->offset, end); in annotation__calc_percent()
2233 static void insert_source_line(struct rb_root *root, struct annotation_line *al, in insert_source_line() argument
2245 ret = strcmp(iter->path, al->path); in insert_source_line()
2247 for (i = 0; i < al->data_nr; i++) { in insert_source_line()
2248 iter->data[i].percent_sum += annotation_data__percent(&al->data[i], in insert_source_line()
2260 for (i = 0; i < al->data_nr; i++) { in insert_source_line()
2261 al->data[i].percent_sum = annotation_data__percent(&al->data[i], in insert_source_line()
2265 rb_link_node(&al->rb_node, parent, p); in insert_source_line()
2266 rb_insert_color(&al->rb_node, root); in insert_source_line()
2282 static void __resort_source_line(struct rb_root *root, struct annotation_line *al) in __resort_source_line() argument
2292 if (cmp_source_line(al, iter)) in __resort_source_line()
2298 rb_link_node(&al->rb_node, parent, p); in __resort_source_line()
2299 rb_insert_color(&al->rb_node, root); in __resort_source_line()
2304 struct annotation_line *al; in resort_source_line() local
2311 al = rb_entry(node, struct annotation_line, rb_node); in resort_source_line()
2315 __resort_source_line(dest_root, al); in resort_source_line()
2322 struct annotation_line *al; in print_summary() local
2340 al = rb_entry(node, struct annotation_line, rb_node); in print_summary()
2341 for (i = 0; i < al->data_nr; i++) { in print_summary()
2342 percent = al->data[i].percent_sum; in print_summary()
2350 path = al->path; in print_summary()
2537 struct annotation_line *al; in symbol__annotate_fprintf2() local
2539 list_for_each_entry(al, &notes->src->source, node) { in symbol__annotate_fprintf2()
2540 if (annotation_line__filter(al, notes)) in symbol__annotate_fprintf2()
2542 annotation_line__write(al, notes, &wops, opts); in symbol__annotate_fprintf2()
2605 struct annotation_line *al, *n; in annotated_source__purge() local
2607 list_for_each_entry_safe(al, n, &as->source, node) { in annotated_source__purge()
2608 list_del_init(&al->node); in annotated_source__purge()
2609 disasm_line__free(disasm_line(al)); in annotated_source__purge()
2617 if (dl->al.offset == -1) in disasm_line__fprintf()
2618 return fprintf(fp, "%s\n", dl->al.line); in disasm_line__fprintf()
2620 printed = fprintf(fp, "%#" PRIx64 " %s", dl->al.offset, dl->ins.name); in disasm_line__fprintf()
2635 list_for_each_entry(pos, head, al.node) in disasm__fprintf()
2660 struct annotation_line *al = notes->offsets[offset]; in annotation__mark_jump_targets() local
2663 dl = disasm_line(al); in annotation__mark_jump_targets()
2668 al = notes->offsets[dl->ops.target.offset]; in annotation__mark_jump_targets()
2674 if (al == NULL) in annotation__mark_jump_targets()
2677 if (++al->jump_sources > notes->max_jump_sources) in annotation__mark_jump_targets()
2678 notes->max_jump_sources = al->jump_sources; in annotation__mark_jump_targets()
2684 struct annotation_line *al; in annotation__set_offsets() local
2690 list_for_each_entry(al, &notes->src->source, node) { in annotation__set_offsets()
2691 size_t line_len = strlen(al->line); in annotation__set_offsets()
2695 al->idx = notes->nr_entries++; in annotation__set_offsets()
2696 if (al->offset != -1) { in annotation__set_offsets()
2697 al->idx_asm = notes->nr_asm_entries++; in annotation__set_offsets()
2705 if (al->offset < size) in annotation__set_offsets()
2706 notes->offsets[al->offset] = al; in annotation__set_offsets()
2708 al->idx_asm = -1; in annotation__set_offsets()
2724 struct annotation_line *al; in annotation__max_ins_name() local
2726 list_for_each_entry(al, &notes->src->source, node) { in annotation__max_ins_name()
2727 if (al->offset == -1) in annotation__max_ins_name()
2730 len = strlen(disasm_line(al)->ins.name); in annotation__max_ins_name()
2764 struct annotation_line *al; in annotation__calc_lines() local
2767 list_for_each_entry(al, &notes->src->source, node) { in annotation__calc_lines()
2771 for (i = 0; i < al->data_nr; i++) { in annotation__calc_lines()
2774 percent = annotation_data__percent(&al->data[i], in annotation__calc_lines()
2784 al->path = get_srcline(map->dso, notes->start + al->offset, NULL, in annotation__calc_lines()
2785 false, true, notes->start + al->offset); in annotation__calc_lines()
2786 insert_source_line(&tmp_root, al, opts); in annotation__calc_lines()
2875 static double annotation_line__max_percent(struct annotation_line *al, in annotation_line__max_percent() argument
2885 percent = annotation_data__percent(&al->data[i], in annotation_line__max_percent()
2906 fwd = dl->ops.target.offset > dl->al.offset; in disasm_line__write()
2942 static void __annotation_line__write(struct annotation_line *al, struct annotation *notes, in __annotation_line__write() argument
2952 double percent_max = annotation_line__max_percent(al, notes, percent_type); in __annotation_line__write()
2959 if (first_line && (al->offset == -1 || percent_max == 0.0)) { in __annotation_line__write()
2961 if (al->ipc == 0.0 && al->cycles == 0) in __annotation_line__write()
2967 if (al->offset != -1 && percent_max != 0.0) { in __annotation_line__write()
2973 percent = annotation_data__percent(&al->data[i], percent_type); in __annotation_line__write()
2977 obj__printf(obj, "%11" PRIu64 " ", al->data[i].he.period); in __annotation_line__write()
2980 al->data[i].he.nr_samples); in __annotation_line__write()
2998 if (al->ipc) in __annotation_line__write()
2999 obj__printf(obj, "%*.2f ", ANNOTATION__IPC_WIDTH - 1, al->ipc); in __annotation_line__write()
3006 if (al->cycles) in __annotation_line__write()
3008 ANNOTATION__CYCLES_WIDTH - 1, al->cycles); in __annotation_line__write()
3017 if (al->cycles) { in __annotation_line__write()
3022 al->cycles, al->cycles_min, in __annotation_line__write()
3023 al->cycles_max); in __annotation_line__write()
3038 if (show_title && !*al->line) { in __annotation_line__write()
3046 if (!*al->line) in __annotation_line__write()
3048 else if (al->offset == -1) { in __annotation_line__write()
3049 if (al->line_nr && notes->options->show_linenr) in __annotation_line__write()
3050 printed = scnprintf(bf, sizeof(bf), "%-*d ", notes->widths.addr + 1, al->line_nr); in __annotation_line__write()
3054 obj__printf(obj, "%-*s", width - printed - pcnt_width - cycles_width + 1, al->line); in __annotation_line__write()
3056 u64 addr = al->offset; in __annotation_line__write()
3065 if (al->jump_sources && in __annotation_line__write()
3071 al->jump_sources); in __annotation_line__write()
3072 prev = obj__set_jumps_percent_color(obj, al->jump_sources, in __annotation_line__write()
3080 } else if (ins__is_call(&disasm_line(al)->ins) && in __annotation_line__write()
3097 disasm_line__write(disasm_line(al), notes, obj, bf, sizeof(bf), obj__printf, obj__write_graph); in __annotation_line__write()
3104 void annotation_line__write(struct annotation_line *al, struct annotation *notes, in annotation_line__write() argument
3108 __annotation_line__write(al, notes, wops->first_line, wops->current_entry, in annotation_line__write()