Lines Matching full:notes
6 * copyright notes.
151 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_zero_histograms() local
153 annotation__lock(notes); in symbol__annotate_zero_histograms()
154 if (notes->src != NULL) { in symbol__annotate_zero_histograms()
155 memset(notes->src->histograms, 0, in symbol__annotate_zero_histograms()
156 notes->src->nr_histograms * sizeof(*notes->src->histograms)); in symbol__annotate_zero_histograms()
157 hashmap__clear(notes->src->samples); in symbol__annotate_zero_histograms()
159 if (notes->branch && notes->branch->cycles_hist) { in symbol__annotate_zero_histograms()
160 memset(notes->branch->cycles_hist, 0, in symbol__annotate_zero_histograms()
163 annotation__unlock(notes); in symbol__annotate_zero_histograms()
265 struct annotated_branch *annotation__get_branch(struct annotation *notes) in annotation__get_branch() argument
267 if (notes == NULL) in annotation__get_branch()
270 if (notes->branch == NULL) in annotation__get_branch()
271 notes->branch = zalloc(sizeof(*notes->branch)); in annotation__get_branch()
273 return notes->branch; in annotation__get_branch()
279 struct annotation *notes = symbol__annotation(sym); in symbol__find_branch_hist() local
283 branch = annotation__get_branch(notes); in symbol__find_branch_hist()
304 struct annotation *notes = symbol__annotation(sym); in symbol__hists() local
306 if (notes->src == NULL) { in symbol__hists()
307 notes->src = annotated_source__new(); in symbol__hists()
308 if (notes->src == NULL) in symbol__hists()
313 if (notes->src->histograms == NULL) { in symbol__hists()
315 annotated_source__alloc_histograms(notes->src, nr_hists); in symbol__hists()
318 return notes->src; in symbol__hists()
443 static unsigned annotation__count_insn(struct annotation *notes, u64 start, u64 end) in annotation__count_insn() argument
448 al = annotated_source__get_line(notes->src, start); in annotation__count_insn()
452 list_for_each_entry_from(al, ¬es->src->source, node) { in annotation__count_insn()
471 static void annotation__count_and_fill(struct annotation *notes, u64 start, u64 end, struct cyc_his… in annotation__count_and_fill() argument
476 n_insn = annotation__count_insn(notes, start, end); in annotation__count_and_fill()
486 al = annotated_source__get_line(notes->src, start); in annotation__count_and_fill()
490 list_for_each_entry_from(al, ¬es->src->source, node) { in annotation__count_and_fill()
501 branch = annotation__get_branch(notes); in annotation__count_and_fill()
510 static int annotation__compute_ipc(struct annotation *notes, size_t size, in annotation__compute_ipc() argument
517 if (!notes->branch || !notes->branch->cycles_hist) in annotation__compute_ipc()
520 notes->branch->total_insn = annotation__count_insn(notes, 0, size - 1); in annotation__compute_ipc()
521 notes->branch->hit_cycles = 0; in annotation__compute_ipc()
522 notes->branch->hit_insn = 0; in annotation__compute_ipc()
523 notes->branch->cover_insn = 0; in annotation__compute_ipc()
525 annotation__lock(notes); in annotation__compute_ipc()
529 ch = ¬es->branch->cycles_hist[offset]; in annotation__compute_ipc()
533 al = annotated_source__get_line(notes->src, offset); in annotation__compute_ipc()
542 annotation__count_and_fill(notes, ch->start, offset, ch); in annotation__compute_ipc()
548 if (al && notes->branch->br_cntr) { in annotation__compute_ipc()
559 memcpy(al->br_cntr, ¬es->branch->br_cntr[offset * br_cntr_nr], in annotation__compute_ipc()
567 struct cyc_hist *ch = ¬es->branch->cycles_hist[offset]; in annotation__compute_ipc()
572 al = annotated_source__get_line(notes->src, offset); in annotation__compute_ipc()
581 annotation__unlock(notes); in annotation__compute_ipc()
598 void annotation__exit(struct annotation *notes) in annotation__exit() argument
600 annotated_source__delete(notes->src); in annotation__exit()
601 annotated_branch__delete(notes->branch); in annotation__exit()
612 static size_t annotation__hash(const struct annotation *notes) in annotation__hash() argument
614 return (size_t)notes; in annotation__hash()
617 static struct mutex *annotation__get_mutex(const struct annotation *notes) in annotation__get_mutex() argument
625 return sharded_mutex__get_mutex(sharded_mutex, annotation__hash(notes)); in annotation__get_mutex()
628 void annotation__lock(struct annotation *notes) in annotation__lock() argument
631 struct mutex *mutex = annotation__get_mutex(notes); in annotation__lock()
637 void annotation__unlock(struct annotation *notes) in annotation__unlock() argument
640 struct mutex *mutex = annotation__get_mutex(notes); in annotation__unlock()
646 bool annotation__trylock(struct annotation *notes) in annotation__trylock() argument
648 struct mutex *mutex = annotation__get_mutex(notes); in annotation__trylock()
789 struct annotation *notes = symbol__annotation(sym); in annotation_line__print() local
824 list_for_each_entry_from(queue, ¬es->src->source, node) { in annotation_line__print()
853 disasm_line__print(dl, notes->src->start, apd->addr_fmt_width); in annotation_line__print()
895 int width = annotation__pcnt_width(notes); in annotation_line__print()
910 static void calc_percent(struct annotation *notes, in calc_percent() argument
916 struct sym_hist *sym_hist = annotation__histogram(notes, evsel); in calc_percent()
923 entry = annotated_source__hist_entry(notes->src, evsel, offset); in calc_percent()
947 static void annotation__calc_percent(struct annotation *notes, in annotation__calc_percent() argument
953 list_for_each_entry(al, ¬es->src->source, node) { in annotation__calc_percent()
960 next = annotation_line__next(al, ¬es->src->source); in annotation__calc_percent()
974 calc_percent(notes, evsel, data, al->offset, end); in annotation__calc_percent()
981 struct annotation *notes = symbol__annotation(sym); in symbol__calc_percent() local
983 annotation__calc_percent(notes, evsel, symbol__size(sym)); in symbol__calc_percent()
1015 struct annotation *notes = symbol__annotation(sym); in symbol__annotate() local
1029 if (notes->src && !list_empty(¬es->src->source)) in symbol__annotate()
1035 if (notes->src == NULL) { in symbol__annotate()
1036 notes->src = annotated_source__new(); in symbol__annotate()
1037 if (notes->src == NULL) in symbol__annotate()
1052 notes->src->nr_events = nr ? nr : 1; in symbol__annotate()
1055 notes->src->start = map__objdump_2mem(ms->map, ms->sym->start); in symbol__annotate()
1057 notes->src->start = map__rip_2objdump(ms->map, ms->sym->start); in symbol__annotate()
1189 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_hits() local
1190 struct sym_hist *h = annotation__histogram(notes, evsel); in symbol__annotate_hits()
1196 entry = annotated_source__hist_entry(notes->src, evsel, offset); in symbol__annotate_hits()
1226 struct annotation *notes = symbol__annotation(sym); in hist_entry__annotate_printf() local
1227 struct sym_hist *h = annotation__histogram(notes, evsel); in hist_entry__annotate_printf()
1237 int width = annotation__pcnt_width(notes); in hist_entry__annotate_printf()
1268 apd.addr_fmt_width = annotated_source__addr_fmt_width(¬es->src->source, in hist_entry__annotate_printf()
1269 notes->src->start); in hist_entry__annotate_printf()
1273 list_for_each_entry(pos, ¬es->src->source, node) { in hist_entry__annotate_printf()
1362 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_fprintf2() local
1379 list_for_each_entry(al, ¬es->src->source, node) { in symbol__annotate_fprintf2()
1382 annotation_line__write(al, notes, &wops, apd); in symbol__annotate_fprintf2()
1431 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_zero_histogram() local
1432 struct sym_hist *h = annotation__histogram(notes, evsel); in symbol__annotate_zero_histogram()
1434 memset(h, 0, sizeof(*notes->src->histograms) * notes->src->nr_histograms); in symbol__annotate_zero_histogram()
1439 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_decay_histogram() local
1440 struct sym_hist *h = annotation__histogram(notes, evsel); in symbol__annotate_decay_histogram()
1444 list_for_each_entry(al, ¬es->src->source, node) { in symbol__annotate_decay_histogram()
1450 entry = annotated_source__hist_entry(notes->src, evsel, al->offset); in symbol__annotate_decay_histogram()
1509 annotation__mark_jump_targets(struct annotation *notes, struct symbol *sym) in annotation__mark_jump_targets() argument
1517 list_for_each_entry(al, ¬es->src->source, node) { in annotation__mark_jump_targets()
1526 target = annotated_source__get_line(notes->src, in annotation__mark_jump_targets()
1535 if (++target->jump_sources > notes->src->max_jump_sources) in annotation__mark_jump_targets()
1536 notes->src->max_jump_sources = target->jump_sources; in annotation__mark_jump_targets()
1540 static void annotation__set_index(struct annotation *notes) in annotation__set_index() argument
1543 struct annotated_source *src = notes->src; in annotation__set_index()
1571 static int annotation__max_ins_name(struct annotation *notes) in annotation__max_ins_name() argument
1576 list_for_each_entry(al, ¬es->src->source, node) { in annotation__max_ins_name()
1589 annotation__init_column_widths(struct annotation *notes, struct symbol *sym) in annotation__init_column_widths() argument
1591 notes->src->widths.addr = notes->src->widths.target = in annotation__init_column_widths()
1592 notes->src->widths.min_addr = hex_width(symbol__size(sym)); in annotation__init_column_widths()
1593 notes->src->widths.max_addr = hex_width(sym->end); in annotation__init_column_widths()
1594 notes->src->widths.jumps = width_jumps(notes->src->max_jump_sources); in annotation__init_column_widths()
1595 notes->src->widths.max_ins_name = annotation__max_ins_name(notes); in annotation__init_column_widths()
1598 void annotation__update_column_widths(struct annotation *notes) in annotation__update_column_widths() argument
1601 notes->src->widths.target = notes->src->widths.min_addr; in annotation__update_column_widths()
1603 notes->src->widths.target = BITS_PER_LONG / 4; in annotation__update_column_widths()
1605 notes->src->widths.target = notes->src->widths.max_addr; in annotation__update_column_widths()
1607 notes->src->widths.addr = notes->src->widths.target; in annotation__update_column_widths()
1610 notes->src->widths.addr += notes->src->widths.jumps + 1; in annotation__update_column_widths()
1613 void annotation__toggle_full_addr(struct annotation *notes, struct map_symbol *ms) in annotation__toggle_full_addr() argument
1618 notes->src->start = map__objdump_2mem(ms->map, ms->sym->start); in annotation__toggle_full_addr()
1620 notes->src->start = map__rip_2objdump(ms->map, ms->sym->start); in annotation__toggle_full_addr()
1622 annotation__update_column_widths(notes); in annotation__toggle_full_addr()
1625 static void annotation__calc_lines(struct annotation *notes, struct map_symbol *ms, in annotation__calc_lines() argument
1631 list_for_each_entry(al, ¬es->src->source, node) { in annotation__calc_lines()
1660 struct annotation *notes = symbol__annotation(ms->sym); in symbol__calc_lines() local
1662 annotation__calc_lines(notes, ms, root); in symbol__calc_lines()
1763 static int disasm_line__write(struct disasm_line *dl, struct annotation *notes, in disasm_line__write() argument
1792 notes->src->widths.max_ins_name) + 2; in disasm_line__write()
1795 static void ipc_coverage_string(char *bf, int size, struct annotation *notes) in ipc_coverage_string() argument
1798 struct annotated_branch *branch = annotation__get_branch(notes); in ipc_coverage_string()
2010 void annotation_line__write(struct annotation_line *al, struct annotation *notes, in annotation_line__write() argument
2018 int pcnt_width = annotation__pcnt_width(notes); in annotation_line__write()
2019 int cycles_width = annotation__cycles_width(notes); in annotation_line__write()
2031 if (notes->branch && al->cycles) { in annotation_line__write()
2070 if (notes->branch) { in annotation_line__write()
2128 ipc_coverage_string(bf, sizeof(bf), notes); in annotation_line__write()
2142 notes->src->widths.addr + 1, al->line_nr); in annotation_line__write()
2145 notes->src->widths.addr, " "); in annotation_line__write()
2154 addr += notes->src->start; in annotation_line__write()
2164 notes->src->widths.jumps, in annotation_line__write()
2173 notes->src->widths.target, addr); in annotation_line__write()
2181 notes->src->widths.addr, " "); in annotation_line__write()
2193 printed = disasm_line__write(disasm_line(al), notes, obj, bf, sizeof(bf), in annotation_line__write()
2209 struct annotation *notes = symbol__annotation(sym); in symbol__annotate2() local
2219 annotation__set_index(notes); in symbol__annotate2()
2220 annotation__mark_jump_targets(notes, sym); in symbol__annotate2()
2222 err = annotation__compute_ipc(notes, size, evsel); in symbol__annotate2()
2226 annotation__init_column_widths(notes, sym); in symbol__annotate2()
2227 annotation__update_column_widths(notes); in symbol__annotate2()
2629 struct annotation *notes; in find_disasm_line() local
2631 notes = symbol__annotation(sym); in find_disasm_line()
2633 list_for_each_entry(dl, ¬es->src->source, al.node) { in find_disasm_line()
2717 annotation__prev_asm_line(struct annotation *notes, struct disasm_line *curr) in annotation__prev_asm_line() argument
2719 struct list_head *sources = ¬es->src->source; in annotation__prev_asm_line()
2737 annotation__next_asm_line(struct annotation *notes, struct disasm_line *curr) in annotation__next_asm_line() argument
2739 struct list_head *sources = ¬es->src->source; in annotation__next_asm_line()
2759 struct annotation *notes; in annotate_calc_pcrel() local
2763 notes = symbol__annotation(ms->sym); in annotate_calc_pcrel()
2771 next = annotation__next_asm_line(notes, dl); in annotate_calc_pcrel()
2965 struct annotation *notes; in hist_entry__get_data_type() local
2968 notes = symbol__annotation(ms->sym); in hist_entry__get_data_type()
2969 prev_dl = annotation__prev_asm_line(notes, dl); in hist_entry__get_data_type()
3068 struct annotation *notes = symbol__annotation(sym); in process_basic_block() local
3076 last_dl = list_last_entry(¬es->src->source, in process_basic_block()
3079 last_dl = annotation__prev_asm_line(notes, last_dl); in process_basic_block()
3084 list_for_each_entry_from(dl, ¬es->src->source, al.node) { in process_basic_block()
3117 next_dl = annotation__next_asm_line(notes, dl); in process_basic_block()