Lines Matching full:notes

6  * copyright notes.
852 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_zero_histograms() local
854 annotation__lock(notes); in symbol__annotate_zero_histograms()
855 if (notes->src != NULL) { in symbol__annotate_zero_histograms()
856 memset(notes->src->histograms, 0, in symbol__annotate_zero_histograms()
857 notes->src->nr_histograms * notes->src->sizeof_sym_hist); in symbol__annotate_zero_histograms()
859 if (notes->branch && notes->branch->cycles_hist) { in symbol__annotate_zero_histograms()
860 memset(notes->branch->cycles_hist, 0, in symbol__annotate_zero_histograms()
863 annotation__unlock(notes); in symbol__annotate_zero_histograms()
952 static struct annotated_branch *annotation__get_branch(struct annotation *notes) in annotation__get_branch() argument
954 if (notes == NULL) in annotation__get_branch()
957 if (notes->branch == NULL) in annotation__get_branch()
958 notes->branch = zalloc(sizeof(*notes->branch)); in annotation__get_branch()
960 return notes->branch; in annotation__get_branch()
965 struct annotation *notes = symbol__annotation(sym); in symbol__cycles_hist() local
968 branch = annotation__get_branch(notes); in symbol__cycles_hist()
983 struct annotation *notes = symbol__annotation(sym); in symbol__hists() local
985 if (notes->src == NULL) { in symbol__hists()
986 notes->src = annotated_source__new(); in symbol__hists()
987 if (notes->src == NULL) in symbol__hists()
992 if (notes->src->histograms == NULL) { in symbol__hists()
994 annotated_source__alloc_histograms(notes->src, symbol__size(sym), in symbol__hists()
998 return notes->src; in symbol__hists()
1075 static unsigned annotation__count_insn(struct annotation *notes, u64 start, u64 end) in annotation__count_insn() argument
1081 if (notes->offsets[offset]) in annotation__count_insn()
1095 static void annotation__count_and_fill(struct annotation *notes, u64 start, u64 end, struct cyc_his… in annotation__count_and_fill() argument
1101 n_insn = annotation__count_insn(notes, start, end); in annotation__count_and_fill()
1111 struct annotation_line *al = notes->offsets[offset]; in annotation__count_and_fill()
1119 branch = annotation__get_branch(notes); in annotation__count_and_fill()
1128 static int annotation__compute_ipc(struct annotation *notes, size_t size) in annotation__compute_ipc() argument
1133 if (!notes->branch || !notes->branch->cycles_hist) in annotation__compute_ipc()
1136 notes->branch->total_insn = annotation__count_insn(notes, 0, size - 1); in annotation__compute_ipc()
1137 notes->branch->hit_cycles = 0; in annotation__compute_ipc()
1138 notes->branch->hit_insn = 0; in annotation__compute_ipc()
1139 notes->branch->cover_insn = 0; in annotation__compute_ipc()
1141 annotation__lock(notes); in annotation__compute_ipc()
1145 ch = &notes->branch->cycles_hist[offset]; in annotation__compute_ipc()
1149 al = notes->offsets[offset]; in annotation__compute_ipc()
1158 annotation__count_and_fill(notes, ch->start, offset, ch); in annotation__compute_ipc()
1169 struct cyc_hist *ch = &notes->branch->cycles_hist[offset]; in annotation__compute_ipc()
1172 struct annotation_line *al = notes->offsets[offset]; in annotation__compute_ipc()
1179 annotation__unlock(notes); in annotation__compute_ipc()
1332 void annotation__exit(struct annotation *notes) in annotation__exit() argument
1334 annotated_source__delete(notes->src); in annotation__exit()
1335 annotated_branch__delete(notes->branch); in annotation__exit()
1346 static size_t annotation__hash(const struct annotation *notes) in annotation__hash() argument
1348 return (size_t)notes; in annotation__hash()
1351 static struct mutex *annotation__get_mutex(const struct annotation *notes) in annotation__get_mutex() argument
1359 return sharded_mutex__get_mutex(sharded_mutex, annotation__hash(notes)); in annotation__get_mutex()
1362 void annotation__lock(struct annotation *notes) in annotation__lock() argument
1365 struct mutex *mutex = annotation__get_mutex(notes); in annotation__lock()
1371 void annotation__unlock(struct annotation *notes) in annotation__unlock() argument
1374 struct mutex *mutex = annotation__get_mutex(notes); in annotation__unlock()
1380 bool annotation__trylock(struct annotation *notes) in annotation__trylock() argument
1382 struct mutex *mutex = annotation__get_mutex(notes); in annotation__trylock()
1514 struct annotation *notes = symbol__annotation(sym); in annotation_line__print() local
1536 list_for_each_entry_from(queue, &notes->src->source, node) { in annotation_line__print()
1626 struct annotation *notes = symbol__annotation(sym); in symbol__parse_objdump_line() local
1683 annotation_line__add(&dl->al, &notes->src->source); in symbol__parse_objdump_line()
1694 struct annotation *notes = symbol__annotation(sym); in delete_last_nop() local
1695 struct list_head *list = &notes->src->source; in delete_last_nop()
1853 struct annotation *notes = symbol__annotation(sym); in symbol__disassemble_bpf() local
1972 &notes->src->source); in symbol__disassemble_bpf()
1983 annotation_line__add(&dl->al, &notes->src->source); in symbol__disassemble_bpf()
2008 struct annotation *notes = symbol__annotation(sym); in symbol__disassemble_bpf_image() local
2017 annotation_line__add(&dl->al, &notes->src->source); in symbol__disassemble_bpf_image()
2297 static void annotation__calc_percent(struct annotation *notes, in annotation__calc_percent() argument
2303 list_for_each_entry(al, &notes->src->source, node) { in annotation__calc_percent()
2310 next = annotation_line__next(al, &notes->src->source); in annotation__calc_percent()
2320 sym_hist = annotation__histogram(notes, evsel->core.idx); in annotation__calc_percent()
2330 struct annotation *notes = symbol__annotation(sym); in symbol__calc_percent() local
2332 annotation__calc_percent(notes, evsel, symbol__size(sym)); in symbol__calc_percent()
2339 struct annotation *notes = symbol__annotation(sym); in symbol__annotate() local
2371 notes->start = map__objdump_2mem(ms->map, ms->sym->start); in symbol__annotate()
2373 notes->start = map__rip_2objdump(ms->map, ms->sym->start); in symbol__annotate()
2505 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_hits() local
2506 struct sym_hist *h = annotation__histogram(notes, evsel->core.idx); in symbol__annotate_hits()
2537 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_printf() local
2538 struct sym_hist *h = annotation__histogram(notes, evsel->core.idx); in symbol__annotate_printf()
2580 addr_fmt_width = annotated_source__addr_fmt_width(&notes->src->source, start); in symbol__annotate_printf()
2582 list_for_each_entry(pos, &notes->src->source, node) { in symbol__annotate_printf()
2671 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_fprintf2() local
2683 list_for_each_entry(al, &notes->src->source, node) { in symbol__annotate_fprintf2()
2684 if (annotation_line__filter(al, notes)) in symbol__annotate_fprintf2()
2686 annotation_line__write(al, notes, &wops); in symbol__annotate_fprintf2()
2727 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_zero_histogram() local
2728 struct sym_hist *h = annotation__histogram(notes, evidx); in symbol__annotate_zero_histogram()
2730 memset(h, 0, notes->src->sizeof_sym_hist); in symbol__annotate_zero_histogram()
2735 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_decay_histogram() local
2736 struct sym_hist *h = annotation__histogram(notes, evidx); in symbol__annotate_decay_histogram()
2794 void annotation__mark_jump_targets(struct annotation *notes, struct symbol *sym) in annotation__mark_jump_targets() argument
2803 struct annotation_line *al = notes->offsets[offset]; in annotation__mark_jump_targets()
2811 al = notes->offsets[dl->ops.target.offset]; in annotation__mark_jump_targets()
2820 if (++al->jump_sources > notes->max_jump_sources) in annotation__mark_jump_targets()
2821 notes->max_jump_sources = al->jump_sources; in annotation__mark_jump_targets()
2825 void annotation__set_offsets(struct annotation *notes, s64 size) in annotation__set_offsets() argument
2828 struct annotated_source *src = notes->src; in annotation__set_offsets()
2850 notes->offsets[al->offset] = al; in annotation__set_offsets()
2865 static int annotation__max_ins_name(struct annotation *notes) in annotation__max_ins_name() argument
2870 list_for_each_entry(al, &notes->src->source, node) { in annotation__max_ins_name()
2882 void annotation__init_column_widths(struct annotation *notes, struct symbol *sym) in annotation__init_column_widths() argument
2884 notes->widths.addr = notes->widths.target = in annotation__init_column_widths()
2885 notes->widths.min_addr = hex_width(symbol__size(sym)); in annotation__init_column_widths()
2886 notes->widths.max_addr = hex_width(sym->end); in annotation__init_column_widths()
2887 notes->widths.jumps = width_jumps(notes->max_jump_sources); in annotation__init_column_widths()
2888 notes->widths.max_ins_name = annotation__max_ins_name(notes); in annotation__init_column_widths()
2891 void annotation__update_column_widths(struct annotation *notes) in annotation__update_column_widths() argument
2894 notes->widths.target = notes->widths.min_addr; in annotation__update_column_widths()
2896 notes->widths.target = BITS_PER_LONG / 4; in annotation__update_column_widths()
2898 notes->widths.target = notes->widths.max_addr; in annotation__update_column_widths()
2900 notes->widths.addr = notes->widths.target; in annotation__update_column_widths()
2903 notes->widths.addr += notes->widths.jumps + 1; in annotation__update_column_widths()
2906 void annotation__toggle_full_addr(struct annotation *notes, struct map_symbol *ms) in annotation__toggle_full_addr() argument
2911 notes->start = map__objdump_2mem(ms->map, ms->sym->start); in annotation__toggle_full_addr()
2913 notes->start = map__rip_2objdump(ms->map, ms->sym->start); in annotation__toggle_full_addr()
2915 annotation__update_column_widths(notes); in annotation__toggle_full_addr()
2918 static void annotation__calc_lines(struct annotation *notes, struct map_symbol *ms, in annotation__calc_lines() argument
2924 list_for_each_entry(al, &notes->src->source, node) { in annotation__calc_lines()
2953 struct annotation *notes = symbol__annotation(ms->sym); in symbol__calc_lines() local
2955 annotation__calc_lines(notes, ms, root); in symbol__calc_lines()
3033 struct annotation *notes, in annotation_line__max_percent() argument
3039 for (i = 0; i < notes->nr_events; i++) { in annotation_line__max_percent()
3052 static void disasm_line__write(struct disasm_line *dl, struct annotation *notes, in disasm_line__write() argument
3080 disasm_line__scnprintf(dl, bf, size, !annotate_opts.use_offset, notes->widths.max_ins_name); in disasm_line__write()
3083 static void ipc_coverage_string(char *bf, int size, struct annotation *notes) in ipc_coverage_string() argument
3086 struct annotated_branch *branch = annotation__get_branch(notes); in ipc_coverage_string()
3100 static void __annotation_line__write(struct annotation_line *al, struct annotation *notes, in __annotation_line__write() argument
3110 double percent_max = annotation_line__max_percent(al, notes, percent_type); in __annotation_line__write()
3111 int pcnt_width = annotation__pcnt_width(notes), in __annotation_line__write()
3112 cycles_width = annotation__cycles_width(notes); in __annotation_line__write()
3118 if (notes->branch && al->cycles) { in __annotation_line__write()
3128 for (i = 0; i < notes->nr_events; i++) { in __annotation_line__write()
3155 if (notes->branch) { in __annotation_line__write()
3197 ipc_coverage_string(bf, sizeof(bf), notes); in __annotation_line__write()
3208 printed = scnprintf(bf, sizeof(bf), "%-*d ", notes->widths.addr + 1, al->line_nr); in __annotation_line__write()
3210 printed = scnprintf(bf, sizeof(bf), "%-*s ", notes->widths.addr, " "); in __annotation_line__write()
3218 addr += notes->start; in __annotation_line__write()
3228 notes->widths.jumps, in __annotation_line__write()
3237 notes->widths.target, addr); in __annotation_line__write()
3245 notes->widths.addr, " "); in __annotation_line__write()
3255 disasm_line__write(disasm_line(al), notes, obj, bf, sizeof(bf), obj__printf, obj__write_graph); in __annotation_line__write()
3262 void annotation_line__write(struct annotation_line *al, struct annotation *notes, in annotation_line__write() argument
3265 __annotation_line__write(al, notes, wops->first_line, wops->current_entry, in annotation_line__write()
3277 struct annotation *notes = symbol__annotation(sym); in symbol__annotate2() local
3281 notes->offsets = zalloc(size * sizeof(struct annotation_line *)); in symbol__annotate2()
3282 if (notes->offsets == NULL) in symbol__annotate2()
3292 notes->options = &annotate_opts; in symbol__annotate2()
3296 annotation__set_offsets(notes, size); in symbol__annotate2()
3297 annotation__mark_jump_targets(notes, sym); in symbol__annotate2()
3299 err = annotation__compute_ipc(notes, size); in symbol__annotate2()
3303 annotation__init_column_widths(notes, sym); in symbol__annotate2()
3304 notes->nr_events = nr_pcnt; in symbol__annotate2()
3306 annotation__update_column_widths(notes); in symbol__annotate2()
3312 zfree(&notes->offsets); in symbol__annotate2()