Lines Matching refs:notes

146 	struct annotation *notes = symbol__annotation(sym);  in symbol__annotate_zero_histograms()  local
148 annotation__lock(notes); in symbol__annotate_zero_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()
158 annotation__unlock(notes); in symbol__annotate_zero_histograms()
260 struct annotated_branch *annotation__get_branch(struct annotation *notes) in annotation__get_branch() argument
262 if (notes == NULL) in annotation__get_branch()
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()
274 struct annotation *notes = symbol__annotation(sym); in symbol__find_branch_hist() local
278 branch = annotation__get_branch(notes); in symbol__find_branch_hist()
299 struct annotation *notes = symbol__annotation(sym); in symbol__hists() local
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()
438 static unsigned annotation__count_insn(struct annotation *notes, u64 start, u64 end) in annotation__count_insn() argument
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()
466 static void annotation__count_and_fill(struct annotation *notes, u64 start, u64 end, struct cyc_his… in annotation__count_and_fill() argument
471 n_insn = annotation__count_insn(notes, start, end); 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()
496 branch = annotation__get_branch(notes); in annotation__count_and_fill()
505 static int annotation__compute_ipc(struct annotation *notes, size_t size, in annotation__compute_ipc() argument
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()
520 annotation__lock(notes); in annotation__compute_ipc()
524 ch = &notes->branch->cycles_hist[offset]; in annotation__compute_ipc()
528 al = annotated_source__get_line(notes->src, offset); in annotation__compute_ipc()
537 annotation__count_and_fill(notes, ch->start, offset, ch); in annotation__compute_ipc()
543 if (al && notes->branch->br_cntr) { 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()
567 al = annotated_source__get_line(notes->src, offset); in annotation__compute_ipc()
576 annotation__unlock(notes); in annotation__compute_ipc()
593 void annotation__exit(struct annotation *notes) in annotation__exit() argument
595 annotated_source__delete(notes->src); in annotation__exit()
596 annotated_branch__delete(notes->branch); in annotation__exit()
607 static size_t annotation__hash(const struct annotation *notes) in annotation__hash() argument
609 return (size_t)notes; in annotation__hash()
612 static struct mutex *annotation__get_mutex(const struct annotation *notes) in annotation__get_mutex() argument
620 return sharded_mutex__get_mutex(sharded_mutex, annotation__hash(notes)); in annotation__get_mutex()
623 void annotation__lock(struct annotation *notes) in annotation__lock() argument
626 struct mutex *mutex = annotation__get_mutex(notes); in annotation__lock()
632 void annotation__unlock(struct annotation *notes) in annotation__unlock() argument
635 struct mutex *mutex = annotation__get_mutex(notes); in annotation__unlock()
641 bool annotation__trylock(struct annotation *notes) in annotation__trylock() argument
643 struct mutex *mutex = annotation__get_mutex(notes); in annotation__trylock()
768 struct annotation *notes = symbol__annotation(sym); in annotation_line__print() local
796 list_for_each_entry_from(queue, &notes->src->source, node) { in annotation_line__print()
844 int width = annotation__pcnt_width(notes); in annotation_line__print()
858 static void calc_percent(struct annotation *notes, in calc_percent() argument
865 struct sym_hist *sym_hist = annotation__histogram(notes, evidx); in calc_percent()
872 entry = annotated_source__hist_entry(notes->src, evidx, offset); in calc_percent()
896 static void annotation__calc_percent(struct annotation *notes, in annotation__calc_percent() argument
902 list_for_each_entry(al, &notes->src->source, node) { in annotation__calc_percent()
909 next = annotation_line__next(al, &notes->src->source); in annotation__calc_percent()
923 calc_percent(notes, evsel, data, al->offset, end); in annotation__calc_percent()
930 struct annotation *notes = symbol__annotation(sym); in symbol__calc_percent() local
932 annotation__calc_percent(notes, evsel, symbol__size(sym)); in symbol__calc_percent()
968 struct annotation *notes = symbol__annotation(sym); in symbol__annotate() local
983 if (notes->src && !list_empty(&notes->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()
1144 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_hits() local
1145 struct sym_hist *h = annotation__histogram(notes, evidx); in symbol__annotate_hits()
1151 entry = annotated_source__hist_entry(notes->src, evidx, offset); in symbol__annotate_hits()
1180 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_printf() local
1181 struct sym_hist *h = annotation__histogram(notes, evsel->core.idx); in symbol__annotate_printf()
1189 int width = annotation__pcnt_width(notes); in symbol__annotate_printf()
1222 addr_fmt_width = annotated_source__addr_fmt_width(&notes->src->source, start); in symbol__annotate_printf()
1224 list_for_each_entry(pos, &notes->src->source, node) { in symbol__annotate_printf()
1313 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_fprintf2() local
1325 list_for_each_entry(al, &notes->src->source, node) { in symbol__annotate_fprintf2()
1328 annotation_line__write(al, notes, &wops); in symbol__annotate_fprintf2()
1369 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_zero_histogram() local
1370 struct sym_hist *h = annotation__histogram(notes, evidx); in symbol__annotate_zero_histogram()
1372 memset(h, 0, sizeof(*notes->src->histograms) * notes->src->nr_histograms); in symbol__annotate_zero_histogram()
1377 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_decay_histogram() local
1378 struct sym_hist *h = annotation__histogram(notes, evidx); in symbol__annotate_decay_histogram()
1382 list_for_each_entry(al, &notes->src->source, node) { in symbol__annotate_decay_histogram()
1388 entry = annotated_source__hist_entry(notes->src, evidx, al->offset); in symbol__annotate_decay_histogram()
1446 annotation__mark_jump_targets(struct annotation *notes, struct symbol *sym) in annotation__mark_jump_targets() argument
1454 list_for_each_entry(al, &notes->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()
1477 static void annotation__set_index(struct annotation *notes) in annotation__set_index() argument
1480 struct annotated_source *src = notes->src; in annotation__set_index()
1508 static int annotation__max_ins_name(struct annotation *notes) in annotation__max_ins_name() argument
1513 list_for_each_entry(al, &notes->src->source, node) { in annotation__max_ins_name()
1526 annotation__init_column_widths(struct annotation *notes, struct symbol *sym) in annotation__init_column_widths() argument
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()
1535 void annotation__update_column_widths(struct annotation *notes) in annotation__update_column_widths() argument
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()
1550 void annotation__toggle_full_addr(struct annotation *notes, struct map_symbol *ms) in annotation__toggle_full_addr() argument
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()
1559 annotation__update_column_widths(notes); in annotation__toggle_full_addr()
1562 static void annotation__calc_lines(struct annotation *notes, struct map_symbol *ms, in annotation__calc_lines() argument
1568 list_for_each_entry(al, &notes->src->source, node) { in annotation__calc_lines()
1597 struct annotation *notes = symbol__annotation(ms->sym); in symbol__calc_lines() local
1599 annotation__calc_lines(notes, ms, root); in symbol__calc_lines()
1694 static void disasm_line__write(struct disasm_line *dl, struct annotation *notes, in disasm_line__write() argument
1723 notes->src->widths.max_ins_name); in disasm_line__write()
1726 static void ipc_coverage_string(char *bf, int size, struct annotation *notes) in ipc_coverage_string() argument
1729 struct annotated_branch *branch = annotation__get_branch(notes); in ipc_coverage_string()
1886 static void __annotation_line__write(struct annotation_line *al, struct annotation *notes, in __annotation_line__write() argument
1897 int pcnt_width = annotation__pcnt_width(notes), in __annotation_line__write()
1898 cycles_width = annotation__cycles_width(notes); in __annotation_line__write()
1904 if (notes->branch && al->cycles) { in __annotation_line__write()
1941 if (notes->branch) { in __annotation_line__write()
1999 ipc_coverage_string(bf, sizeof(bf), notes); in __annotation_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()
2059 disasm_line__write(disasm_line(al), notes, obj, bf, sizeof(bf), obj__printf, obj__write_graph); in __annotation_line__write()
2066 void annotation_line__write(struct annotation_line *al, struct annotation *notes, in annotation_line__write() argument
2069 __annotation_line__write(al, notes, wops->first_line, wops->current_entry, in annotation_line__write()
2081 struct annotation *notes = symbol__annotation(sym); in symbol__annotate2() local
2091 annotation__set_index(notes); in symbol__annotate2()
2092 annotation__mark_jump_targets(notes, sym); in symbol__annotate2()
2094 err = annotation__compute_ipc(notes, size, evsel); in symbol__annotate2()
2098 annotation__init_column_widths(notes, sym); in symbol__annotate2()
2099 annotation__update_column_widths(notes); in symbol__annotate2()
2425 struct annotation *notes; in find_disasm_line() local
2427 notes = symbol__annotation(sym); in find_disasm_line()
2429 list_for_each_entry(dl, &notes->src->source, al.node) { in find_disasm_line()
2499 annotation__prev_asm_line(struct annotation *notes, struct disasm_line *curr) in annotation__prev_asm_line() argument
2501 struct list_head *sources = &notes->src->source; in annotation__prev_asm_line()
2519 annotation__next_asm_line(struct annotation *notes, struct disasm_line *curr) in annotation__next_asm_line() argument
2521 struct list_head *sources = &notes->src->source; in annotation__next_asm_line()
2541 struct annotation *notes; in annotate_calc_pcrel() local
2545 notes = symbol__annotation(ms->sym); in annotate_calc_pcrel()
2553 next = annotation__next_asm_line(notes, dl); in annotate_calc_pcrel()
2725 struct annotation *notes; in hist_entry__get_data_type() local
2728 notes = symbol__annotation(ms->sym); in hist_entry__get_data_type()
2729 prev_dl = annotation__prev_asm_line(notes, dl); in hist_entry__get_data_type()
2826 struct annotation *notes = symbol__annotation(sym); in process_basic_block() local
2834 last_dl = list_last_entry(&notes->src->source, in process_basic_block()
2837 last_dl = annotation__prev_asm_line(notes, last_dl); in process_basic_block()
2842 list_for_each_entry_from(dl, &notes->src->source, al.node) { in process_basic_block()
2875 next_dl = annotation__next_asm_line(notes, dl); in process_basic_block()