Lines Matching +full:1 +full:br +full:- +full:100
1 // SPDX-License-Identifier: GPL-2.0-only
5 * Parts came from builtin-annotate.c, see those files for further
16 #include "build-id.h"
30 #include "annotate-data.h"
33 #include "bpf-event.h"
34 #include "bpf-utils.h"
35 #include "block-range.h"
37 #include "dwarf-regs.h"
50 #include <subcmd/parse-options.h>
51 #include <subcmd/run-command.h>
64 #define UARROW_CHAR ((unsigned char)'-')
90 /* symbol histogram: key = offset << 16 | evsel->core.idx */
106 INIT_LIST_HEAD(&src->source); in annotated_source__new()
119 if (src->samples) { in annotated_source__delete()
120 hashmap__for_each_entry(src->samples, cur, bkt) in annotated_source__delete()
121 zfree(&cur->pvalue); in annotated_source__delete()
122 hashmap__free(src->samples); in annotated_source__delete()
124 zfree(&src->histograms); in annotated_source__delete()
131 src->nr_histograms = nr_hists; in annotated_source__alloc_histograms()
132 src->histograms = calloc(nr_hists, sizeof(*src->histograms)); in annotated_source__alloc_histograms()
134 if (src->histograms == NULL) in annotated_source__alloc_histograms()
135 return -1; in annotated_source__alloc_histograms()
137 src->samples = hashmap__new(sym_hist_hash, sym_hist_equal, NULL); in annotated_source__alloc_histograms()
138 if (src->samples == NULL) in annotated_source__alloc_histograms()
139 zfree(&src->histograms); in annotated_source__alloc_histograms()
141 return src->histograms ? 0 : -1; in annotated_source__alloc_histograms()
149 if (notes->src != NULL) { in symbol__annotate_zero_histograms()
150 memset(notes->src->histograms, 0, in symbol__annotate_zero_histograms()
151 notes->src->nr_histograms * sizeof(*notes->src->histograms)); in symbol__annotate_zero_histograms()
152 hashmap__clear(notes->src->samples); in symbol__annotate_zero_histograms()
154 if (notes->branch && notes->branch->cycles_hist) { in symbol__annotate_zero_histograms()
155 memset(notes->branch->cycles_hist, 0, in symbol__annotate_zero_histograms()
215 struct symbol *sym = ms->sym; in __symbol__inc_addr_samples()
221 pr_debug3("%s: addr=%#" PRIx64 "\n", __func__, map__unmap_ip(ms->map, addr)); in __symbol__inc_addr_samples()
223 if ((addr < sym->start || addr >= sym->end) && in __symbol__inc_addr_samples()
224 (addr != sym->end || sym->start != sym->end)) { in __symbol__inc_addr_samples()
225 …pr_debug("%s(%d): ERANGE! sym->name=%s, start=%#" PRIx64 ", addr=%#" PRIx64 ", end=%#" PRIx64 "\n", in __symbol__inc_addr_samples()
226 __func__, __LINE__, sym->name, sym->start, addr, sym->end); in __symbol__inc_addr_samples()
227 return -ERANGE; in __symbol__inc_addr_samples()
230 offset = addr - sym->start; in __symbol__inc_addr_samples()
233 …pr_debug("%s(%d): ENOMEM! sym->name=%s, start=%#" PRIx64 ", addr=%#" PRIx64 ", end=%#" PRIx64 ", f… in __symbol__inc_addr_samples()
234 __func__, __LINE__, sym->name, sym->start, addr, sym->end, sym->type == STT_FUNC); in __symbol__inc_addr_samples()
235 return -ENOMEM; in __symbol__inc_addr_samples()
239 if (!hashmap__find(src->samples, hash_key, &entry)) { in __symbol__inc_addr_samples()
242 return -ENOMEM; in __symbol__inc_addr_samples()
244 if (hashmap__add(src->samples, hash_key, entry) < 0) in __symbol__inc_addr_samples()
245 return -ENOMEM; in __symbol__inc_addr_samples()
248 h->nr_samples++; in __symbol__inc_addr_samples()
249 h->period += sample->period; in __symbol__inc_addr_samples()
250 entry->nr_samples++; in __symbol__inc_addr_samples()
251 entry->period += sample->period; in __symbol__inc_addr_samples()
255 sym->start, sym->name, addr, addr - sym->start, evidx, in __symbol__inc_addr_samples()
256 entry->nr_samples, entry->period); in __symbol__inc_addr_samples()
265 if (notes->branch == NULL) in annotation__get_branch()
266 notes->branch = zalloc(sizeof(*notes->branch)); in annotation__get_branch()
268 return notes->branch; in annotation__get_branch()
282 if (branch->cycles_hist == NULL) { in symbol__find_branch_hist()
283 branch->cycles_hist = calloc(size, sizeof(struct cyc_hist)); in symbol__find_branch_hist()
284 if (!branch->cycles_hist) in symbol__find_branch_hist()
288 if (br_cntr_nr && branch->br_cntr == NULL) { in symbol__find_branch_hist()
289 branch->br_cntr = calloc(br_cntr_nr * size, sizeof(u64)); in symbol__find_branch_hist()
290 if (!branch->br_cntr) in symbol__find_branch_hist()
301 if (notes->src == NULL) { in symbol__hists()
302 notes->src = annotated_source__new(); in symbol__hists()
303 if (notes->src == NULL) in symbol__hists()
308 if (notes->src->histograms == NULL) { in symbol__hists()
310 annotated_source__alloc_histograms(notes->src, nr_hists); in symbol__hists()
313 return notes->src; in symbol__hists()
320 struct symbol *sym = ms->sym; in symbol__inc_addr_samples()
325 src = symbol__hists(sym, evsel->evlist->core.nr_entries); in symbol__inc_addr_samples()
326 return src ? __symbol__inc_addr_samples(ms, src, evsel->core.idx, addr, sample) : 0; in symbol__inc_addr_samples()
334 unsigned int br_cntr_nr = evsel__leader(evsel)->br_cntr_nr; in symbol__account_br_cntr()
335 unsigned int base = evsel__leader(evsel)->br_cntr_idx; in symbol__account_br_cntr()
336 unsigned int off = offset * evsel->evlist->nr_br_cntr; in symbol__account_br_cntr()
337 u64 *branch_br_cntr = branch->br_cntr; in symbol__account_br_cntr()
344 mask = (1L << width) - 1; in symbol__account_br_cntr()
366 branch = symbol__find_branch_hist(sym, evsel->evlist->nr_br_cntr); in symbol__account_cycles()
368 return -ENOMEM; in symbol__account_cycles()
369 if (addr < sym->start || addr >= sym->end) in symbol__account_cycles()
370 return -ERANGE; in symbol__account_cycles()
373 if (start < sym->start || start >= sym->end) in symbol__account_cycles()
374 return -ERANGE; in symbol__account_cycles()
378 offset = addr - sym->start; in symbol__account_cycles()
379 ret = __symbol__account_cycles(branch->cycles_hist, in symbol__account_cycles()
380 start ? start - sym->start : 0, in symbol__account_cycles()
410 (start->ms.sym == ams->ms.sym || in addr_map_symbol__account_cycles()
411 (ams->ms.sym && in addr_map_symbol__account_cycles()
412 start->addr == ams->ms.sym->start + map__start(ams->ms.map)))) in addr_map_symbol__account_cycles()
413 saddr = start->al_addr; in addr_map_symbol__account_cycles()
416 ams->addr, in addr_map_symbol__account_cycles()
417 start ? start->addr : 0, in addr_map_symbol__account_cycles()
418 ams->ms.sym ? ams->ms.sym->start + map__start(ams->ms.map) : 0, in addr_map_symbol__account_cycles()
420 err = symbol__account_cycles(ams->al_addr, saddr, ams->ms.sym, cycles, evsel, br_cntr); in addr_map_symbol__account_cycles()
431 list_for_each_entry(al, &src->source, node) { in annotated_source__get_line()
432 if (al->offset == offset) in annotated_source__get_line()
443 al = annotated_source__get_line(notes->src, start); in annotation__count_insn()
447 list_for_each_entry_from(al, ¬es->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()
460 zfree(&branch->cycles_hist); in annotated_branch__delete()
461 free(branch->br_cntr); in annotated_branch__delete()
472 if (n_insn && ch->num && ch->cycles) { in annotation__count_and_fill()
475 float ipc = n_insn / ((double)ch->cycles / (double)ch->num); in annotation__count_and_fill()
478 if (ch->reset >= 0x7fff) in annotation__count_and_fill()
481 al = annotated_source__get_line(notes->src, start); in annotation__count_and_fill()
485 list_for_each_entry_from(al, ¬es->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()
498 branch->hit_cycles += ch->cycles; in annotation__count_and_fill()
499 branch->hit_insn += n_insn * ch->num; in annotation__count_and_fill()
500 branch->cover_insn += cover_insn; in annotation__count_and_fill()
508 unsigned int br_cntr_nr = evsel->evlist->nr_br_cntr; in annotation__compute_ipc()
512 if (!notes->branch || !notes->branch->cycles_hist) in annotation__compute_ipc()
515 notes->branch->total_insn = annotation__count_insn(notes, 0, size - 1); in annotation__compute_ipc()
516 notes->branch->hit_cycles = 0; in annotation__compute_ipc()
517 notes->branch->hit_insn = 0; in annotation__compute_ipc()
518 notes->branch->cover_insn = 0; in annotation__compute_ipc()
521 for (offset = size - 1; offset >= 0; --offset) { in annotation__compute_ipc()
524 ch = ¬es->branch->cycles_hist[offset]; in annotation__compute_ipc()
525 if (ch && ch->cycles) { in annotation__compute_ipc()
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()
536 if (ch->have_start) in annotation__compute_ipc()
537 annotation__count_and_fill(notes, ch->start, offset, ch); 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, ¬es->branch->br_cntr[offset * br_cntr_nr], in annotation__compute_ipc()
562 struct cyc_hist *ch = ¬es->branch->cycles_hist[offset]; in annotation__compute_ipc()
564 if (ch && ch->cycles) { in annotation__compute_ipc()
567 al = annotated_source__get_line(notes->src, offset); in annotation__compute_ipc()
569 zfree(&al->cycles); in annotation__compute_ipc()
570 zfree(&al->br_cntr); in annotation__compute_ipc()
583 return symbol__inc_addr_samples(&ams->ms, evsel, ams->al_addr, sample); in addr_map_symbol__inc_samples()
589 return symbol__inc_addr_samples(&he->ms, evsel, ip, sample); in hist_entry__inc_addr_samples()
595 annotated_source__delete(notes->src); in annotation__exit()
596 annotated_branch__delete(notes->branch); in annotation__exit()
653 list_add_tail(&al->node, head); in annotation_line__add()
660 if (pos->offset >= 0) in annotation_line__next()
666 static const char *annotate__address_color(struct block_range *br) in annotate__address_color() argument
668 double cov = block_range__coverage(br); in annotate__address_color()
675 /* mark dull for <1% coverage */ in annotate__address_color()
683 static const char *annotate__asm_color(struct block_range *br) in annotate__asm_color() argument
685 double cov = block_range__coverage(br); in annotate__asm_color()
688 /* mark dull for <1% coverage */ in annotate__asm_color()
696 static void annotate__branch_printf(struct block_range *br, u64 addr) in annotate__branch_printf() argument
700 if (!br) in annotate__branch_printf()
703 #if 1 in annotate__branch_printf()
704 if (br->is_target && br->start == addr) { in annotate__branch_printf()
705 struct block_range *branch = br; in annotate__branch_printf()
711 while (!branch->is_branch) in annotate__branch_printf()
714 p = 100 *(double)br->entry / branch->coverage; in annotate__branch_printf()
730 if (br->is_branch && br->end == addr) { in annotate__branch_printf()
731 double p = 100*(double)br->taken / br->coverage; in annotate__branch_printf()
743 printf(" -%.2f%% (p:%.2f%%)", p, 100*(double)br->pred / br->taken); in annotate__branch_printf()
750 s64 offset = dl->al.offset; in disasm_line__print()
752 struct block_range *br; in disasm_line__print() local
754 br = block_range__find(addr); in disasm_line__print()
755 color_fprintf(stdout, annotate__address_color(br), " %*" PRIx64 ":", addr_fmt_width, addr); in disasm_line__print()
756 color_fprintf(stdout, annotate__asm_color(br), "%s", dl->al.line); in disasm_line__print()
757 annotate__branch_printf(br, addr); in disasm_line__print()
771 if (al->offset != -1) { in annotation_line__print()
773 int i, nr_percent = 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()
790 return -1; in annotation_line__print()
793 return 1; in annotation_line__print()
796 list_for_each_entry_from(queue, ¬es->src->source, node) { in annotation_line__print()
800 0, 0, 1, NULL, addr_fmt_width, in annotation_line__print()
808 struct annotation_data *data = &al->data[i]; in annotation_line__print()
816 data->he.period); in annotation_line__print()
819 data->he.nr_samples); 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()
842 return 1; in annotation_line__print()
847 return -1; 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()
864 int evidx = evsel->core.idx; in calc_percent()
872 entry = annotated_source__hist_entry(notes->src, evidx, offset); in calc_percent()
874 hits += entry->nr_samples; in calc_percent()
875 period += entry->period; in calc_percent()
880 if (sym_hist->nr_samples) { in calc_percent()
881 data->he.period = period; in calc_percent()
882 data->he.nr_samples = hits; in calc_percent()
883 data->percent[PERCENT_HITS_LOCAL] = 100.0 * hits / sym_hist->nr_samples; in calc_percent()
886 if (hists->stats.nr_non_filtered_samples) in calc_percent()
887 data->percent[PERCENT_HITS_GLOBAL] = 100.0 * hits / hists->stats.nr_non_filtered_samples; in calc_percent()
889 if (sym_hist->period) in calc_percent()
890 data->percent[PERCENT_PERIOD_LOCAL] = 100.0 * period / sym_hist->period; in calc_percent()
892 if (hists->stats.total_period) in calc_percent()
893 data->percent[PERCENT_PERIOD_GLOBAL] = 100.0 * period / hists->stats.total_period; in calc_percent()
902 list_for_each_entry(al, ¬es->src->source, node) { in annotation__calc_percent()
906 if (al->offset == -1) in annotation__calc_percent()
909 next = annotation_line__next(al, ¬es->src->source); in annotation__calc_percent()
910 end = next ? next->offset : len; in annotation__calc_percent()
915 BUG_ON(i >= al->data_nr); in annotation__calc_percent()
918 evsel__hists(evsel)->stats.nr_samples == 0) 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()
953 if (arch->init) { in evsel__get_arch()
954 err = arch->init(arch, env ? env->cpuid : NULL); in evsel__get_arch()
957 __func__, arch->name); in evsel__get_arch()
967 struct symbol *sym = ms->sym; in symbol__annotate()
983 if (notes->src && !list_empty(¬es->src->source)) in symbol__annotate()
989 if (notes->src == NULL) { in symbol__annotate()
990 notes->src = annotated_source__new(); in symbol__annotate()
991 if (notes->src == NULL) in symbol__annotate()
992 return -1; in symbol__annotate()
1001 evsel__hists(pos)->stats.nr_samples == 0) in symbol__annotate()
1006 notes->src->nr_events = nr ? nr : 1; in symbol__annotate()
1009 notes->src->start = map__objdump_2mem(ms->map, ms->sym->start); in symbol__annotate()
1011 notes->src->start = map__rip_2objdump(ms->map, ms->sym->start); in symbol__annotate()
1019 struct rb_node **p = &root->rb_node; in insert_source_line()
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()
1038 p = &(*p)->rb_left; in insert_source_line()
1040 p = &(*p)->rb_right; 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()
1056 for (i = 0; i < a->data_nr; i++) { in cmp_source_line()
1057 if (a->data[i].percent_sum == b->data[i].percent_sum) in cmp_source_line()
1059 return a->data[i].percent_sum > b->data[i].percent_sum; in cmp_source_line()
1068 struct rb_node **p = &root->rb_node; in __resort_source_line()
1076 p = &(*p)->rb_left; in __resort_source_line()
1078 p = &(*p)->rb_right; 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()
1109 printf("----------------------------------------------\n\n"); 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()
1143 int evidx = evsel->core.idx; in symbol__annotate_hits()
1151 entry = annotated_source__hist_entry(notes->src, evidx, offset); in symbol__annotate_hits()
1152 if (entry && entry->nr_samples != 0) in symbol__annotate_hits()
1154 sym->start + offset, entry->nr_samples); in symbol__annotate_hits()
1156 printf("%*s: %" PRIu64 "\n", BITS_PER_LONG / 2, "h->nr_samples", h->nr_samples); in symbol__annotate_hits()
1165 if (line->offset != -1) in annotated_source__addr_fmt_width()
1166 return scnprintf(bf, sizeof(bf), "%" PRIx64, start + line->offset); in annotated_source__addr_fmt_width()
1174 struct map *map = ms->map; in symbol__annotate_printf()
1175 struct symbol *sym = ms->sym; in symbol__annotate_printf()
1181 struct sym_hist *h = annotation__histogram(notes, evsel->core.idx); in symbol__annotate_printf()
1184 u64 start = map__rip_2objdump(map, sym->start); in symbol__annotate_printf()
1187 bool context = opts->context; in symbol__annotate_printf()
1195 return -ENOMEM; in symbol__annotate_printf()
1197 if (opts->full_path) in symbol__annotate_printf()
1209 graph_dotted_len = printf(" %-*.*s| Source code & Disassembly of %s for %s (%" PRIu64 " samples, " in symbol__annotate_printf()
1213 d_filename, evsel_name, h->nr_samples, in symbol__annotate_printf()
1214 percent_type_str(opts->percent_type)); in symbol__annotate_printf()
1216 printf("%-*.*s----\n", in symbol__annotate_printf()
1222 addr_fmt_width = annotated_source__addr_fmt_width(¬es->src->source, start); in symbol__annotate_printf()
1224 list_for_each_entry(pos, ¬es->src->source, node) { in symbol__annotate_printf()
1233 opts->min_pcnt, printed, opts->max_lines, in symbol__annotate_printf()
1234 queue, addr_fmt_width, opts->percent_type); in symbol__annotate_printf()
1245 case 1: in symbol__annotate_printf()
1249 case -1: in symbol__annotate_printf()
1258 queue = list_entry(queue->node.next, typeof(*queue), node); in symbol__annotate_printf()
1325 list_for_each_entry(al, ¬es->src->source, node) { in symbol__annotate_fprintf2()
1341 int err = -1; in map_symbol__annotation_dump()
1344 if (asprintf(&filename, "%s.annotation", ms->sym->name) < 0) in map_symbol__annotation_dump()
1345 return -1; in map_symbol__annotation_dump()
1357 ms->sym->name, dso__long_name(map__dso(ms->map)), ev_name); in map_symbol__annotation_dump()
1358 symbol__annotate_fprintf2(ms->sym, fp); in map_symbol__annotation_dump()
1372 memset(h, 0, sizeof(*notes->src->histograms) * notes->src->nr_histograms); in symbol__annotate_zero_histogram()
1381 h->nr_samples = 0; in symbol__annotate_decay_histogram()
1382 list_for_each_entry(al, ¬es->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()
1392 entry->nr_samples = entry->nr_samples * 7 / 8; in symbol__annotate_decay_histogram()
1393 h->nr_samples += entry->nr_samples; in symbol__annotate_decay_histogram()
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()
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()
1416 if (dl->ops.raw[0] != '\0') { in disasm_line__fprintf()
1417 printed += fprintf(fp, "%.*s %s\n", 6 - (int)printed, " ", in disasm_line__fprintf()
1418 dl->ops.raw); in disasm_line__fprintf()
1437 if (!dl || !dl->ins.ops || !ins__is_jump(&dl->ins) || in disasm_line__is_valid_local_jump()
1438 !disasm_line__has_local_offset(dl) || dl->ops.target.offset < 0 || in disasm_line__is_valid_local_jump()
1439 dl->ops.target.offset >= (s64)symbol__size(sym)) in disasm_line__is_valid_local_jump()
1451 if (strstr(sym->name, "@plt")) in annotation__mark_jump_targets()
1454 list_for_each_entry(al, ¬es->src->source, node) { in annotation__mark_jump_targets()
1463 target = annotated_source__get_line(notes->src, in annotation__mark_jump_targets()
1464 dl->ops.target.offset); in annotation__mark_jump_targets()
1472 if (++target->jump_sources > notes->src->max_jump_sources) in annotation__mark_jump_targets()
1473 notes->src->max_jump_sources = target->jump_sources; in annotation__mark_jump_targets()
1480 struct annotated_source *src = notes->src; in annotation__set_index()
1482 src->widths.max_line_len = 0; in annotation__set_index()
1483 src->nr_entries = 0; in annotation__set_index()
1484 src->nr_asm_entries = 0; in annotation__set_index()
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()
1489 if (src->widths.max_line_len < line_len) in annotation__set_index()
1490 src->widths.max_line_len = line_len; 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()
1501 if (n >= 100) in width_jumps()
1505 return 1; in width_jumps()
1513 list_for_each_entry(al, ¬es->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()
1528 notes->src->widths.addr = notes->src->widths.target = in annotation__init_column_widths()
1529 notes->src->widths.min_addr = hex_width(symbol__size(sym)); in annotation__init_column_widths()
1530 notes->src->widths.max_addr = hex_width(sym->end); in annotation__init_column_widths()
1531 notes->src->widths.jumps = width_jumps(notes->src->max_jump_sources); in annotation__init_column_widths()
1532 notes->src->widths.max_ins_name = annotation__max_ins_name(notes); in annotation__init_column_widths()
1538 notes->src->widths.target = notes->src->widths.min_addr; in annotation__update_column_widths()
1540 notes->src->widths.target = BITS_PER_LONG / 4; in annotation__update_column_widths()
1542 notes->src->widths.target = notes->src->widths.max_addr; in annotation__update_column_widths()
1544 notes->src->widths.addr = notes->src->widths.target; in annotation__update_column_widths()
1547 notes->src->widths.addr += notes->src->widths.jumps + 1; in annotation__update_column_widths()
1555 notes->src->start = map__objdump_2mem(ms->map, ms->sym->start); in annotation__toggle_full_addr()
1557 notes->src->start = map__rip_2objdump(ms->map, ms->sym->start); in annotation__toggle_full_addr()
1568 list_for_each_entry(al, ¬es->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()
1586 addr = map__rip_2objdump(ms->map, ms->sym->start); 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()
1597 struct annotation *notes = symbol__annotation(ms->sym); in symbol__calc_lines()
1604 struct dso *dso = map__dso(ms->map); in symbol__tty_annotate2()
1605 struct symbol *sym = ms->sym; in symbol__tty_annotate2()
1617 ui__error("Couldn't annotate %s:\n%s", sym->name, msg); in symbol__tty_annotate2()
1618 return -1; in symbol__tty_annotate2()
1629 buf, percent_type_str(annotate_opts.percent_type), sym->name, dso__long_name(dso)); in symbol__tty_annotate2()
1632 annotated_source__purge(symbol__annotation(sym)->src); in symbol__tty_annotate2()
1639 struct dso *dso = map__dso(ms->map); in symbol__tty_annotate()
1640 struct symbol *sym = ms->sym; in symbol__tty_annotate()
1650 ui__error("Couldn't annotate %s:\n%s", sym->name, msg); in symbol__tty_annotate()
1651 return -1; in symbol__tty_annotate()
1664 annotated_source__purge(symbol__annotation(sym)->src); in symbol__tty_annotate()
1671 return use_browser == 1 && perf_hpp_list.sym; in ui__has_annotation()
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()
1699 if (dl->ins.ops && dl->ins.ops->scnprintf) { in disasm_line__write()
1700 if (ins__is_jump(&dl->ins)) { in disasm_line__write()
1703 if (dl->ops.target.outside) in disasm_line__write()
1705 fwd = dl->ops.target.offset > dl->al.offset; in disasm_line__write()
1708 } else if (ins__is_call(&dl->ins)) { in disasm_line__write()
1712 } else if (ins__is_ret(&dl->ins)) { in disasm_line__write()
1723 notes->src->widths.max_ins_name); in disasm_line__write()
1731 if (branch && branch->hit_cycles) in ipc_coverage_string()
1732 ipc = branch->hit_insn / ((double)branch->hit_cycles); in ipc_coverage_string()
1734 if (branch && branch->total_insn) { in ipc_coverage_string()
1735 coverage = branch->cover_insn * 100.0 / in ipc_coverage_string()
1736 ((double)branch->total_insn); in ipc_coverage_string()
1739 scnprintf(bf, size, "(Average IPC: %.2f, IPC Coverage: %.1f%%)", in ipc_coverage_string()
1748 if (evsel->evlist->nr_br_cntr <= 0) in annotation_br_cntr_abbr_list()
1749 return -ENOTSUP; in annotation_br_cntr_abbr_list()
1756 evlist__for_each_entry(evsel->evlist, pos) { in annotation_br_cntr_abbr_list()
1757 if (!(pos->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_COUNTERS)) in annotation_br_cntr_abbr_list()
1762 if (strbuf_addf(&sb, " %s = %s\n", pos->name, pos->abbr_name)) in annotation_br_cntr_abbr_list()
1768 if (strbuf_addf(&sb, " '-' No event occurs\n")) in annotation_br_cntr_abbr_list()
1781 return -ENOMEM; in annotation_br_cntr_abbr_list()
1791 struct evsel *pos = evsel ? evlist__first(evsel->evlist) : NULL; in annotation_br_cntr_entry()
1804 * With -v, the exact number of branch counter is displayed. in annotation_br_cntr_entry()
1807 evlist__for_each_entry_from(evsel->evlist, pos) { in annotation_br_cntr_entry()
1808 if ((pos->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_COUNTERS) && in annotation_br_cntr_entry()
1809 (pos->br_cntr_idx == i)) in annotation_br_cntr_entry()
1812 if (strbuf_addstr(&sb, pos->abbr_name)) in annotation_br_cntr_entry()
1816 if (strbuf_addstr(&sb, "=-")) in annotation_br_cntr_entry()
1830 if ((i < br_cntr_nr - 1) && strbuf_addch(&sb, ',')) in annotation_br_cntr_entry()
1839 if (strbuf_addch(&sb, '-')) in annotation_br_cntr_entry()
1843 evlist__for_each_entry_from(evsel->evlist, pos) { in annotation_br_cntr_entry()
1844 if ((pos->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_COUNTERS) && in annotation_br_cntr_entry()
1845 (pos->br_cntr_idx == i)) in annotation_br_cntr_entry()
1857 if (strbuf_addstr(&sb, pos->abbr_name)) in annotation_br_cntr_entry()
1869 for (j = used; j < ANNOTATION_BR_CNTR_SATURATION + 1; j++) { in annotation_br_cntr_entry()
1883 return -ENOMEM; in annotation_br_cntr_entry()
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()
1933 obj__printf(obj, "%-*s", pcnt_width, " "); in __annotation_line__write()
1935 obj__printf(obj, "%-*s", pcnt_width, in __annotation_line__write()
1941 if (notes->branch) { 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()
1947 obj__printf(obj, "%*s ", ANNOTATION__IPC_WIDTH - 1, "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()
1958 ANNOTATION__CYCLES_WIDTH - 1, 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()
1970 ANNOTATION__MINMAX_CYCLES_WIDTH - 1, in __annotation_line__write()
1978 ANNOTATION__MINMAX_CYCLES_WIDTH - 1, 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()
2007 obj__printf(obj, "%-*s", width - pcnt_width - cycles_width, " "); 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()
2010 printed = scnprintf(bf, sizeof(bf), "%-*d ", in __annotation_line__write()
2011 notes->src->widths.addr + 1, al->line_nr); in __annotation_line__write()
2013 printed = scnprintf(bf, sizeof(bf), "%-*s ", in __annotation_line__write()
2014 notes->src->widths.addr, " "); 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()
2019 int color = -1; in __annotation_line__write()
2022 addr += notes->src->start; in __annotation_line__write()
2027 if (al->jump_sources && in __annotation_line__write()
2032 notes->src->widths.jumps, 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()
2041 notes->src->widths.target, addr); in __annotation_line__write()
2042 } else if (ins__is_call(&disasm_line(al)->ins) && in __annotation_line__write()
2048 printed = scnprintf(bf, sizeof(bf), "%-*s ", in __annotation_line__write()
2049 notes->src->widths.addr, " "); in __annotation_line__write()
2061 obj__printf(obj, "%-*s", width - pcnt_width - cycles_width - 3 - printed, bf); in __annotation_line__write()
2069 __annotation_line__write(al, notes, wops->first_line, wops->current_entry, in annotation_line__write()
2070 wops->change_color, wops->width, wops->obj, in annotation_line__write()
2072 wops->set_color, wops->set_percent_color, in annotation_line__write()
2073 wops->set_jumps_percent_color, wops->printf, in annotation_line__write()
2074 wops->write_graph); in annotation_line__write()
2080 struct symbol *sym = ms->sym; in symbol__annotate2()
2100 sym->annotate2 = 1; in symbol__annotate2()
2113 perf_config_u8(&opt->offset_level, "offset_level", value); in annotation__config()
2115 if (opt->offset_level > ANNOTATION__MAX_OFFSET_LEVEL) in annotation__config()
2116 opt->offset_level = ANNOTATION__MAX_OFFSET_LEVEL; in annotation__config()
2117 else if (opt->offset_level < ANNOTATION__MIN_OFFSET_LEVEL) in annotation__config()
2118 opt->offset_level = ANNOTATION__MIN_OFFSET_LEVEL; in annotation__config()
2120 opt->hide_src_code = perf_config_bool("hide_src_code", value); in annotation__config()
2122 opt->jump_arrows = perf_config_bool("jump_arrows", value); in annotation__config()
2124 opt->show_linenr = perf_config_bool("show_linenr", value); in annotation__config()
2126 opt->show_nr_jumps = perf_config_bool("show_nr_jumps", value); in annotation__config()
2134 opt->use_offset = perf_config_bool("use_offset", value); in annotation__config()
2136 opt->disassembler_style = strdup(value); in annotation__config()
2137 if (!opt->disassembler_style) { in annotation__config()
2139 return -1; in annotation__config()
2142 opt->objdump_path = strdup(value); in annotation__config()
2143 if (!opt->objdump_path) { in annotation__config()
2145 return -1; in annotation__config()
2151 return -1; in annotation__config()
2171 opt->use_offset = true; in annotation_options__init()
2172 opt->jump_arrows = true; in annotation_options__init()
2173 opt->annotate_src = true; in annotation_options__init()
2174 opt->offset_level = ANNOTATION__OFFSET_JUMP_TARGETS; in annotation_options__init()
2175 opt->percent_type = PERCENT_PERIOD_LOCAL; in annotation_options__init()
2191 unsigned int type = (unsigned int) -1; in parse_percent_type()
2215 int err = -1; in annotate_parse_percent_type()
2219 return -ENOMEM; in annotate_parse_percent_type()
2221 str2 = strchr(str1, '-'); in annotate_parse_percent_type()
2228 if (type == (unsigned int) -1) in annotate_parse_percent_type()
2230 if (type != (unsigned int) -1) { in annotate_parse_percent_type()
2244 if (args->prefix_strip && !args->prefix) { in annotate_check_args()
2245 pr_err("--prefix-strip requires --prefix\n"); in annotate_check_args()
2246 return -1; in annotate_check_args()
2263 if (arch->objdump.register_char == 0) in extract_reg_offset()
2264 return -1; in extract_reg_offset()
2273 if (*str == arch->objdump.register_char) { in extract_reg_offset()
2277 op_loc->segment = INSN_SEG_X86_GS; in extract_reg_offset()
2281 *str != arch->objdump.memory_ref_char) in extract_reg_offset()
2285 op_loc->offset = strtol(str, &p, 0); in extract_reg_offset()
2287 p = strchr(p, arch->objdump.register_char); in extract_reg_offset()
2289 return -1; in extract_reg_offset()
2293 return -1; in extract_reg_offset()
2295 op_loc->reg1 = get_dwarf_regnum(regname, 0); in extract_reg_offset()
2299 if (op_loc->multi_regs) { in extract_reg_offset()
2300 p = strchr(p + 1, arch->objdump.register_char); in extract_reg_offset()
2302 return -1; in extract_reg_offset()
2306 return -1; in extract_reg_offset()
2308 op_loc->reg2 = get_dwarf_regnum(regname, 0); in extract_reg_offset()
2315 * annotate_get_insn_location - Get location of instruction
2328 * mov (%rax), %rcx # src_reg1 = rax, src_mem = 1, src_offset = 0
2331 * mov 0x18, %r8 # src_reg1 = -1, src_mem = 0
2335 * # dst_reg1 = rbx, dst_reg2 = rcx, dst_mem = 1
2336 * # dst_multi_regs = 1, dst_offset = 8
2345 if (ins__is_lock(&dl->ins)) in annotate_get_insn_location()
2346 ops = dl->ops.locked.ops; in annotate_get_insn_location()
2348 ops = &dl->ops; in annotate_get_insn_location()
2351 return -1; in annotate_get_insn_location()
2356 const char *insn_str = ops->source.raw; in annotate_get_insn_location()
2357 bool multi_regs = ops->source.multi_regs; in annotate_get_insn_location()
2358 bool mem_ref = ops->source.mem_ref; in annotate_get_insn_location()
2361 insn_str = ops->target.raw; in annotate_get_insn_location()
2362 multi_regs = ops->target.multi_regs; in annotate_get_insn_location()
2363 mem_ref = ops->target.mem_ref; in annotate_get_insn_location()
2367 op_loc->reg1 = -1; in annotate_get_insn_location()
2368 op_loc->reg2 = -1; in annotate_get_insn_location()
2381 op_loc->mem_ref = mem_ref; in annotate_get_insn_location()
2382 op_loc->multi_regs = multi_regs; in annotate_get_insn_location()
2383 get_powerpc_regs(dl->raw.raw_insn, !i, op_loc); in annotate_get_insn_location()
2384 } else if (strchr(insn_str, arch->objdump.memory_ref_char)) { in annotate_get_insn_location()
2385 op_loc->mem_ref = true; in annotate_get_insn_location()
2386 op_loc->multi_regs = multi_regs; in annotate_get_insn_location()
2394 op_loc->segment = INSN_SEG_X86_GS; in annotate_get_insn_location()
2395 op_loc->offset = strtol(insn_str + 4, in annotate_get_insn_location()
2398 op_loc->imm = true; in annotate_get_insn_location()
2405 return -1; in annotate_get_insn_location()
2407 if (*s == arch->objdump.register_char) in annotate_get_insn_location()
2408 op_loc->reg1 = get_dwarf_regnum(s, 0); in annotate_get_insn_location()
2409 else if (*s == arch->objdump.imm_char) { in annotate_get_insn_location()
2410 op_loc->offset = strtol(s + 1, &p, 0); in annotate_get_insn_location()
2411 if (p && p != s + 1) in annotate_get_insn_location()
2412 op_loc->imm = true; in annotate_get_insn_location()
2429 list_for_each_entry(dl, ¬es->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()
2435 * llvm-objdump places "lock" in a separate line and in find_disasm_line()
2438 if (ins__is_lock(&dl->ins) && in find_disasm_line()
2439 *dl->ops.raw == '\0' && allow_update) { in find_disasm_line()
2455 if (!strcmp(istat->name, name)) in annotate_data_stat()
2463 istat->name = strdup(name); in annotate_data_stat()
2464 if ((istat->name == NULL) || (!strlen(istat->name))) { in annotate_data_stat()
2469 list_add_tail(&istat->list, head); in annotate_data_stat()
2476 if (!strncmp(dl->ins.name, "push", 4) || in is_stack_operation()
2477 !strncmp(dl->ins.name, "pop", 3) || in is_stack_operation()
2478 !strncmp(dl->ins.name, "call", 4) || in is_stack_operation()
2479 !strncmp(dl->ins.name, "ret", 3)) in is_stack_operation()
2490 if (loc->segment == INSN_SEG_X86_GS && loc->imm && in is_stack_canary()
2491 loc->offset == 40) in is_stack_canary()
2501 struct list_head *sources = ¬es->src->source; in annotation__prev_asm_line()
2508 while (prev->al.offset == -1 && in annotation__prev_asm_line()
2512 if (prev->al.offset == -1) in annotation__prev_asm_line()
2521 struct list_head *sources = ¬es->src->source; in annotation__next_asm_line()
2528 while (next->al.offset == -1 && in annotation__next_asm_line()
2532 if (next->al.offset == -1) in annotation__next_asm_line()
2545 notes = symbol__annotation(ms->sym); in annotate_calc_pcrel()
2547 * PC-relative addressing starts from the next instruction address in annotate_calc_pcrel()
2555 addr = ms->sym->end + offset; in annotate_calc_pcrel()
2557 addr = ip + (next->al.offset - dl->al.offset) + offset; in annotate_calc_pcrel()
2559 return map__rip_2objdump(ms->map, addr); in annotate_calc_pcrel()
2577 * hist_entry__get_data_type - find data type for given hist entry
2580 * This function first annotates the instruction at @he->ip and extracts
2587 struct map_symbol *ms = &he->ms; in hist_entry__get_data_type()
2588 struct evsel *evsel = hists_to_evsel(he->hists); in hist_entry__get_data_type()
2595 u64 ip = he->ip; in hist_entry__get_data_type()
2600 if (ms->map == NULL || ms->sym == NULL) { in hist_entry__get_data_type()
2618 if (map__dso(ms->map) != di_cache.dso) { in hist_entry__get_data_type()
2620 di_cache.dso = dso__get(map__dso(ms->map)); in hist_entry__get_data_type()
2641 dl = find_disasm_line(ms->sym, ip, /*allow_update=*/true); in hist_entry__get_data_type()
2648 istat = annotate_data_stat(&ann_insn_stat, dl->ins.name); in hist_entry__get_data_type()
2656 istat->bad++; in hist_entry__get_data_type()
2661 istat->good++; in hist_entry__get_data_type()
2662 he->mem_type_off = 0; in hist_entry__get_data_type()
2669 .thread = he->thread, in hist_entry__get_data_type()
2672 .ip = ms->sym->start + dl->al.offset, in hist_entry__get_data_type()
2673 .cpumode = he->cpumode, in hist_entry__get_data_type()
2678 if (!op_loc->mem_ref && op_loc->segment == INSN_SEG_NONE) in hist_entry__get_data_type()
2682 ip = ms->sym->start + dl->al.offset; in hist_entry__get_data_type()
2684 /* PC-relative addressing */ in hist_entry__get_data_type()
2685 if (op_loc->reg1 == DWARF_REG_PC) { in hist_entry__get_data_type()
2687 op_loc->offset, dl); in hist_entry__get_data_type()
2690 /* This CPU access in kernel - pretend PC-relative addressing */ in hist_entry__get_data_type()
2691 if (dso__kernel(map__dso(ms->map)) && arch__is(arch, "x86") && in hist_entry__get_data_type()
2692 op_loc->segment == INSN_SEG_X86_GS && op_loc->imm) { in hist_entry__get_data_type()
2693 dloc.var_addr = op_loc->offset; in hist_entry__get_data_type()
2694 op_loc->reg1 = DWARF_REG_PC; in hist_entry__get_data_type()
2700 istat->good++; in hist_entry__get_data_type()
2701 he->mem_type_off = 0; in hist_entry__get_data_type()
2706 istat->good++; in hist_entry__get_data_type()
2708 istat->bad++; in hist_entry__get_data_type()
2713 he->stat.nr_events, in hist_entry__get_data_type()
2714 he->stat.period); in hist_entry__get_data_type()
2716 he->mem_type_off = dloc.type_offset; in hist_entry__get_data_type()
2724 if (dl->al.offset > 0) { in hist_entry__get_data_type()
2728 notes = symbol__annotation(ms->sym); in hist_entry__get_data_type()
2731 if (prev_dl && ins__is_fused(arch, prev_dl->ins.name, dl->ins.name)) { in hist_entry__get_data_type()
2738 istat->bad++; 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()
2779 if (basic_block_has_offset(&bb_data->visited, offset)) in is_new_basic_block()
2781 if (basic_block_has_offset(&bb_data->queue, offset)) in is_new_basic_block()
2795 return -1; in add_basic_block()
2802 return -1; in add_basic_block()
2804 bb->begin = dl; in add_basic_block()
2805 bb->end = dl; in add_basic_block()
2806 INIT_LIST_HEAD(&bb->list); in add_basic_block()
2811 return -1; in add_basic_block()
2814 link->bb = bb; in add_basic_block()
2815 link->parent = parent; in add_basic_block()
2816 list_add_tail(&link->node, &bb_data->queue); in add_basic_block()
2829 dl = link->bb->begin; in process_basic_block()
2831 if (basic_block_has_offset(&bb_data->visited, dl->al.offset)) in process_basic_block()
2834 last_dl = list_last_entry(¬es->src->source, in process_basic_block()
2836 if (last_dl->al.offset == -1) in process_basic_block()
2842 list_for_each_entry_from(dl, ¬es->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()
2855 if (ins__is_ret(&dl->ins)) in process_basic_block()
2858 if (!ins__is_jump(&dl->ins)) in process_basic_block()
2861 if (dl->ops.target.outside) in process_basic_block()
2864 next_dl = find_disasm_line(sym, sym->start + dl->ops.target.offset, in process_basic_block()
2874 if (!strstr(dl->ins.name, "jmp")) { in process_basic_block()
2882 link->bb->end = dl; in process_basic_block()
2894 struct basic_block_link *parent = link->parent; in link_found_basic_blocks()
2896 list_move(&link->bb->list, head); in link_found_basic_blocks()
2897 list_del(&link->node); in link_found_basic_blocks()
2908 list_for_each_entry_safe(link, tmp, &bb_data->queue, node) { in delete_basic_blocks()
2909 list_del(&link->node); in delete_basic_blocks()
2910 zfree(&link->bb); in delete_basic_blocks()
2914 list_for_each_entry_safe(link, tmp, &bb_data->visited, node) { in delete_basic_blocks()
2915 list_del(&link->node); in delete_basic_blocks()
2916 zfree(&link->bb); in delete_basic_blocks()
2922 * annotate_get_basic_blocks - Get basic blocks for given address range
2942 int ret = -1; in annotate_get_basic_blocks()
2946 return -1; in annotate_get_basic_blocks()
2949 return -1; in annotate_get_basic_blocks()
2960 list_move(&link->node, &bb_data.visited); in annotate_get_basic_blocks()