Lines Matching refs:notes
148 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_zero_histograms() local
150 annotation__lock(notes); in symbol__annotate_zero_histograms()
151 if (notes->src != NULL) { in symbol__annotate_zero_histograms()
152 memset(notes->src->histograms, 0, in symbol__annotate_zero_histograms()
153 notes->src->nr_histograms * sizeof(*notes->src->histograms)); in symbol__annotate_zero_histograms()
154 hashmap__clear(notes->src->samples); in symbol__annotate_zero_histograms()
156 if (notes->branch && notes->branch->cycles_hist) { in symbol__annotate_zero_histograms()
157 memset(notes->branch->cycles_hist, 0, in symbol__annotate_zero_histograms()
160 annotation__unlock(notes); in symbol__annotate_zero_histograms()
262 struct annotated_branch *annotation__get_branch(struct annotation *notes) in annotation__get_branch() argument
264 if (notes == NULL) in annotation__get_branch()
267 if (notes->branch == NULL) in annotation__get_branch()
268 notes->branch = zalloc(sizeof(*notes->branch)); in annotation__get_branch()
270 return notes->branch; in annotation__get_branch()
276 struct annotation *notes = symbol__annotation(sym); in symbol__find_branch_hist() local
280 branch = annotation__get_branch(notes); in symbol__find_branch_hist()
301 struct annotation *notes = symbol__annotation(sym); in symbol__hists() local
303 if (notes->src == NULL) { in symbol__hists()
304 notes->src = annotated_source__new(); in symbol__hists()
305 if (notes->src == NULL) in symbol__hists()
310 if (notes->src->histograms == NULL) { in symbol__hists()
312 annotated_source__alloc_histograms(notes->src, nr_hists); in symbol__hists()
315 return notes->src; in symbol__hists()
440 static unsigned annotation__count_insn(struct annotation *notes, u64 start, u64 end) in annotation__count_insn() argument
445 al = annotated_source__get_line(notes->src, start); in annotation__count_insn()
449 list_for_each_entry_from(al, ¬es->src->source, node) { in annotation__count_insn()
468 static void annotation__count_and_fill(struct annotation *notes, u64 start, u64 end, struct cyc_his… in annotation__count_and_fill() argument
473 n_insn = annotation__count_insn(notes, start, end); in annotation__count_and_fill()
483 al = annotated_source__get_line(notes->src, start); in annotation__count_and_fill()
487 list_for_each_entry_from(al, ¬es->src->source, node) { in annotation__count_and_fill()
498 branch = annotation__get_branch(notes); in annotation__count_and_fill()
507 static int annotation__compute_ipc(struct annotation *notes, size_t size, in annotation__compute_ipc() argument
514 if (!notes->branch || !notes->branch->cycles_hist) in annotation__compute_ipc()
517 notes->branch->total_insn = annotation__count_insn(notes, 0, size - 1); in annotation__compute_ipc()
518 notes->branch->hit_cycles = 0; in annotation__compute_ipc()
519 notes->branch->hit_insn = 0; in annotation__compute_ipc()
520 notes->branch->cover_insn = 0; in annotation__compute_ipc()
522 annotation__lock(notes); in annotation__compute_ipc()
526 ch = ¬es->branch->cycles_hist[offset]; in annotation__compute_ipc()
530 al = annotated_source__get_line(notes->src, offset); in annotation__compute_ipc()
539 annotation__count_and_fill(notes, ch->start, offset, ch); in annotation__compute_ipc()
545 if (al && notes->branch->br_cntr) { in annotation__compute_ipc()
556 memcpy(al->br_cntr, ¬es->branch->br_cntr[offset * br_cntr_nr], in annotation__compute_ipc()
564 struct cyc_hist *ch = ¬es->branch->cycles_hist[offset]; in annotation__compute_ipc()
569 al = annotated_source__get_line(notes->src, offset); in annotation__compute_ipc()
578 annotation__unlock(notes); in annotation__compute_ipc()
595 void annotation__exit(struct annotation *notes) in annotation__exit() argument
597 annotated_source__delete(notes->src); in annotation__exit()
598 annotated_branch__delete(notes->branch); in annotation__exit()
609 static size_t annotation__hash(const struct annotation *notes) in annotation__hash() argument
611 return (size_t)notes; in annotation__hash()
614 static struct mutex *annotation__get_mutex(const struct annotation *notes) in annotation__get_mutex() argument
622 return sharded_mutex__get_mutex(sharded_mutex, annotation__hash(notes)); in annotation__get_mutex()
625 void annotation__lock(struct annotation *notes) in annotation__lock() argument
628 struct mutex *mutex = annotation__get_mutex(notes); in annotation__lock()
634 void annotation__unlock(struct annotation *notes) in annotation__unlock() argument
637 struct mutex *mutex = annotation__get_mutex(notes); in annotation__unlock()
643 bool annotation__trylock(struct annotation *notes) in annotation__trylock() argument
645 struct mutex *mutex = annotation__get_mutex(notes); in annotation__trylock()
784 struct annotation *notes = symbol__annotation(sym); in annotation_line__print() local
819 list_for_each_entry_from(queue, ¬es->src->source, node) { in annotation_line__print()
890 int width = annotation__pcnt_width(notes); in annotation_line__print()
905 static void calc_percent(struct annotation *notes, in calc_percent() argument
911 struct sym_hist *sym_hist = annotation__histogram(notes, evsel); in calc_percent()
918 entry = annotated_source__hist_entry(notes->src, evsel, offset); in calc_percent()
942 static void annotation__calc_percent(struct annotation *notes, in annotation__calc_percent() argument
948 list_for_each_entry(al, ¬es->src->source, node) { in annotation__calc_percent()
955 next = annotation_line__next(al, ¬es->src->source); in annotation__calc_percent()
969 calc_percent(notes, evsel, data, al->offset, end); in annotation__calc_percent()
976 struct annotation *notes = symbol__annotation(sym); in symbol__calc_percent() local
978 annotation__calc_percent(notes, evsel, symbol__size(sym)); in symbol__calc_percent()
1014 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()
1238 int width = annotation__pcnt_width(notes); in hist_entry__annotate_printf()
1269 apd.addr_fmt_width = annotated_source__addr_fmt_width(¬es->src->source, in hist_entry__annotate_printf()
1274 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
1374 list_for_each_entry(al, ¬es->src->source, node) { in symbol__annotate_fprintf2()
1377 annotation_line__write(al, notes, &wops); in symbol__annotate_fprintf2()
1418 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_zero_histogram() local
1419 struct sym_hist *h = annotation__histogram(notes, evsel); in symbol__annotate_zero_histogram()
1421 memset(h, 0, sizeof(*notes->src->histograms) * notes->src->nr_histograms); in symbol__annotate_zero_histogram()
1426 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_decay_histogram() local
1427 struct sym_hist *h = annotation__histogram(notes, evsel); in symbol__annotate_decay_histogram()
1431 list_for_each_entry(al, ¬es->src->source, node) { in symbol__annotate_decay_histogram()
1437 entry = annotated_source__hist_entry(notes->src, evsel, al->offset); in symbol__annotate_decay_histogram()
1495 annotation__mark_jump_targets(struct annotation *notes, struct symbol *sym) in annotation__mark_jump_targets() argument
1503 list_for_each_entry(al, ¬es->src->source, node) { in annotation__mark_jump_targets()
1512 target = annotated_source__get_line(notes->src, in annotation__mark_jump_targets()
1521 if (++target->jump_sources > notes->src->max_jump_sources) in annotation__mark_jump_targets()
1522 notes->src->max_jump_sources = target->jump_sources; in annotation__mark_jump_targets()
1526 static void annotation__set_index(struct annotation *notes) in annotation__set_index() argument
1529 struct annotated_source *src = notes->src; in annotation__set_index()
1557 static int annotation__max_ins_name(struct annotation *notes) in annotation__max_ins_name() argument
1562 list_for_each_entry(al, ¬es->src->source, node) { in annotation__max_ins_name()
1575 annotation__init_column_widths(struct annotation *notes, struct symbol *sym) in annotation__init_column_widths() argument
1577 notes->src->widths.addr = notes->src->widths.target = in annotation__init_column_widths()
1578 notes->src->widths.min_addr = hex_width(symbol__size(sym)); in annotation__init_column_widths()
1579 notes->src->widths.max_addr = hex_width(sym->end); in annotation__init_column_widths()
1580 notes->src->widths.jumps = width_jumps(notes->src->max_jump_sources); in annotation__init_column_widths()
1581 notes->src->widths.max_ins_name = annotation__max_ins_name(notes); in annotation__init_column_widths()
1584 void annotation__update_column_widths(struct annotation *notes) in annotation__update_column_widths() argument
1587 notes->src->widths.target = notes->src->widths.min_addr; in annotation__update_column_widths()
1589 notes->src->widths.target = BITS_PER_LONG / 4; in annotation__update_column_widths()
1591 notes->src->widths.target = notes->src->widths.max_addr; in annotation__update_column_widths()
1593 notes->src->widths.addr = notes->src->widths.target; in annotation__update_column_widths()
1596 notes->src->widths.addr += notes->src->widths.jumps + 1; in annotation__update_column_widths()
1599 void annotation__toggle_full_addr(struct annotation *notes, struct map_symbol *ms) in annotation__toggle_full_addr() argument
1604 notes->src->start = map__objdump_2mem(ms->map, ms->sym->start); in annotation__toggle_full_addr()
1606 notes->src->start = map__rip_2objdump(ms->map, ms->sym->start); in annotation__toggle_full_addr()
1608 annotation__update_column_widths(notes); in annotation__toggle_full_addr()
1611 static void annotation__calc_lines(struct annotation *notes, struct map_symbol *ms, in annotation__calc_lines() argument
1617 list_for_each_entry(al, ¬es->src->source, node) { in annotation__calc_lines()
1646 struct annotation *notes = symbol__annotation(ms->sym); in symbol__calc_lines() local
1648 annotation__calc_lines(notes, ms, root); in symbol__calc_lines()
1745 static void disasm_line__write(struct disasm_line *dl, struct annotation *notes, in disasm_line__write() argument
1774 notes->src->widths.max_ins_name); in disasm_line__write()
1777 static void ipc_coverage_string(char *bf, int size, struct annotation *notes) in ipc_coverage_string() argument
1780 struct annotated_branch *branch = annotation__get_branch(notes); in ipc_coverage_string()
1937 static void __annotation_line__write(struct annotation_line *al, struct annotation *notes, in __annotation_line__write() argument
1948 int pcnt_width = annotation__pcnt_width(notes), in __annotation_line__write()
1949 cycles_width = annotation__cycles_width(notes); in __annotation_line__write()
1955 if (notes->branch && al->cycles) { in __annotation_line__write()
1992 if (notes->branch) { in __annotation_line__write()
2050 ipc_coverage_string(bf, sizeof(bf), notes); in __annotation_line__write()
2062 notes->src->widths.addr + 1, al->line_nr); in __annotation_line__write()
2065 notes->src->widths.addr, " "); in __annotation_line__write()
2073 addr += notes->src->start; in __annotation_line__write()
2083 notes->src->widths.jumps, in __annotation_line__write()
2092 notes->src->widths.target, addr); in __annotation_line__write()
2100 notes->src->widths.addr, " "); in __annotation_line__write()
2110 disasm_line__write(disasm_line(al), notes, obj, bf, sizeof(bf), obj__printf, obj__write_graph); in __annotation_line__write()
2117 void annotation_line__write(struct annotation_line *al, struct annotation *notes, in annotation_line__write() argument
2120 __annotation_line__write(al, notes, wops->first_line, wops->current_entry, in annotation_line__write()
2132 struct annotation *notes = symbol__annotation(sym); in symbol__annotate2() local
2142 annotation__set_index(notes); in symbol__annotate2()
2143 annotation__mark_jump_targets(notes, sym); in symbol__annotate2()
2145 err = annotation__compute_ipc(notes, size, evsel); in symbol__annotate2()
2149 annotation__init_column_widths(notes, sym); in symbol__annotate2()
2150 annotation__update_column_widths(notes); in symbol__annotate2()
2548 struct annotation *notes; in find_disasm_line() local
2550 notes = symbol__annotation(sym); in find_disasm_line()
2552 list_for_each_entry(dl, ¬es->src->source, al.node) { in find_disasm_line()
2622 annotation__prev_asm_line(struct annotation *notes, struct disasm_line *curr) in annotation__prev_asm_line() argument
2624 struct list_head *sources = ¬es->src->source; in annotation__prev_asm_line()
2642 annotation__next_asm_line(struct annotation *notes, struct disasm_line *curr) in annotation__next_asm_line() argument
2644 struct list_head *sources = ¬es->src->source; in annotation__next_asm_line()
2664 struct annotation *notes; in annotate_calc_pcrel() local
2668 notes = symbol__annotation(ms->sym); in annotate_calc_pcrel()
2676 next = annotation__next_asm_line(notes, dl); in annotate_calc_pcrel()
2864 struct annotation *notes; in hist_entry__get_data_type() local
2867 notes = symbol__annotation(ms->sym); in hist_entry__get_data_type()
2868 prev_dl = annotation__prev_asm_line(notes, dl); in hist_entry__get_data_type()
2967 struct annotation *notes = symbol__annotation(sym); in process_basic_block() local
2975 last_dl = list_last_entry(¬es->src->source, in process_basic_block()
2978 last_dl = annotation__prev_asm_line(notes, last_dl); in process_basic_block()
2983 list_for_each_entry_from(dl, ¬es->src->source, al.node) { in process_basic_block()
3016 next_dl = annotation__next_asm_line(notes, dl); in process_basic_block()