Lines Matching full:notes
6 * copyright 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, ¬es->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, ¬es->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 = ¬es->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, ¬es->branch->br_cntr[offset * br_cntr_nr], in annotation__compute_ipc()
562 struct cyc_hist *ch = ¬es->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, ¬es->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
864 struct sym_hist *sym_hist = annotation__histogram(notes, evsel); in calc_percent()
871 entry = annotated_source__hist_entry(notes->src, evsel, offset); in calc_percent()
895 static void annotation__calc_percent(struct annotation *notes, in annotation__calc_percent() argument
901 list_for_each_entry(al, ¬es->src->source, node) { in annotation__calc_percent()
908 next = annotation_line__next(al, ¬es->src->source); in annotation__calc_percent()
922 calc_percent(notes, evsel, data, al->offset, end); in annotation__calc_percent()
929 struct annotation *notes = symbol__annotation(sym); in symbol__calc_percent() local
931 annotation__calc_percent(notes, evsel, symbol__size(sym)); in symbol__calc_percent()
967 struct annotation *notes = symbol__annotation(sym); in symbol__annotate() local
982 if (notes->src && !list_empty(¬es->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()
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()
1142 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_hits() local
1143 struct sym_hist *h = annotation__histogram(notes, evsel); in symbol__annotate_hits()
1149 entry = annotated_source__hist_entry(notes->src, evsel, offset); in symbol__annotate_hits()
1178 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_printf() local
1179 struct sym_hist *h = annotation__histogram(notes, evsel); in symbol__annotate_printf()
1187 int width = annotation__pcnt_width(notes); in symbol__annotate_printf()
1220 addr_fmt_width = annotated_source__addr_fmt_width(¬es->src->source, start); in symbol__annotate_printf()
1222 list_for_each_entry(pos, ¬es->src->source, node) { in symbol__annotate_printf()
1311 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_fprintf2() local
1323 list_for_each_entry(al, ¬es->src->source, node) { in symbol__annotate_fprintf2()
1326 annotation_line__write(al, notes, &wops); in symbol__annotate_fprintf2()
1367 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_zero_histogram() local
1368 struct sym_hist *h = annotation__histogram(notes, evsel); in symbol__annotate_zero_histogram()
1370 memset(h, 0, sizeof(*notes->src->histograms) * notes->src->nr_histograms); in symbol__annotate_zero_histogram()
1375 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_decay_histogram() local
1376 struct sym_hist *h = annotation__histogram(notes, evsel); in symbol__annotate_decay_histogram()
1380 list_for_each_entry(al, ¬es->src->source, node) { in symbol__annotate_decay_histogram()
1386 entry = annotated_source__hist_entry(notes->src, evsel, al->offset); in symbol__annotate_decay_histogram()
1444 annotation__mark_jump_targets(struct annotation *notes, struct symbol *sym) in annotation__mark_jump_targets() argument
1452 list_for_each_entry(al, ¬es->src->source, node) { in annotation__mark_jump_targets()
1461 target = annotated_source__get_line(notes->src, 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()
1475 static void annotation__set_index(struct annotation *notes) in annotation__set_index() argument
1478 struct annotated_source *src = notes->src; in annotation__set_index()
1506 static int annotation__max_ins_name(struct annotation *notes) in annotation__max_ins_name() argument
1511 list_for_each_entry(al, ¬es->src->source, node) { in annotation__max_ins_name()
1524 annotation__init_column_widths(struct annotation *notes, struct symbol *sym) in annotation__init_column_widths() argument
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()
1533 void annotation__update_column_widths(struct annotation *notes) in annotation__update_column_widths() argument
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()
1548 void annotation__toggle_full_addr(struct annotation *notes, struct map_symbol *ms) in annotation__toggle_full_addr() argument
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()
1557 annotation__update_column_widths(notes); in annotation__toggle_full_addr()
1560 static void annotation__calc_lines(struct annotation *notes, struct map_symbol *ms, in annotation__calc_lines() argument
1566 list_for_each_entry(al, ¬es->src->source, node) { in annotation__calc_lines()
1595 struct annotation *notes = symbol__annotation(ms->sym); in symbol__calc_lines() local
1597 annotation__calc_lines(notes, ms, root); in symbol__calc_lines()
1692 static void disasm_line__write(struct disasm_line *dl, struct annotation *notes, in disasm_line__write() argument
1721 notes->src->widths.max_ins_name); in disasm_line__write()
1724 static void ipc_coverage_string(char *bf, int size, struct annotation *notes) in ipc_coverage_string() argument
1727 struct annotated_branch *branch = annotation__get_branch(notes); in ipc_coverage_string()
1884 static void __annotation_line__write(struct annotation_line *al, struct annotation *notes, in __annotation_line__write() argument
1895 int pcnt_width = annotation__pcnt_width(notes), in __annotation_line__write()
1896 cycles_width = annotation__cycles_width(notes); in __annotation_line__write()
1902 if (notes->branch && al->cycles) { in __annotation_line__write()
1939 if (notes->branch) { in __annotation_line__write()
1997 ipc_coverage_string(bf, sizeof(bf), notes); in __annotation_line__write()
2009 notes->src->widths.addr + 1, al->line_nr); in __annotation_line__write()
2012 notes->src->widths.addr, " "); in __annotation_line__write()
2020 addr += notes->src->start; in __annotation_line__write()
2030 notes->src->widths.jumps, in __annotation_line__write()
2039 notes->src->widths.target, addr); in __annotation_line__write()
2047 notes->src->widths.addr, " "); in __annotation_line__write()
2057 disasm_line__write(disasm_line(al), notes, obj, bf, sizeof(bf), obj__printf, obj__write_graph); in __annotation_line__write()
2064 void annotation_line__write(struct annotation_line *al, struct annotation *notes, in annotation_line__write() argument
2067 __annotation_line__write(al, notes, wops->first_line, wops->current_entry, in annotation_line__write()
2079 struct annotation *notes = symbol__annotation(sym); in symbol__annotate2() local
2089 annotation__set_index(notes); in symbol__annotate2()
2090 annotation__mark_jump_targets(notes, sym); in symbol__annotate2()
2092 err = annotation__compute_ipc(notes, size, evsel); in symbol__annotate2()
2096 annotation__init_column_widths(notes, sym); in symbol__annotate2()
2097 annotation__update_column_widths(notes); in symbol__annotate2()
2495 struct annotation *notes; in find_disasm_line() local
2497 notes = symbol__annotation(sym); in find_disasm_line()
2499 list_for_each_entry(dl, ¬es->src->source, al.node) { in find_disasm_line()
2569 annotation__prev_asm_line(struct annotation *notes, struct disasm_line *curr) in annotation__prev_asm_line() argument
2571 struct list_head *sources = ¬es->src->source; in annotation__prev_asm_line()
2589 annotation__next_asm_line(struct annotation *notes, struct disasm_line *curr) in annotation__next_asm_line() argument
2591 struct list_head *sources = ¬es->src->source; in annotation__next_asm_line()
2611 struct annotation *notes; in annotate_calc_pcrel() local
2615 notes = symbol__annotation(ms->sym); in annotate_calc_pcrel()
2623 next = annotation__next_asm_line(notes, dl); in annotate_calc_pcrel()
2795 struct annotation *notes; in hist_entry__get_data_type() local
2798 notes = symbol__annotation(ms->sym); in hist_entry__get_data_type()
2799 prev_dl = annotation__prev_asm_line(notes, dl); in hist_entry__get_data_type()
2896 struct annotation *notes = symbol__annotation(sym); in process_basic_block() local
2904 last_dl = list_last_entry(¬es->src->source, in process_basic_block()
2907 last_dl = annotation__prev_asm_line(notes, last_dl); in process_basic_block()
2912 list_for_each_entry_from(dl, ¬es->src->source, al.node) { in process_basic_block()
2945 next_dl = annotation__next_asm_line(notes, dl); in process_basic_block()