Lines Matching +full:avg +full:- +full:samples

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()
238 hash_key = offset << 16 | evsel->core.idx; 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, evsel->core.idx, 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()
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, &notes->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, &notes->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 = &notes->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, &notes->branch->br_cntr[offset * br_cntr_nr], in annotation__compute_ipc()
562 struct cyc_hist *ch = &notes->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()
704 if (br->is_target && br->start == addr) { 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()
756 color_fprintf(stdout, annotate__asm_color(br), "%s", dl->al.line); in disasm_line__print()
771 if (al->offset != -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()
796 list_for_each_entry_from(queue, &notes->src->source, node) { 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()
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()
871 entry = annotated_source__hist_entry(notes->src, evsel, offset); in calc_percent()
873 hits += entry->nr_samples; in calc_percent()
874 period += entry->period; in calc_percent()
879 if (sym_hist->nr_samples) { in calc_percent()
880 data->he.period = period; in calc_percent()
881 data->he.nr_samples = hits; in calc_percent()
882 data->percent[PERCENT_HITS_LOCAL] = 100.0 * hits / sym_hist->nr_samples; in calc_percent()
885 if (hists->stats.nr_non_filtered_samples) in calc_percent()
886 data->percent[PERCENT_HITS_GLOBAL] = 100.0 * hits / hists->stats.nr_non_filtered_samples; in calc_percent()
888 if (sym_hist->period) in calc_percent()
889 data->percent[PERCENT_PERIOD_LOCAL] = 100.0 * period / sym_hist->period; in calc_percent()
891 if (hists->stats.total_period) in calc_percent()
892 data->percent[PERCENT_PERIOD_GLOBAL] = 100.0 * period / hists->stats.total_period; in calc_percent()
901 list_for_each_entry(al, &notes->src->source, node) { in annotation__calc_percent()
905 if (al->offset == -1) in annotation__calc_percent()
908 next = annotation_line__next(al, &notes->src->source); in annotation__calc_percent()
909 end = next ? next->offset : len; in annotation__calc_percent()
914 BUG_ON(i >= al->data_nr); in annotation__calc_percent()
917 evsel__hists(evsel)->stats.nr_samples == 0) in annotation__calc_percent()
920 data = &al->data[i++]; in annotation__calc_percent()
922 calc_percent(notes, evsel, data, al->offset, end); in annotation__calc_percent()
952 if (arch->init) { in evsel__get_arch()
953 err = arch->init(arch, env ? env->cpuid : NULL); in evsel__get_arch()
956 __func__, arch->name); in evsel__get_arch()
966 struct symbol *sym = ms->sym; in symbol__annotate()
982 if (notes->src && !list_empty(&notes->src->source)) in symbol__annotate()
988 if (notes->src == NULL) { in symbol__annotate()
989 notes->src = annotated_source__new(); in symbol__annotate()
990 if (notes->src == NULL) in symbol__annotate()
991 return -1; in symbol__annotate()
1000 evsel__hists(pos)->stats.nr_samples == 0) in symbol__annotate()
1005 notes->src->nr_events = nr ? nr : 1; in symbol__annotate()
1008 notes->src->start = map__objdump_2mem(ms->map, ms->sym->start); in symbol__annotate()
1010 notes->src->start = map__rip_2objdump(ms->map, ms->sym->start); in symbol__annotate()
1018 struct rb_node **p = &root->rb_node; in insert_source_line()
1027 ret = strcmp(iter->path, al->path); in insert_source_line()
1029 for (i = 0; i < al->data_nr; i++) { in insert_source_line()
1030 iter->data[i].percent_sum += annotation_data__percent(&al->data[i], in insert_source_line()
1037 p = &(*p)->rb_left; in insert_source_line()
1039 p = &(*p)->rb_right; in insert_source_line()
1042 for (i = 0; i < al->data_nr; i++) { in insert_source_line()
1043 al->data[i].percent_sum = annotation_data__percent(&al->data[i], in insert_source_line()
1047 rb_link_node(&al->rb_node, parent, p); in insert_source_line()
1048 rb_insert_color(&al->rb_node, root); in insert_source_line()
1055 for (i = 0; i < a->data_nr; i++) { in cmp_source_line()
1056 if (a->data[i].percent_sum == b->data[i].percent_sum) in cmp_source_line()
1058 return a->data[i].percent_sum > b->data[i].percent_sum; in cmp_source_line()
1067 struct rb_node **p = &root->rb_node; in __resort_source_line()
1075 p = &(*p)->rb_left; in __resort_source_line()
1077 p = &(*p)->rb_right; in __resort_source_line()
1080 rb_link_node(&al->rb_node, parent, p); in __resort_source_line()
1081 rb_insert_color(&al->rb_node, root); in __resort_source_line()
1108 printf("----------------------------------------------\n\n"); in print_summary()
1123 for (i = 0; i < al->data_nr; i++) { in print_summary()
1124 percent = al->data[i].percent_sum; in print_summary()
1132 path = al->path; in print_summary()
1149 entry = annotated_source__hist_entry(notes->src, evsel, offset); in symbol__annotate_hits()
1150 if (entry && entry->nr_samples != 0) in symbol__annotate_hits()
1152 sym->start + offset, entry->nr_samples); in symbol__annotate_hits()
1154 printf("%*s: %" PRIu64 "\n", BITS_PER_LONG / 2, "h->nr_samples", h->nr_samples); in symbol__annotate_hits()
1163 if (line->offset != -1) in annotated_source__addr_fmt_width()
1164 return scnprintf(bf, sizeof(bf), "%" PRIx64, start + line->offset); in annotated_source__addr_fmt_width()
1172 struct map *map = ms->map; in symbol__annotate_printf()
1173 struct symbol *sym = ms->sym; in symbol__annotate_printf()
1182 u64 start = map__rip_2objdump(map, sym->start); in symbol__annotate_printf()
1185 bool context = opts->context; in symbol__annotate_printf()
1193 return -ENOMEM; in symbol__annotate_printf()
1195 if (opts->full_path) in symbol__annotate_printf()
1207 graph_dotted_len = printf(" %-*.*s| Source code & Disassembly of %s for %s (%" PRIu64 " samples, " in symbol__annotate_printf()
1210 symbol_conf.show_nr_samples ? "Samples" : "Percent", in symbol__annotate_printf()
1211 d_filename, evsel_name, h->nr_samples, in symbol__annotate_printf()
1212 percent_type_str(opts->percent_type)); in symbol__annotate_printf()
1214 printf("%-*.*s----\n", in symbol__annotate_printf()
1220 addr_fmt_width = annotated_source__addr_fmt_width(&notes->src->source, start); in symbol__annotate_printf()
1222 list_for_each_entry(pos, &notes->src->source, node) { in symbol__annotate_printf()
1231 opts->min_pcnt, printed, opts->max_lines, in symbol__annotate_printf()
1232 queue, addr_fmt_width, opts->percent_type); in symbol__annotate_printf()
1247 case -1: in symbol__annotate_printf()
1256 queue = list_entry(queue->node.next, typeof(*queue), node); in symbol__annotate_printf()
1323 list_for_each_entry(al, &notes->src->source, node) { in symbol__annotate_fprintf2()
1339 int err = -1; in map_symbol__annotation_dump()
1342 if (asprintf(&filename, "%s.annotation", ms->sym->name) < 0) in map_symbol__annotation_dump()
1343 return -1; in map_symbol__annotation_dump()
1355 ms->sym->name, dso__long_name(map__dso(ms->map)), ev_name); in map_symbol__annotation_dump()
1356 symbol__annotate_fprintf2(ms->sym, fp); in map_symbol__annotation_dump()
1370 memset(h, 0, sizeof(*notes->src->histograms) * notes->src->nr_histograms); in symbol__annotate_zero_histogram()
1379 h->nr_samples = 0; in symbol__annotate_decay_histogram()
1380 list_for_each_entry(al, &notes->src->source, node) { in symbol__annotate_decay_histogram()
1383 if (al->offset == -1) in symbol__annotate_decay_histogram()
1386 entry = annotated_source__hist_entry(notes->src, evsel, al->offset); in symbol__annotate_decay_histogram()
1390 entry->nr_samples = entry->nr_samples * 7 / 8; in symbol__annotate_decay_histogram()
1391 h->nr_samples += entry->nr_samples; in symbol__annotate_decay_histogram()
1399 list_for_each_entry_safe(al, n, &as->source, node) { in annotated_source__purge()
1400 list_del_init(&al->node); in annotated_source__purge()
1409 if (dl->al.offset == -1) in disasm_line__fprintf()
1410 return fprintf(fp, "%s\n", dl->al.line); in disasm_line__fprintf()
1412 printed = fprintf(fp, "%#" PRIx64 " %s", dl->al.offset, dl->ins.name); in disasm_line__fprintf()
1414 if (dl->ops.raw[0] != '\0') { in disasm_line__fprintf()
1415 printed += fprintf(fp, "%.*s %s\n", 6 - (int)printed, " ", in disasm_line__fprintf()
1416 dl->ops.raw); in disasm_line__fprintf()
1435 if (!dl || !dl->ins.ops || !ins__is_jump(&dl->ins) || in disasm_line__is_valid_local_jump()
1436 !disasm_line__has_local_offset(dl) || dl->ops.target.offset < 0 || in disasm_line__is_valid_local_jump()
1437 dl->ops.target.offset >= (s64)symbol__size(sym)) in disasm_line__is_valid_local_jump()
1449 if (strstr(sym->name, "@plt")) in annotation__mark_jump_targets()
1452 list_for_each_entry(al, &notes->src->source, node) { in annotation__mark_jump_targets()
1461 target = annotated_source__get_line(notes->src, in annotation__mark_jump_targets()
1462 dl->ops.target.offset); in annotation__mark_jump_targets()
1470 if (++target->jump_sources > notes->src->max_jump_sources) in annotation__mark_jump_targets()
1471 notes->src->max_jump_sources = target->jump_sources; in annotation__mark_jump_targets()
1478 struct annotated_source *src = notes->src; in annotation__set_index()
1480 src->widths.max_line_len = 0; in annotation__set_index()
1481 src->nr_entries = 0; in annotation__set_index()
1482 src->nr_asm_entries = 0; in annotation__set_index()
1484 list_for_each_entry(al, &src->source, node) { in annotation__set_index()
1485 size_t line_len = strlen(al->line); in annotation__set_index()
1487 if (src->widths.max_line_len < line_len) in annotation__set_index()
1488 src->widths.max_line_len = line_len; in annotation__set_index()
1489 al->idx = src->nr_entries++; in annotation__set_index()
1490 if (al->offset != -1) in annotation__set_index()
1491 al->idx_asm = src->nr_asm_entries++; in annotation__set_index()
1493 al->idx_asm = -1; in annotation__set_index()
1511 list_for_each_entry(al, &notes->src->source, node) { in annotation__max_ins_name()
1512 if (al->offset == -1) in annotation__max_ins_name()
1515 len = strlen(disasm_line(al)->ins.name); in annotation__max_ins_name()
1526 notes->src->widths.addr = notes->src->widths.target = in annotation__init_column_widths()
1527 notes->src->widths.min_addr = hex_width(symbol__size(sym)); in annotation__init_column_widths()
1528 notes->src->widths.max_addr = hex_width(sym->end); in annotation__init_column_widths()
1529 notes->src->widths.jumps = width_jumps(notes->src->max_jump_sources); in annotation__init_column_widths()
1530 notes->src->widths.max_ins_name = annotation__max_ins_name(notes); in annotation__init_column_widths()
1536 notes->src->widths.target = notes->src->widths.min_addr; in annotation__update_column_widths()
1538 notes->src->widths.target = BITS_PER_LONG / 4; in annotation__update_column_widths()
1540 notes->src->widths.target = notes->src->widths.max_addr; in annotation__update_column_widths()
1542 notes->src->widths.addr = notes->src->widths.target; in annotation__update_column_widths()
1545 notes->src->widths.addr += notes->src->widths.jumps + 1; in annotation__update_column_widths()
1553 notes->src->start = map__objdump_2mem(ms->map, ms->sym->start); in annotation__toggle_full_addr()
1555 notes->src->start = map__rip_2objdump(ms->map, ms->sym->start); in annotation__toggle_full_addr()
1566 list_for_each_entry(al, &notes->src->source, node) { in annotation__calc_lines()
1571 for (i = 0; i < al->data_nr; i++) { in annotation__calc_lines()
1574 percent = annotation_data__percent(&al->data[i], in annotation__calc_lines()
1584 addr = map__rip_2objdump(ms->map, ms->sym->start); in annotation__calc_lines()
1585 al->path = get_srcline(map__dso(ms->map), addr + al->offset, NULL, in annotation__calc_lines()
1586 false, true, ms->sym->start + al->offset); in annotation__calc_lines()
1595 struct annotation *notes = symbol__annotation(ms->sym); in symbol__calc_lines()
1602 struct dso *dso = map__dso(ms->map); in symbol__tty_annotate2()
1603 struct symbol *sym = ms->sym; in symbol__tty_annotate2()
1615 ui__error("Couldn't annotate %s:\n%s", sym->name, msg); in symbol__tty_annotate2()
1616 return -1; in symbol__tty_annotate2()
1627 buf, percent_type_str(annotate_opts.percent_type), sym->name, dso__long_name(dso)); in symbol__tty_annotate2()
1630 annotated_source__purge(symbol__annotation(sym)->src); in symbol__tty_annotate2()
1637 struct dso *dso = map__dso(ms->map); in symbol__tty_annotate()
1638 struct symbol *sym = ms->sym; in symbol__tty_annotate()
1648 ui__error("Couldn't annotate %s:\n%s", sym->name, msg); in symbol__tty_annotate()
1649 return -1; in symbol__tty_annotate()
1662 annotated_source__purge(symbol__annotation(sym)->src); in symbol__tty_annotate()
1679 for (i = 0; i < al->data_nr; i++) { in annotation_line__max_percent()
1682 percent = annotation_data__percent(&al->data[i], in annotation_line__max_percent()
1697 if (dl->ins.ops && dl->ins.ops->scnprintf) { in disasm_line__write()
1698 if (ins__is_jump(&dl->ins)) { in disasm_line__write()
1701 if (dl->ops.target.outside) in disasm_line__write()
1703 fwd = dl->ops.target.offset > dl->al.offset; in disasm_line__write()
1706 } else if (ins__is_call(&dl->ins)) { in disasm_line__write()
1710 } else if (ins__is_ret(&dl->ins)) { in disasm_line__write()
1721 notes->src->widths.max_ins_name); in disasm_line__write()
1729 if (branch && branch->hit_cycles) in ipc_coverage_string()
1730 ipc = branch->hit_insn / ((double)branch->hit_cycles); in ipc_coverage_string()
1732 if (branch && branch->total_insn) { in ipc_coverage_string()
1733 coverage = branch->cover_insn * 100.0 / in ipc_coverage_string()
1734 ((double)branch->total_insn); in ipc_coverage_string()
1746 if (evsel->evlist->nr_br_cntr <= 0) in annotation_br_cntr_abbr_list()
1747 return -ENOTSUP; in annotation_br_cntr_abbr_list()
1754 evlist__for_each_entry(evsel->evlist, pos) { in annotation_br_cntr_abbr_list()
1755 if (!(pos->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_COUNTERS)) in annotation_br_cntr_abbr_list()
1760 if (strbuf_addf(&sb, " %s = %s\n", pos->name, pos->abbr_name)) in annotation_br_cntr_abbr_list()
1766 if (strbuf_addf(&sb, " '-' No event occurs\n")) in annotation_br_cntr_abbr_list()
1779 return -ENOMEM; in annotation_br_cntr_abbr_list()
1789 struct evsel *pos = evsel ? evlist__first(evsel->evlist) : NULL; in annotation_br_cntr_entry()
1791 int i, j, avg, used; in annotation_br_cntr_entry() local
1797 avg = ceil((double)(br_cntr[i] & ~ANNOTATION__BR_CNTR_SATURATED_FLAG) / in annotation_br_cntr_entry()
1802 * With -v, the exact number of branch counter is displayed. in annotation_br_cntr_entry()
1805 evlist__for_each_entry_from(evsel->evlist, pos) { in annotation_br_cntr_entry()
1806 if ((pos->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_COUNTERS) && in annotation_br_cntr_entry()
1807 (pos->br_cntr_idx == i)) in annotation_br_cntr_entry()
1810 if (strbuf_addstr(&sb, pos->abbr_name)) in annotation_br_cntr_entry()
1814 if (strbuf_addstr(&sb, "=-")) in annotation_br_cntr_entry()
1817 if (strbuf_addf(&sb, "=%d", avg)) in annotation_br_cntr_entry()
1828 if ((i < br_cntr_nr - 1) && strbuf_addch(&sb, ',')) in annotation_br_cntr_entry()
1837 if (strbuf_addch(&sb, '-')) in annotation_br_cntr_entry()
1841 evlist__for_each_entry_from(evsel->evlist, pos) { in annotation_br_cntr_entry()
1842 if ((pos->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_COUNTERS) && in annotation_br_cntr_entry()
1843 (pos->br_cntr_idx == i)) in annotation_br_cntr_entry()
1849 for (j = 0; j < avg; j++, used++) { in annotation_br_cntr_entry()
1855 if (strbuf_addstr(&sb, pos->abbr_name)) in annotation_br_cntr_entry()
1881 return -ENOMEM; in annotation_br_cntr_entry()
1901 if (first_line && (al->offset == -1 || percent_max == 0.0)) { in __annotation_line__write()
1902 if (notes->branch && al->cycles) { in __annotation_line__write()
1903 if (al->cycles->ipc == 0.0 && al->cycles->avg == 0) in __annotation_line__write()
1909 if (al->offset != -1 && percent_max != 0.0) { in __annotation_line__write()
1912 for (i = 0; i < al->data_nr; i++) { in __annotation_line__write()
1915 percent = annotation_data__percent(&al->data[i], percent_type); in __annotation_line__write()
1919 obj__printf(obj, "%11" PRIu64 " ", al->data[i].he.period); in __annotation_line__write()
1922 al->data[i].he.nr_samples); in __annotation_line__write()
1931 obj__printf(obj, "%-*s", pcnt_width, " "); in __annotation_line__write()
1933 obj__printf(obj, "%-*s", pcnt_width, in __annotation_line__write()
1935 symbol_conf.show_nr_samples ? "Samples" : "Percent"); in __annotation_line__write()
1939 if (notes->branch) { in __annotation_line__write()
1940 if (al->cycles && al->cycles->ipc) in __annotation_line__write()
1941 obj__printf(obj, "%*.2f ", ANNOTATION__IPC_WIDTH - 1, al->cycles->ipc); in __annotation_line__write()
1945 obj__printf(obj, "%*s ", ANNOTATION__IPC_WIDTH - 1, "IPC"); in __annotation_line__write()
1948 if (al->cycles && al->cycles->avg) in __annotation_line__write()
1950 ANNOTATION__CYCLES_WIDTH - 1, al->cycles->avg); in __annotation_line__write()
1956 ANNOTATION__CYCLES_WIDTH - 1, in __annotation_line__write()
1959 if (al->cycles) { in __annotation_line__write()
1964 al->cycles->avg, al->cycles->min, in __annotation_line__write()
1965 al->cycles->max); in __annotation_line__write()
1968 ANNOTATION__MINMAX_CYCLES_WIDTH - 1, in __annotation_line__write()
1976 ANNOTATION__MINMAX_CYCLES_WIDTH - 1, in __annotation_line__write()
1988 if (!annotation_br_cntr_entry(&buf, al->br_cntr_nr, al->br_cntr, in __annotation_line__write()
1989 al->num_aggr, al->evsel)) { in __annotation_line__write()
1996 if (show_title && !*al->line) { in __annotation_line__write()
2004 if (!*al->line) in __annotation_line__write()
2005 obj__printf(obj, "%-*s", width - pcnt_width - cycles_width, " "); in __annotation_line__write()
2006 else if (al->offset == -1) { in __annotation_line__write()
2007 if (al->line_nr && annotate_opts.show_linenr) in __annotation_line__write()
2008 printed = scnprintf(bf, sizeof(bf), "%-*d ", in __annotation_line__write()
2009 notes->src->widths.addr + 1, al->line_nr); in __annotation_line__write()
2011 printed = scnprintf(bf, sizeof(bf), "%-*s ", in __annotation_line__write()
2012 notes->src->widths.addr, " "); in __annotation_line__write()
2014 obj__printf(obj, "%-*s", width - printed - pcnt_width - cycles_width + 1, al->line); in __annotation_line__write()
2016 u64 addr = al->offset; in __annotation_line__write()
2017 int color = -1; in __annotation_line__write()
2020 addr += notes->src->start; in __annotation_line__write()
2025 if (al->jump_sources && in __annotation_line__write()
2030 notes->src->widths.jumps, in __annotation_line__write()
2031 al->jump_sources); in __annotation_line__write()
2032 prev = obj__set_jumps_percent_color(obj, al->jump_sources, in __annotation_line__write()
2039 notes->src->widths.target, addr); in __annotation_line__write()
2040 } else if (ins__is_call(&disasm_line(al)->ins) && in __annotation_line__write()
2046 printed = scnprintf(bf, sizeof(bf), "%-*s ", in __annotation_line__write()
2047 notes->src->widths.addr, " "); in __annotation_line__write()
2059 obj__printf(obj, "%-*s", width - pcnt_width - cycles_width - 3 - printed, bf); in __annotation_line__write()
2067 __annotation_line__write(al, notes, wops->first_line, wops->current_entry, in annotation_line__write()
2068 wops->change_color, wops->width, wops->obj, in annotation_line__write()
2070 wops->set_color, wops->set_percent_color, in annotation_line__write()
2071 wops->set_jumps_percent_color, wops->printf, in annotation_line__write()
2072 wops->write_graph); in annotation_line__write()
2078 struct symbol *sym = ms->sym; in symbol__annotate2()
2098 sym->annotate2 = 1; in symbol__annotate2()
2114 for (u8 i = 0; i < ARRAY_SIZE(options->disassemblers); i++) { in annotation_options__add_disassembler()
2115 if (options->disassemblers[i] == dis) { in annotation_options__add_disassembler()
2119 if (options->disassemblers[i] == PERF_DISASM_UNKNOWN) { in annotation_options__add_disassembler()
2121 options->disassemblers[i] = dis; in annotation_options__add_disassembler()
2133 int len = comma ? comma - str : (int)strlen(str); in annotation_options__add_disassemblers_str()
2147 return -1; in annotation_options__add_disassemblers_str()
2162 perf_config_u8(&opt->offset_level, "offset_level", value); in annotation__config()
2164 if (opt->offset_level > ANNOTATION__MAX_OFFSET_LEVEL) in annotation__config()
2165 opt->offset_level = ANNOTATION__MAX_OFFSET_LEVEL; in annotation__config()
2166 else if (opt->offset_level < ANNOTATION__MIN_OFFSET_LEVEL) in annotation__config()
2167 opt->offset_level = ANNOTATION__MIN_OFFSET_LEVEL; in annotation__config()
2174 opt->hide_src_code = perf_config_bool("hide_src_code", value); in annotation__config()
2176 opt->jump_arrows = perf_config_bool("jump_arrows", value); in annotation__config()
2178 opt->show_linenr = perf_config_bool("show_linenr", value); in annotation__config()
2180 opt->show_nr_jumps = perf_config_bool("show_nr_jumps", value); in annotation__config()
2188 opt->use_offset = perf_config_bool("use_offset", value); in annotation__config()
2190 opt->disassembler_style = strdup(value); in annotation__config()
2191 if (!opt->disassembler_style) { in annotation__config()
2193 return -1; in annotation__config()
2196 opt->objdump_path = strdup(value); in annotation__config()
2197 if (!opt->objdump_path) { in annotation__config()
2199 return -1; in annotation__config()
2205 return -1; in annotation__config()
2225 opt->use_offset = true; in annotation_options__init()
2226 opt->jump_arrows = true; in annotation_options__init()
2227 opt->annotate_src = true; in annotation_options__init()
2228 opt->offset_level = ANNOTATION__OFFSET_JUMP_TARGETS; in annotation_options__init()
2229 opt->percent_type = PERCENT_PERIOD_LOCAL; in annotation_options__init()
2240 if (options->disassemblers[0] != PERF_DISASM_UNKNOWN) { in annotation_options__default_init_disassemblers()
2261 unsigned int type = (unsigned int) -1; in parse_percent_type()
2285 int err = -1; in annotate_parse_percent_type()
2289 return -ENOMEM; in annotate_parse_percent_type()
2291 str2 = strchr(str1, '-'); in annotate_parse_percent_type()
2298 if (type == (unsigned int) -1) in annotate_parse_percent_type()
2300 if (type != (unsigned int) -1) { in annotate_parse_percent_type()
2314 if (args->prefix_strip && !args->prefix) { in annotate_check_args()
2315 pr_err("--prefix-strip requires --prefix\n"); in annotate_check_args()
2316 return -1; in annotate_check_args()
2333 if (arch->objdump.register_char == 0) in extract_reg_offset()
2334 return -1; in extract_reg_offset()
2343 if (*str == arch->objdump.register_char) { in extract_reg_offset()
2347 op_loc->segment = INSN_SEG_X86_GS; in extract_reg_offset()
2351 *str != arch->objdump.memory_ref_char) in extract_reg_offset()
2355 op_loc->offset = strtol(str, &p, 0); in extract_reg_offset()
2357 p = strchr(p, arch->objdump.register_char); in extract_reg_offset()
2359 return -1; in extract_reg_offset()
2363 return -1; in extract_reg_offset()
2365 op_loc->reg1 = get_dwarf_regnum(regname, arch->e_machine, arch->e_flags); in extract_reg_offset()
2369 if (op_loc->multi_regs) { in extract_reg_offset()
2370 p = strchr(p + 1, arch->objdump.register_char); in extract_reg_offset()
2372 return -1; in extract_reg_offset()
2376 return -1; in extract_reg_offset()
2378 op_loc->reg2 = get_dwarf_regnum(regname, arch->e_machine, arch->e_flags); in extract_reg_offset()
2385 * annotate_get_insn_location - Get location of instruction
2401 * mov 0x18, %r8 # src_reg1 = -1, src_mem = 0
2415 if (ins__is_lock(&dl->ins)) in annotate_get_insn_location()
2416 ops = dl->ops.locked.ops; in annotate_get_insn_location()
2418 ops = &dl->ops; in annotate_get_insn_location()
2421 return -1; in annotate_get_insn_location()
2426 const char *insn_str = ops->source.raw; in annotate_get_insn_location()
2427 bool multi_regs = ops->source.multi_regs; in annotate_get_insn_location()
2428 bool mem_ref = ops->source.mem_ref; in annotate_get_insn_location()
2431 insn_str = ops->target.raw; in annotate_get_insn_location()
2432 multi_regs = ops->target.multi_regs; in annotate_get_insn_location()
2433 mem_ref = ops->target.mem_ref; in annotate_get_insn_location()
2437 op_loc->reg1 = -1; in annotate_get_insn_location()
2438 op_loc->reg2 = -1; in annotate_get_insn_location()
2451 op_loc->mem_ref = mem_ref; in annotate_get_insn_location()
2452 op_loc->multi_regs = multi_regs; in annotate_get_insn_location()
2453 get_powerpc_regs(dl->raw.raw_insn, !i, op_loc); in annotate_get_insn_location()
2454 } else if (strchr(insn_str, arch->objdump.memory_ref_char)) { in annotate_get_insn_location()
2455 op_loc->mem_ref = true; in annotate_get_insn_location()
2456 op_loc->multi_regs = multi_regs; in annotate_get_insn_location()
2464 op_loc->segment = INSN_SEG_X86_GS; in annotate_get_insn_location()
2465 op_loc->offset = strtol(insn_str + 4, in annotate_get_insn_location()
2468 op_loc->imm = true; in annotate_get_insn_location()
2475 return -1; in annotate_get_insn_location()
2477 if (*s == arch->objdump.register_char) in annotate_get_insn_location()
2478 op_loc->reg1 = get_dwarf_regnum(s, arch->e_machine, arch->e_flags); in annotate_get_insn_location()
2479 else if (*s == arch->objdump.imm_char) { in annotate_get_insn_location()
2480 op_loc->offset = strtol(s + 1, &p, 0); in annotate_get_insn_location()
2482 op_loc->imm = true; in annotate_get_insn_location()
2499 list_for_each_entry(dl, &notes->src->source, al.node) { in find_disasm_line()
2500 if (dl->al.offset == -1) in find_disasm_line()
2503 if (sym->start + dl->al.offset == ip) { in find_disasm_line()
2505 * llvm-objdump places "lock" in a separate line and in find_disasm_line()
2508 if (ins__is_lock(&dl->ins) && in find_disasm_line()
2509 *dl->ops.raw == '\0' && allow_update) { in find_disasm_line()
2525 if (!strcmp(istat->name, name)) in annotate_data_stat()
2533 istat->name = strdup(name); in annotate_data_stat()
2534 if ((istat->name == NULL) || (!strlen(istat->name))) { in annotate_data_stat()
2539 list_add_tail(&istat->list, head); in annotate_data_stat()
2546 if (!strncmp(dl->ins.name, "push", 4) || in is_stack_operation()
2547 !strncmp(dl->ins.name, "pop", 3) || in is_stack_operation()
2548 !strncmp(dl->ins.name, "call", 4) || in is_stack_operation()
2549 !strncmp(dl->ins.name, "ret", 3)) in is_stack_operation()
2560 if (loc->segment == INSN_SEG_X86_GS && loc->imm && in is_stack_canary()
2561 loc->offset == 40) in is_stack_canary()
2571 struct list_head *sources = &notes->src->source; in annotation__prev_asm_line()
2578 while (prev->al.offset == -1 && in annotation__prev_asm_line()
2582 if (prev->al.offset == -1) in annotation__prev_asm_line()
2591 struct list_head *sources = &notes->src->source; in annotation__next_asm_line()
2598 while (next->al.offset == -1 && in annotation__next_asm_line()
2602 if (next->al.offset == -1) in annotation__next_asm_line()
2615 notes = symbol__annotation(ms->sym); in annotate_calc_pcrel()
2617 * PC-relative addressing starts from the next instruction address in annotate_calc_pcrel()
2625 addr = ms->sym->end + offset; in annotate_calc_pcrel()
2627 addr = ip + (next->al.offset - dl->al.offset) + offset; in annotate_calc_pcrel()
2629 return map__rip_2objdump(ms->map, addr); in annotate_calc_pcrel()
2647 * hist_entry__get_data_type - find data type for given hist entry
2650 * This function first annotates the instruction at @he->ip and extracts
2657 struct map_symbol *ms = &he->ms; in hist_entry__get_data_type()
2658 struct evsel *evsel = hists_to_evsel(he->hists); in hist_entry__get_data_type()
2665 u64 ip = he->ip; in hist_entry__get_data_type()
2670 if (ms->map == NULL || ms->sym == NULL) { in hist_entry__get_data_type()
2688 if (map__dso(ms->map) != di_cache.dso) { in hist_entry__get_data_type()
2690 di_cache.dso = dso__get(map__dso(ms->map)); in hist_entry__get_data_type()
2711 dl = find_disasm_line(ms->sym, ip, /*allow_update=*/true); in hist_entry__get_data_type()
2718 istat = annotate_data_stat(&ann_insn_stat, dl->ins.name); in hist_entry__get_data_type()
2726 istat->bad++; in hist_entry__get_data_type()
2731 istat->good++; in hist_entry__get_data_type()
2732 he->mem_type_off = 0; in hist_entry__get_data_type()
2739 .thread = he->thread, in hist_entry__get_data_type()
2742 .ip = ms->sym->start + dl->al.offset, in hist_entry__get_data_type()
2743 .cpumode = he->cpumode, in hist_entry__get_data_type()
2748 if (!op_loc->mem_ref && op_loc->segment == INSN_SEG_NONE) in hist_entry__get_data_type()
2752 ip = ms->sym->start + dl->al.offset; in hist_entry__get_data_type()
2754 /* PC-relative addressing */ in hist_entry__get_data_type()
2755 if (op_loc->reg1 == DWARF_REG_PC) { in hist_entry__get_data_type()
2757 op_loc->offset, dl); in hist_entry__get_data_type()
2760 /* This CPU access in kernel - pretend PC-relative addressing */ in hist_entry__get_data_type()
2761 if (dso__kernel(map__dso(ms->map)) && arch__is(arch, "x86") && in hist_entry__get_data_type()
2762 op_loc->segment == INSN_SEG_X86_GS && op_loc->imm) { in hist_entry__get_data_type()
2763 dloc.var_addr = op_loc->offset; in hist_entry__get_data_type()
2764 op_loc->reg1 = DWARF_REG_PC; in hist_entry__get_data_type()
2770 istat->good++; in hist_entry__get_data_type()
2771 he->mem_type_off = 0; in hist_entry__get_data_type()
2776 istat->good++; in hist_entry__get_data_type()
2778 istat->bad++; in hist_entry__get_data_type()
2783 he->stat.nr_events, in hist_entry__get_data_type()
2784 he->stat.period); in hist_entry__get_data_type()
2786 he->mem_type_off = dloc.type_offset; in hist_entry__get_data_type()
2794 if (dl->al.offset > 0) { in hist_entry__get_data_type()
2798 notes = symbol__annotation(ms->sym); in hist_entry__get_data_type()
2801 if (prev_dl && ins__is_fused(arch, prev_dl->ins.name, dl->ins.name)) { in hist_entry__get_data_type()
2808 istat->bad++; in hist_entry__get_data_type()
2835 s64 begin_offset = link->bb->begin->al.offset; in basic_block_has_offset()
2836 s64 end_offset = link->bb->end->al.offset; in basic_block_has_offset()
2847 s64 offset = dl->al.offset; in is_new_basic_block()
2849 if (basic_block_has_offset(&bb_data->visited, offset)) in is_new_basic_block()
2851 if (basic_block_has_offset(&bb_data->queue, offset)) in is_new_basic_block()
2865 return -1; in add_basic_block()
2872 return -1; in add_basic_block()
2874 bb->begin = dl; in add_basic_block()
2875 bb->end = dl; in add_basic_block()
2876 INIT_LIST_HEAD(&bb->list); in add_basic_block()
2881 return -1; in add_basic_block()
2884 link->bb = bb; in add_basic_block()
2885 link->parent = parent; in add_basic_block()
2886 list_add_tail(&link->node, &bb_data->queue); in add_basic_block()
2899 dl = link->bb->begin; in process_basic_block()
2901 if (basic_block_has_offset(&bb_data->visited, dl->al.offset)) in process_basic_block()
2904 last_dl = list_last_entry(&notes->src->source, in process_basic_block()
2906 if (last_dl->al.offset == -1) in process_basic_block()
2912 list_for_each_entry_from(dl, &notes->src->source, al.node) { in process_basic_block()
2914 if (dl->al.offset == -1) in process_basic_block()
2917 if (sym->start + dl->al.offset == target) { in process_basic_block()
2925 if (ins__is_ret(&dl->ins)) in process_basic_block()
2928 if (!ins__is_jump(&dl->ins)) in process_basic_block()
2931 if (dl->ops.target.outside) in process_basic_block()
2934 next_dl = find_disasm_line(sym, sym->start + dl->ops.target.offset, in process_basic_block()
2944 if (!strstr(dl->ins.name, "jmp")) { in process_basic_block()
2952 link->bb->end = dl; in process_basic_block()
2964 struct basic_block_link *parent = link->parent; in link_found_basic_blocks()
2966 list_move(&link->bb->list, head); in link_found_basic_blocks()
2967 list_del(&link->node); in link_found_basic_blocks()
2978 list_for_each_entry_safe(link, tmp, &bb_data->queue, node) { in delete_basic_blocks()
2979 list_del(&link->node); in delete_basic_blocks()
2980 zfree(&link->bb); in delete_basic_blocks()
2984 list_for_each_entry_safe(link, tmp, &bb_data->visited, node) { in delete_basic_blocks()
2985 list_del(&link->node); in delete_basic_blocks()
2986 zfree(&link->bb); in delete_basic_blocks()
2992 * annotate_get_basic_blocks - Get basic blocks for given address range
3012 int ret = -1; in annotate_get_basic_blocks()
3016 return -1; in annotate_get_basic_blocks()
3019 return -1; in annotate_get_basic_blocks()
3030 list_move(&link->node, &bb_data.visited); in annotate_get_basic_blocks()