Lines Matching refs:src
103 struct annotated_source *src = zalloc(sizeof(*src)); in annotated_source__new() local
105 if (src != NULL) in annotated_source__new()
106 INIT_LIST_HEAD(&src->source); in annotated_source__new()
108 return src; in annotated_source__new()
111 static __maybe_unused void annotated_source__delete(struct annotated_source *src) in annotated_source__delete() argument
116 if (src == NULL) in annotated_source__delete()
119 if (src->samples) { in annotated_source__delete()
120 hashmap__for_each_entry(src->samples, cur, bkt) in annotated_source__delete()
122 hashmap__free(src->samples); in annotated_source__delete()
124 zfree(&src->histograms); in annotated_source__delete()
125 free(src); in annotated_source__delete()
128 static int annotated_source__alloc_histograms(struct annotated_source *src, in annotated_source__alloc_histograms() argument
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()
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()
212 struct annotated_source *src, int evidx, u64 addr, in __symbol__inc_addr_samples() argument
231 h = annotated_source__histogram(src, evidx); in __symbol__inc_addr_samples()
239 if (!hashmap__find(src->samples, hash_key, &entry)) { in __symbol__inc_addr_samples()
244 if (hashmap__add(src->samples, hash_key, entry) < 0) in __symbol__inc_addr_samples()
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()
321 struct annotated_source *src; in symbol__inc_addr_samples() local
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()
426 struct annotation_line *annotated_source__get_line(struct annotated_source *src, in annotated_source__get_line() argument
431 list_for_each_entry(al, &src->source, node) { 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()
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()
528 al = annotated_source__get_line(notes->src, offset); in annotation__compute_ipc()
567 al = annotated_source__get_line(notes->src, offset); in annotation__compute_ipc()
595 annotated_source__delete(notes->src); in annotation__exit()
796 list_for_each_entry_from(queue, ¬es->src->source, node) { in annotation_line__print()
872 entry = annotated_source__hist_entry(notes->src, evidx, offset); in calc_percent()
902 list_for_each_entry(al, ¬es->src->source, node) { in annotation__calc_percent()
909 next = annotation_line__next(al, ¬es->src->source); in annotation__calc_percent()
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()
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()
1151 entry = annotated_source__hist_entry(notes->src, evidx, offset); in symbol__annotate_hits()
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()
1325 list_for_each_entry(al, ¬es->src->source, node) { in symbol__annotate_fprintf2()
1372 memset(h, 0, sizeof(*notes->src->histograms) * notes->src->nr_histograms); in symbol__annotate_zero_histogram()
1382 list_for_each_entry(al, ¬es->src->source, node) { in symbol__annotate_decay_histogram()
1388 entry = annotated_source__hist_entry(notes->src, evidx, al->offset); in symbol__annotate_decay_histogram()
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()
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() local
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()
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()
1493 al->idx_asm = src->nr_asm_entries++; in annotation__set_index()
1513 list_for_each_entry(al, ¬es->src->source, node) { 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()
1632 annotated_source__purge(symbol__annotation(sym)->src); in symbol__tty_annotate2()
1664 annotated_source__purge(symbol__annotation(sym)->src); in symbol__tty_annotate()
1723 notes->src->widths.max_ins_name); in disasm_line__write()
2011 notes->src->widths.addr + 1, al->line_nr); in __annotation_line__write()
2014 notes->src->widths.addr, " "); in __annotation_line__write()
2022 addr += notes->src->start; in __annotation_line__write()
2032 notes->src->widths.jumps, in __annotation_line__write()
2041 notes->src->widths.target, addr); in __annotation_line__write()
2049 notes->src->widths.addr, " "); in __annotation_line__write()
2429 list_for_each_entry(dl, ¬es->src->source, al.node) { in find_disasm_line()
2501 struct list_head *sources = ¬es->src->source; in annotation__prev_asm_line()
2521 struct list_head *sources = ¬es->src->source; in annotation__next_asm_line()
2834 last_dl = list_last_entry(¬es->src->source, in process_basic_block()
2842 list_for_each_entry_from(dl, ¬es->src->source, al.node) { in process_basic_block()
2933 int annotate_get_basic_blocks(struct symbol *sym, s64 src, s64 dst, in annotate_get_basic_blocks() argument
2944 dl = find_disasm_line(sym, src, /*allow_update=*/false); in annotate_get_basic_blocks()