Lines Matching refs:al

1059 			struct annotation_line *al = notes->offsets[offset];
1061 if (al && al->ipc == 0.0) {
1062 al->ipc = ipc;
1093 struct annotation_line *al;
1097 al = notes->offsets[offset];
1098 if (al && ch->num_aggr) {
1099 al->cycles = ch->cycles_aggr / ch->num_aggr;
1100 al->cycles_max = ch->cycles_max;
1101 al->cycles_min = ch->cycles_min;
1170 static void annotation_line__init(struct annotation_line *al,
1174 al->offset = args->offset;
1175 al->line = strdup(args->line);
1176 al->line_nr = args->line_nr;
1177 al->data_nr = nr;
1180 static void annotation_line__exit(struct annotation_line *al)
1182 free_srcline(al->path);
1183 zfree(&al->line);
1188 struct annotation_line *al;
1190 return (sizeof(struct disasm_line) + (sizeof(al->data[0]) * nr));
1216 annotation_line__init(&dl->al, args, nr);
1217 if (dl->al.line == NULL)
1221 if (disasm_line__parse(dl->al.line, &dl->ins.name, &dl->ops.raw) < 0)
1230 zfree(&dl->al.line);
1243 annotation_line__exit(&dl->al);
1255 static void annotation_line__add(struct annotation_line *al, struct list_head *head)
1257 list_add_tail(&al->node, head);
1354 s64 offset = dl->al.offset;
1360 color_fprintf(stdout, annotate__asm_color(br), "%s", dl->al.line);
1366 annotation_line__print(struct annotation_line *al, struct symbol *sym, u64 start,
1371 struct disasm_line *dl = container_of(al, struct disasm_line, al);
1375 if (al->offset != -1) {
1381 for (i = 0; i < al->data_nr; i++) {
1384 percent = annotation_data__percent(&al->data[i],
1391 if (al->data_nr > nr_percent)
1392 nr_percent = al->data_nr;
1402 if (queue == al)
1417 if (al->path) {
1418 if (!prev_line || strcmp(prev_line, al->path)
1420 color_fprintf(stdout, color, " %s", al->path);
1421 prev_line = al->path;
1427 struct annotation_data *data = &al->data[i];
1458 if (!*al->line)
1461 printf(" %*s: %*s %s\n", width, " ", addr_fmt_width, " ", al->line);
1546 annotation_line__add(&dl->al, &notes->src->source);
1563 dl = list_entry(list->prev, struct disasm_line, al.node);
1569 if (!strstr(dl->al.line, " nop ") &&
1570 !strstr(dl->al.line, " nopl ") &&
1571 !strstr(dl->al.line, " nopw "))
1575 list_del_init(&dl->al.node);
1817 annotation_line__add(&dl->al,
1828 annotation_line__add(&dl->al, &notes->src->source);
1861 annotation_line__add(&dl->al, &notes->src->source);
2140 struct annotation_line *al, *next;
2143 list_for_each_entry(al, &notes->src->source, node) {
2147 if (al->offset == -1)
2150 next = annotation_line__next(al, &notes->src->source);
2158 BUG_ON(i >= al->data_nr);
2161 data = &al->data[i++];
2163 calc_percent(sym_hist, hists, data, al->offset, end);
2215 static void insert_source_line(struct rb_root *root, struct annotation_line *al,
2227 ret = strcmp(iter->path, al->path);
2229 for (i = 0; i < al->data_nr; i++) {
2230 iter->data[i].percent_sum += annotation_data__percent(&al->data[i],
2242 for (i = 0; i < al->data_nr; i++) {
2243 al->data[i].percent_sum = annotation_data__percent(&al->data[i],
2247 rb_link_node(&al->rb_node, parent, p);
2248 rb_insert_color(&al->rb_node, root);
2264 static void __resort_source_line(struct rb_root *root, struct annotation_line *al)
2274 if (cmp_source_line(al, iter))
2280 rb_link_node(&al->rb_node, parent, p);
2281 rb_insert_color(&al->rb_node, root);
2286 struct annotation_line *al;
2293 al = rb_entry(node, struct annotation_line, rb_node);
2297 __resort_source_line(dest_root, al);
2304 struct annotation_line *al;
2322 al = rb_entry(node, struct annotation_line, rb_node);
2323 for (i = 0; i < al->data_nr; i++) {
2324 percent = al->data[i].percent_sum;
2332 path = al->path;
2519 struct annotation_line *al;
2521 list_for_each_entry(al, &notes->src->source, node) {
2522 if (annotation_line__filter(al, notes))
2524 annotation_line__write(al, notes, &wops, opts);
2587 struct annotation_line *al, *n;
2589 list_for_each_entry_safe(al, n, &as->source, node) {
2590 list_del_init(&al->node);
2591 disasm_line__free(disasm_line(al));
2599 if (dl->al.offset == -1)
2600 return fprintf(fp, "%s\n", dl->al.line);
2602 printed = fprintf(fp, "%#" PRIx64 " %s", dl->al.offset, dl->ins.name);
2617 list_for_each_entry(pos, head, al.node)
2642 struct annotation_line *al = notes->offsets[offset];
2645 dl = disasm_line(al);
2650 al = notes->offsets[dl->ops.target.offset];
2656 if (al == NULL)
2659 if (++al->jump_sources > notes->max_jump_sources)
2660 notes->max_jump_sources = al->jump_sources;
2666 struct annotation_line *al;
2672 list_for_each_entry(al, &notes->src->source, node) {
2673 size_t line_len = strlen(al->line);
2677 al->idx = notes->nr_entries++;
2678 if (al->offset != -1) {
2679 al->idx_asm = notes->nr_asm_entries++;
2687 if (al->offset < size)
2688 notes->offsets[al->offset] = al;
2690 al->idx_asm = -1;
2706 struct annotation_line *al;
2708 list_for_each_entry(al, &notes->src->source, node) {
2709 if (al->offset == -1)
2712 len = strlen(disasm_line(al)->ins.name);
2746 struct annotation_line *al;
2749 list_for_each_entry(al, &notes->src->source, node) {
2753 for (i = 0; i < al->data_nr; i++) {
2756 percent = annotation_data__percent(&al->data[i],
2766 al->path = get_srcline(map->dso, notes->start + al->offset, NULL,
2767 false, true, notes->start + al->offset);
2768 insert_source_line(&tmp_root, al, opts);
2841 static double annotation_line__max_percent(struct annotation_line *al,
2851 percent = annotation_data__percent(&al->data[i],
2872 fwd = dl->ops.target.offset > dl->al.offset;
2908 static void __annotation_line__write(struct annotation_line *al, struct annotation *notes,
2918 double percent_max = annotation_line__max_percent(al, notes, percent_type);
2925 if (first_line && (al->offset == -1 || percent_max == 0.0)) {
2927 if (al->ipc == 0.0 && al->cycles == 0)
2933 if (al->offset != -1 && percent_max != 0.0) {
2939 percent = annotation_data__percent(&al->data[i], percent_type);
2943 obj__printf(obj, "%11" PRIu64 " ", al->data[i].he.period);
2946 al->data[i].he.nr_samples);
2964 if (al->ipc)
2965 obj__printf(obj, "%*.2f ", ANNOTATION__IPC_WIDTH - 1, al->ipc);
2972 if (al->cycles)
2974 ANNOTATION__CYCLES_WIDTH - 1, al->cycles);
2983 if (al->cycles) {
2988 al->cycles, al->cycles_min,
2989 al->cycles_max);
3004 if (show_title && !*al->line) {
3012 if (!*al->line)
3014 else if (al->offset == -1) {
3015 if (al->line_nr && notes->options->show_linenr)
3016 printed = scnprintf(bf, sizeof(bf), "%-*d ", notes->widths.addr + 1, al->line_nr);
3020 obj__printf(obj, "%-*s", width - printed - pcnt_width - cycles_width + 1, al->line);
3022 u64 addr = al->offset;
3031 if (al->jump_sources &&
3037 al->jump_sources);
3038 prev = obj__set_jumps_percent_color(obj, al->jump_sources,
3046 } else if (ins__is_call(&disasm_line(al)->ins) &&
3063 disasm_line__write(disasm_line(al), notes, obj, bf, sizeof(bf), obj__printf, obj__write_graph);
3070 void annotation_line__write(struct annotation_line *al, struct annotation *notes,
3074 __annotation_line__write(al, notes, wops->first_line, wops->current_entry,