Lines Matching refs:al

1101 			struct annotation_line *al = notes->offsets[offset];
1103 if (al && al->ipc == 0.0) {
1104 al->ipc = ipc;
1135 struct annotation_line *al;
1139 al = notes->offsets[offset];
1140 if (al && ch->num_aggr) {
1141 al->cycles = ch->cycles_aggr / ch->num_aggr;
1142 al->cycles_max = ch->cycles_max;
1143 al->cycles_min = ch->cycles_min;
1213 static void annotation_line__init(struct annotation_line *al,
1217 al->offset = args->offset;
1218 al->line = strdup(args->line);
1219 al->line_nr = args->line_nr;
1220 al->fileloc = args->fileloc;
1221 al->data_nr = nr;
1224 static void annotation_line__exit(struct annotation_line *al)
1226 zfree_srcline(&al->path);
1227 zfree(&al->line);
1232 struct annotation_line *al;
1234 return (sizeof(struct disasm_line) + (sizeof(al->data[0]) * nr));
1260 annotation_line__init(&dl->al, args, nr);
1261 if (dl->al.line == NULL)
1265 if (disasm_line__parse(dl->al.line, &dl->ins.name, &dl->ops.raw) < 0)
1274 zfree(&dl->al.line);
1287 annotation_line__exit(&dl->al);
1357 static void annotation_line__add(struct annotation_line *al, struct list_head *head)
1359 list_add_tail(&al->node, head);
1456 s64 offset = dl->al.offset;
1462 color_fprintf(stdout, annotate__asm_color(br), "%s", dl->al.line);
1468 annotation_line__print(struct annotation_line *al, struct symbol *sym, u64 start,
1473 struct disasm_line *dl = container_of(al, struct disasm_line, al);
1476 if (al->offset != -1) {
1482 for (i = 0; i < al->data_nr; i++) {
1485 percent = annotation_data__percent(&al->data[i],
1492 if (al->data_nr > nr_percent)
1493 nr_percent = al->data_nr;
1503 if (queue == al)
1514 struct annotation_data *data = &al->data[i];
1539 if (al->path) {
1540 if (!prev_line || strcmp(prev_line, al->path)) {
1541 color_fprintf(stdout, color, " // %s", al->path);
1542 prev_line = al->path;
1558 if (!*al->line)
1561 printf(" %*s: %-*d %s\n", width, " ", addr_fmt_width, al->line_nr, al->line);
1649 annotation_line__add(&dl->al, &notes->src->source);
1665 dl = list_entry(list->prev, struct disasm_line, al.node);
1671 if (!strstr(dl->al.line, " nop ") &&
1672 !strstr(dl->al.line, " nopl ") &&
1673 !strstr(dl->al.line, " nopw "))
1677 list_del_init(&dl->al.node);
1938 annotation_line__add(&dl->al,
1950 annotation_line__add(&dl->al, &notes->src->source);
1984 annotation_line__add(&dl->al, &notes->src->source);
2267 struct annotation_line *al, *next;
2270 list_for_each_entry(al, &notes->src->source, node) {
2274 if (al->offset == -1)
2277 next = annotation_line__next(al, &notes->src->source);
2285 BUG_ON(i >= al->data_nr);
2288 data = &al->data[i++];
2290 calc_percent(sym_hist, hists, data, al->offset, end);
2345 static void insert_source_line(struct rb_root *root, struct annotation_line *al,
2357 ret = strcmp(iter->path, al->path);
2359 for (i = 0; i < al->data_nr; i++) {
2360 iter->data[i].percent_sum += annotation_data__percent(&al->data[i],
2372 for (i = 0; i < al->data_nr; i++) {
2373 al->data[i].percent_sum = annotation_data__percent(&al->data[i],
2377 rb_link_node(&al->rb_node, parent, p);
2378 rb_insert_color(&al->rb_node, root);
2394 static void __resort_source_line(struct rb_root *root, struct annotation_line *al)
2404 if (cmp_source_line(al, iter))
2410 rb_link_node(&al->rb_node, parent, p);
2411 rb_insert_color(&al->rb_node, root);
2416 struct annotation_line *al;
2423 al = rb_entry(node, struct annotation_line, rb_node);
2427 __resort_source_line(dest_root, al);
2434 struct annotation_line *al;
2452 al = rb_entry(node, struct annotation_line, rb_node);
2453 for (i = 0; i < al->data_nr; i++) {
2454 percent = al->data[i].percent_sum;
2462 path = al->path;
2649 struct annotation_line *al;
2651 list_for_each_entry(al, &notes->src->source, node) {
2652 if (annotation_line__filter(al, notes))
2654 annotation_line__write(al, notes, &wops, opts);
2717 struct annotation_line *al, *n;
2719 list_for_each_entry_safe(al, n, &as->source, node) {
2720 list_del_init(&al->node);
2721 disasm_line__free(disasm_line(al));
2729 if (dl->al.offset == -1)
2730 return fprintf(fp, "%s\n", dl->al.line);
2732 printed = fprintf(fp, "%#" PRIx64 " %s", dl->al.offset, dl->ins.name);
2747 list_for_each_entry(pos, head, al.node)
2772 struct annotation_line *al = notes->offsets[offset];
2775 dl = disasm_line(al);
2780 al = notes->offsets[dl->ops.target.offset];
2786 if (al == NULL)
2789 if (++al->jump_sources > notes->max_jump_sources)
2790 notes->max_jump_sources = al->jump_sources;
2796 struct annotation_line *al;
2802 list_for_each_entry(al, &notes->src->source, node) {
2803 size_t line_len = strlen(al->line);
2807 al->idx = notes->nr_entries++;
2808 if (al->offset != -1) {
2809 al->idx_asm = notes->nr_asm_entries++;
2817 if (al->offset < size)
2818 notes->offsets[al->offset] = al;
2820 al->idx_asm = -1;
2836 struct annotation_line *al;
2838 list_for_each_entry(al, &notes->src->source, node) {
2839 if (al->offset == -1)
2842 len = strlen(disasm_line(al)->ins.name);
2890 struct annotation_line *al;
2893 list_for_each_entry(al, &notes->src->source, node) {
2897 for (i = 0; i < al->data_nr; i++) {
2900 percent = annotation_data__percent(&al->data[i],
2910 al->path = get_srcline(map__dso(map), notes->start + al->offset, NULL,
2911 false, true, notes->start + al->offset);
2912 insert_source_line(&tmp_root, al, opts);
3001 static double annotation_line__max_percent(struct annotation_line *al,
3011 percent = annotation_data__percent(&al->data[i],
3032 fwd = dl->ops.target.offset > dl->al.offset;
3068 static void __annotation_line__write(struct annotation_line *al, struct annotation *notes,
3078 double percent_max = annotation_line__max_percent(al, notes, percent_type);
3085 if (first_line && (al->offset == -1 || percent_max == 0.0)) {
3087 if (al->ipc == 0.0 && al->cycles == 0)
3093 if (al->offset != -1 && percent_max != 0.0) {
3099 percent = annotation_data__percent(&al->data[i], percent_type);
3103 obj__printf(obj, "%11" PRIu64 " ", al->data[i].he.period);
3106 al->data[i].he.nr_samples);
3124 if (al->ipc)
3125 obj__printf(obj, "%*.2f ", ANNOTATION__IPC_WIDTH - 1, al->ipc);
3132 if (al->cycles)
3134 ANNOTATION__CYCLES_WIDTH - 1, al->cycles);
3143 if (al->cycles) {
3148 al->cycles, al->cycles_min,
3149 al->cycles_max);
3164 if (show_title && !*al->line) {
3172 if (!*al->line)
3174 else if (al->offset == -1) {
3175 if (al->line_nr && notes->options->show_linenr)
3176 printed = scnprintf(bf, sizeof(bf), "%-*d ", notes->widths.addr + 1, al->line_nr);
3180 obj__printf(obj, "%-*s", width - printed - pcnt_width - cycles_width + 1, al->line);
3182 u64 addr = al->offset;
3191 if (al->jump_sources &&
3197 al->jump_sources);
3198 prev = obj__set_jumps_percent_color(obj, al->jump_sources,
3206 } else if (ins__is_call(&disasm_line(al)->ins) &&
3223 disasm_line__write(disasm_line(al), notes, obj, bf, sizeof(bf), obj__printf, obj__write_graph);
3230 void annotation_line__write(struct annotation_line *al, struct annotation *notes,
3234 __annotation_line__write(al, notes, wops->first_line, wops->current_entry,