Lines Matching refs:al

1006 			struct annotation_line *al = notes->offsets[offset];  in annotation__count_and_fill()  local
1008 if (al) in annotation__count_and_fill()
1009 al->ipc = ipc; in annotation__count_and_fill()
1027 struct annotation_line *al; in annotation__compute_ipc() local
1031 al = notes->offsets[offset]; in annotation__compute_ipc()
1032 if (al && ch->num_aggr) { in annotation__compute_ipc()
1033 al->cycles = ch->cycles_aggr / ch->num_aggr; in annotation__compute_ipc()
1034 al->cycles_max = ch->cycles_max; in annotation__compute_ipc()
1035 al->cycles_min = ch->cycles_min; in annotation__compute_ipc()
1107 static void annotation_line__delete(struct annotation_line *al) in annotation_line__delete() argument
1109 void *ptr = (void *) al - al->privsize; in annotation_line__delete()
1111 free_srcline(al->path); in annotation_line__delete()
1112 zfree(&al->line); in annotation_line__delete()
1130 struct annotation_line *al; in annotation_line__new() local
1132 size_t size = privsize + sizeof(*al); in annotation_line__new()
1138 size += sizeof(al->data[0]) * nr; in annotation_line__new()
1140 al = zalloc(size); in annotation_line__new()
1141 if (al) { in annotation_line__new()
1142 al = (void *) al + privsize; in annotation_line__new()
1143 al->privsize = privsize; in annotation_line__new()
1144 al->offset = args->offset; in annotation_line__new()
1145 al->line = strdup(args->line); in annotation_line__new()
1146 al->line_nr = args->line_nr; in annotation_line__new()
1147 al->data_nr = nr; in annotation_line__new()
1150 return al; in annotation_line__new()
1168 struct annotation_line *al; in disasm_line__new() local
1169 size_t privsize = args->privsize + offsetof(struct disasm_line, al); in disasm_line__new()
1171 al = annotation_line__new(args, privsize); in disasm_line__new()
1172 if (al != NULL) { in disasm_line__new()
1173 dl = disasm_line(al); in disasm_line__new()
1175 if (dl->al.line == NULL) in disasm_line__new()
1179 if (disasm_line__parse(dl->al.line, &dl->ins.name, &dl->ops.raw) < 0) in disasm_line__new()
1189 zfree(&dl->al.line); in disasm_line__new()
1203 annotation_line__delete(&dl->al); in disasm_line__free()
1214 static void annotation_line__add(struct annotation_line *al, struct list_head *head) in annotation_line__add() argument
1216 list_add_tail(&al->node, head); in annotation_line__add()
1313 s64 offset = dl->al.offset; in disasm_line__print()
1319 color_fprintf(stdout, annotate__asm_color(br), "%s", dl->al.line); in disasm_line__print()
1325 annotation_line__print(struct annotation_line *al, struct symbol *sym, u64 start, in annotation_line__print() argument
1330 struct disasm_line *dl = container_of(al, struct disasm_line, al); in annotation_line__print()
1334 if (al->offset != -1) { in annotation_line__print()
1340 for (i = 0; i < al->data_nr; i++) { in annotation_line__print()
1343 percent = annotation_data__percent(&al->data[i], in annotation_line__print()
1350 if (al->data_nr > nr_percent) in annotation_line__print()
1351 nr_percent = al->data_nr; in annotation_line__print()
1361 if (queue == al) in annotation_line__print()
1376 if (al->path) { in annotation_line__print()
1377 if (!prev_line || strcmp(prev_line, al->path) in annotation_line__print()
1379 color_fprintf(stdout, color, " %s", al->path); in annotation_line__print()
1380 prev_line = al->path; in annotation_line__print()
1386 struct annotation_data *data = &al->data[i]; in annotation_line__print()
1417 if (!*al->line) in annotation_line__print()
1420 printf(" %*s: %*s %s\n", width, " ", addr_fmt_width, " ", al->line); in annotation_line__print()
1524 annotation_line__add(&dl->al, &notes->src->source); in symbol__parse_objdump_line()
1541 dl = list_entry(list->prev, struct disasm_line, al.node); in delete_last_nop()
1547 if (!strstr(dl->al.line, " nop ") && in delete_last_nop()
1548 !strstr(dl->al.line, " nopl ") && in delete_last_nop()
1549 !strstr(dl->al.line, " nopw ")) in delete_last_nop()
1553 list_del(&dl->al.node); in delete_last_nop()
1825 struct annotation_line *al, *next; in annotation__calc_percent() local
1828 list_for_each_entry(al, &notes->src->source, node) { in annotation__calc_percent()
1832 if (al->offset == -1) in annotation__calc_percent()
1835 next = annotation_line__next(al, &notes->src->source); in annotation__calc_percent()
1843 BUG_ON(i >= al->data_nr); in annotation__calc_percent()
1846 data = &al->data[i++]; in annotation__calc_percent()
1848 calc_percent(sym_hist, hists, data, al->offset, end); in annotation__calc_percent()
1899 static void insert_source_line(struct rb_root *root, struct annotation_line *al, in insert_source_line() argument
1911 ret = strcmp(iter->path, al->path); in insert_source_line()
1913 for (i = 0; i < al->data_nr; i++) { in insert_source_line()
1914 iter->data[i].percent_sum += annotation_data__percent(&al->data[i], in insert_source_line()
1926 for (i = 0; i < al->data_nr; i++) { in insert_source_line()
1927 al->data[i].percent_sum = annotation_data__percent(&al->data[i], in insert_source_line()
1931 rb_link_node(&al->rb_node, parent, p); in insert_source_line()
1932 rb_insert_color(&al->rb_node, root); in insert_source_line()
1948 static void __resort_source_line(struct rb_root *root, struct annotation_line *al) in __resort_source_line() argument
1958 if (cmp_source_line(al, iter)) in __resort_source_line()
1964 rb_link_node(&al->rb_node, parent, p); in __resort_source_line()
1965 rb_insert_color(&al->rb_node, root); in __resort_source_line()
1970 struct annotation_line *al; in resort_source_line() local
1977 al = rb_entry(node, struct annotation_line, rb_node); in resort_source_line()
1981 __resort_source_line(dest_root, al); in resort_source_line()
1988 struct annotation_line *al; in print_summary() local
2006 al = rb_entry(node, struct annotation_line, rb_node); in print_summary()
2007 for (i = 0; i < al->data_nr; i++) { in print_summary()
2008 percent = al->data[i].percent_sum; in print_summary()
2016 path = al->path; in print_summary()
2202 struct annotation_line *al; in symbol__annotate_fprintf2() local
2204 list_for_each_entry(al, &notes->src->source, node) { in symbol__annotate_fprintf2()
2205 if (annotation_line__filter(al, notes)) in symbol__annotate_fprintf2()
2207 annotation_line__write(al, notes, &wops, opts); in symbol__annotate_fprintf2()
2270 struct annotation_line *al, *n; in annotated_source__purge() local
2272 list_for_each_entry_safe(al, n, &as->source, node) { in annotated_source__purge()
2273 list_del(&al->node); in annotated_source__purge()
2274 disasm_line__free(disasm_line(al)); in annotated_source__purge()
2282 if (dl->al.offset == -1) in disasm_line__fprintf()
2283 return fprintf(fp, "%s\n", dl->al.line); in disasm_line__fprintf()
2285 printed = fprintf(fp, "%#" PRIx64 " %s", dl->al.offset, dl->ins.name); in disasm_line__fprintf()
2300 list_for_each_entry(pos, head, al.node) in disasm__fprintf()
2325 struct annotation_line *al = notes->offsets[offset]; in annotation__mark_jump_targets() local
2328 dl = disasm_line(al); in annotation__mark_jump_targets()
2333 al = notes->offsets[dl->ops.target.offset]; in annotation__mark_jump_targets()
2339 if (al == NULL) in annotation__mark_jump_targets()
2342 if (++al->jump_sources > notes->max_jump_sources) in annotation__mark_jump_targets()
2343 notes->max_jump_sources = al->jump_sources; in annotation__mark_jump_targets()
2351 struct annotation_line *al; in annotation__set_offsets() local
2355 list_for_each_entry(al, &notes->src->source, node) { in annotation__set_offsets()
2356 size_t line_len = strlen(al->line); in annotation__set_offsets()
2360 al->idx = notes->nr_entries++; in annotation__set_offsets()
2361 if (al->offset != -1) { in annotation__set_offsets()
2362 al->idx_asm = notes->nr_asm_entries++; in annotation__set_offsets()
2370 if (al->offset < size) in annotation__set_offsets()
2371 notes->offsets[al->offset] = al; in annotation__set_offsets()
2373 al->idx_asm = -1; in annotation__set_offsets()
2411 struct annotation_line *al; in annotation__calc_lines() local
2414 list_for_each_entry(al, &notes->src->source, node) { in annotation__calc_lines()
2418 for (i = 0; i < al->data_nr; i++) { in annotation__calc_lines()
2421 percent = annotation_data__percent(&al->data[i], in annotation__calc_lines()
2431 al->path = get_srcline(map->dso, notes->start + al->offset, NULL, in annotation__calc_lines()
2432 false, true, notes->start + al->offset); in annotation__calc_lines()
2433 insert_source_line(&tmp_root, al, opts); in annotation__calc_lines()
2507 static double annotation_line__max_percent(struct annotation_line *al, in annotation_line__max_percent() argument
2517 percent = annotation_data__percent(&al->data[i], in annotation_line__max_percent()
2538 fwd = dl->ops.target.offset > dl->al.offset; in disasm_line__write()
2558 static void __annotation_line__write(struct annotation_line *al, struct annotation *notes, in __annotation_line__write() argument
2568 double percent_max = annotation_line__max_percent(al, notes, percent_type); in __annotation_line__write()
2575 if (first_line && (al->offset == -1 || percent_max == 0.0)) { in __annotation_line__write()
2577 if (al->ipc == 0.0 && al->cycles == 0) in __annotation_line__write()
2583 if (al->offset != -1 && percent_max != 0.0) { in __annotation_line__write()
2589 percent = annotation_data__percent(&al->data[i], percent_type); in __annotation_line__write()
2593 obj__printf(obj, "%11" PRIu64 " ", al->data[i].he.period); in __annotation_line__write()
2596 al->data[i].he.nr_samples); in __annotation_line__write()
2614 if (al->ipc) in __annotation_line__write()
2615 obj__printf(obj, "%*.2f ", ANNOTATION__IPC_WIDTH - 1, al->ipc); in __annotation_line__write()
2622 if (al->cycles) in __annotation_line__write()
2624 ANNOTATION__CYCLES_WIDTH - 1, al->cycles); in __annotation_line__write()
2633 if (al->cycles) { in __annotation_line__write()
2638 al->cycles, al->cycles_min, in __annotation_line__write()
2639 al->cycles_max); in __annotation_line__write()
2657 if (!*al->line) in __annotation_line__write()
2659 else if (al->offset == -1) { in __annotation_line__write()
2660 if (al->line_nr && notes->options->show_linenr) in __annotation_line__write()
2661 printed = scnprintf(bf, sizeof(bf), "%-*d ", notes->widths.addr + 1, al->line_nr); in __annotation_line__write()
2665 obj__printf(obj, "%-*s", width - printed - pcnt_width - cycles_width + 1, al->line); in __annotation_line__write()
2667 u64 addr = al->offset; in __annotation_line__write()
2676 if (al->jump_sources && in __annotation_line__write()
2682 al->jump_sources); in __annotation_line__write()
2683 prev = obj__set_jumps_percent_color(obj, al->jump_sources, in __annotation_line__write()
2691 } else if (ins__is_call(&disasm_line(al)->ins) && in __annotation_line__write()
2708 disasm_line__write(disasm_line(al), notes, obj, bf, sizeof(bf), obj__printf, obj__write_graph); in __annotation_line__write()
2715 void annotation_line__write(struct annotation_line *al, struct annotation *notes, in annotation_line__write() argument
2719 __annotation_line__write(al, notes, wops->first_line, wops->current_entry, in annotation_line__write()