Lines Matching full:notes

6  * copyright notes.
908 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_zero_histograms() local
910 annotation__lock(notes); in symbol__annotate_zero_histograms()
911 if (notes->src != NULL) { in symbol__annotate_zero_histograms()
912 memset(notes->src->histograms, 0, in symbol__annotate_zero_histograms()
913 notes->src->nr_histograms * notes->src->sizeof_sym_hist); in symbol__annotate_zero_histograms()
915 if (notes->branch && notes->branch->cycles_hist) { in symbol__annotate_zero_histograms()
916 memset(notes->branch->cycles_hist, 0, in symbol__annotate_zero_histograms()
919 annotation__unlock(notes); in symbol__annotate_zero_histograms()
1008 struct annotated_branch *annotation__get_branch(struct annotation *notes) in annotation__get_branch() argument
1010 if (notes == NULL) in annotation__get_branch()
1013 if (notes->branch == NULL) in annotation__get_branch()
1014 notes->branch = zalloc(sizeof(*notes->branch)); in annotation__get_branch()
1016 return notes->branch; in annotation__get_branch()
1021 struct annotation *notes = symbol__annotation(sym); in symbol__cycles_hist() local
1024 branch = annotation__get_branch(notes); in symbol__cycles_hist()
1039 struct annotation *notes = symbol__annotation(sym); in symbol__hists() local
1041 if (notes->src == NULL) { in symbol__hists()
1042 notes->src = annotated_source__new(); in symbol__hists()
1043 if (notes->src == NULL) in symbol__hists()
1048 if (notes->src->histograms == NULL) { in symbol__hists()
1050 annotated_source__alloc_histograms(notes->src, symbol__size(sym), in symbol__hists()
1054 return notes->src; in symbol__hists()
1131 static unsigned annotation__count_insn(struct annotation *notes, u64 start, u64 end) in annotation__count_insn() argument
1137 if (notes->src->offsets[offset]) in annotation__count_insn()
1151 static void annotation__count_and_fill(struct annotation *notes, u64 start, u64 end, struct cyc_his… in annotation__count_and_fill() argument
1157 n_insn = annotation__count_insn(notes, start, end); in annotation__count_and_fill()
1167 struct annotation_line *al = notes->src->offsets[offset]; in annotation__count_and_fill()
1175 branch = annotation__get_branch(notes); in annotation__count_and_fill()
1184 static int annotation__compute_ipc(struct annotation *notes, size_t size) in annotation__compute_ipc() argument
1189 if (!notes->branch || !notes->branch->cycles_hist) in annotation__compute_ipc()
1192 notes->branch->total_insn = annotation__count_insn(notes, 0, size - 1); in annotation__compute_ipc()
1193 notes->branch->hit_cycles = 0; in annotation__compute_ipc()
1194 notes->branch->hit_insn = 0; in annotation__compute_ipc()
1195 notes->branch->cover_insn = 0; in annotation__compute_ipc()
1197 annotation__lock(notes); in annotation__compute_ipc()
1201 ch = &notes->branch->cycles_hist[offset]; in annotation__compute_ipc()
1205 al = notes->src->offsets[offset]; in annotation__compute_ipc()
1214 annotation__count_and_fill(notes, ch->start, offset, ch); in annotation__compute_ipc()
1225 struct cyc_hist *ch = &notes->branch->cycles_hist[offset]; in annotation__compute_ipc()
1228 struct annotation_line *al = notes->src->offsets[offset]; in annotation__compute_ipc()
1235 annotation__unlock(notes); in annotation__compute_ipc()
1388 void annotation__exit(struct annotation *notes) in annotation__exit() argument
1390 annotated_source__delete(notes->src); in annotation__exit()
1391 annotated_branch__delete(notes->branch); in annotation__exit()
1402 static size_t annotation__hash(const struct annotation *notes) in annotation__hash() argument
1404 return (size_t)notes; in annotation__hash()
1407 static struct mutex *annotation__get_mutex(const struct annotation *notes) in annotation__get_mutex() argument
1415 return sharded_mutex__get_mutex(sharded_mutex, annotation__hash(notes)); in annotation__get_mutex()
1418 void annotation__lock(struct annotation *notes) in annotation__lock() argument
1421 struct mutex *mutex = annotation__get_mutex(notes); in annotation__lock()
1427 void annotation__unlock(struct annotation *notes) in annotation__unlock() argument
1430 struct mutex *mutex = annotation__get_mutex(notes); in annotation__unlock()
1436 bool annotation__trylock(struct annotation *notes) in annotation__trylock() argument
1438 struct mutex *mutex = annotation__get_mutex(notes); in annotation__trylock()
1570 struct annotation *notes = symbol__annotation(sym); in annotation_line__print() local
1592 list_for_each_entry_from(queue, &notes->src->source, node) { in annotation_line__print()
1682 struct annotation *notes = symbol__annotation(sym); in symbol__parse_objdump_line() local
1739 annotation_line__add(&dl->al, &notes->src->source); in symbol__parse_objdump_line()
1750 struct annotation *notes = symbol__annotation(sym); in delete_last_nop() local
1751 struct list_head *list = &notes->src->source; in delete_last_nop()
1909 struct annotation *notes = symbol__annotation(sym); in symbol__disassemble_bpf() local
2028 &notes->src->source); in symbol__disassemble_bpf()
2039 annotation_line__add(&dl->al, &notes->src->source); in symbol__disassemble_bpf()
2064 struct annotation *notes = symbol__annotation(sym); in symbol__disassemble_bpf_image() local
2073 annotation_line__add(&dl->al, &notes->src->source); in symbol__disassemble_bpf_image()
2354 static void annotation__calc_percent(struct annotation *notes, in annotation__calc_percent() argument
2360 list_for_each_entry(al, &notes->src->source, node) { in annotation__calc_percent()
2367 next = annotation_line__next(al, &notes->src->source); in annotation__calc_percent()
2377 sym_hist = annotation__histogram(notes, evsel->core.idx); in annotation__calc_percent()
2387 struct annotation *notes = symbol__annotation(sym); in symbol__calc_percent() local
2389 annotation__calc_percent(notes, evsel, symbol__size(sym)); in symbol__calc_percent()
2423 struct annotation *notes = symbol__annotation(sym); in symbol__annotate() local
2441 notes->start = map__objdump_2mem(ms->map, ms->sym->start); in symbol__annotate()
2443 notes->start = map__rip_2objdump(ms->map, ms->sym->start); in symbol__annotate()
2575 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_hits() local
2576 struct sym_hist *h = annotation__histogram(notes, evsel->core.idx); in symbol__annotate_hits()
2607 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_printf() local
2608 struct sym_hist *h = annotation__histogram(notes, evsel->core.idx); in symbol__annotate_printf()
2650 addr_fmt_width = annotated_source__addr_fmt_width(&notes->src->source, start); in symbol__annotate_printf()
2652 list_for_each_entry(pos, &notes->src->source, node) { in symbol__annotate_printf()
2741 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_fprintf2() local
2753 list_for_each_entry(al, &notes->src->source, node) { in symbol__annotate_fprintf2()
2756 annotation_line__write(al, notes, &wops); in symbol__annotate_fprintf2()
2797 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_zero_histogram() local
2798 struct sym_hist *h = annotation__histogram(notes, evidx); in symbol__annotate_zero_histogram()
2800 memset(h, 0, notes->src->sizeof_sym_hist); in symbol__annotate_zero_histogram()
2805 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_decay_histogram() local
2806 struct sym_hist *h = annotation__histogram(notes, evidx); in symbol__annotate_decay_histogram()
2864 void annotation__mark_jump_targets(struct annotation *notes, struct symbol *sym) in annotation__mark_jump_targets() argument
2873 struct annotation_line *al = notes->src->offsets[offset]; in annotation__mark_jump_targets()
2881 al = notes->src->offsets[dl->ops.target.offset]; in annotation__mark_jump_targets()
2890 if (++al->jump_sources > notes->max_jump_sources) in annotation__mark_jump_targets()
2891 notes->max_jump_sources = al->jump_sources; in annotation__mark_jump_targets()
2895 void annotation__set_offsets(struct annotation *notes, s64 size) in annotation__set_offsets() argument
2898 struct annotated_source *src = notes->src; in annotation__set_offsets()
2920 notes->src->offsets[al->offset] = al; in annotation__set_offsets()
2935 static int annotation__max_ins_name(struct annotation *notes) in annotation__max_ins_name() argument
2940 list_for_each_entry(al, &notes->src->source, node) { in annotation__max_ins_name()
2952 void annotation__init_column_widths(struct annotation *notes, struct symbol *sym) in annotation__init_column_widths() argument
2954 notes->widths.addr = notes->widths.target = in annotation__init_column_widths()
2955 notes->widths.min_addr = hex_width(symbol__size(sym)); in annotation__init_column_widths()
2956 notes->widths.max_addr = hex_width(sym->end); in annotation__init_column_widths()
2957 notes->widths.jumps = width_jumps(notes->max_jump_sources); in annotation__init_column_widths()
2958 notes->widths.max_ins_name = annotation__max_ins_name(notes); in annotation__init_column_widths()
2961 void annotation__update_column_widths(struct annotation *notes) in annotation__update_column_widths() argument
2964 notes->widths.target = notes->widths.min_addr; in annotation__update_column_widths()
2966 notes->widths.target = BITS_PER_LONG / 4; in annotation__update_column_widths()
2968 notes->widths.target = notes->widths.max_addr; in annotation__update_column_widths()
2970 notes->widths.addr = notes->widths.target; in annotation__update_column_widths()
2973 notes->widths.addr += notes->widths.jumps + 1; in annotation__update_column_widths()
2976 void annotation__toggle_full_addr(struct annotation *notes, struct map_symbol *ms) in annotation__toggle_full_addr() argument
2981 notes->start = map__objdump_2mem(ms->map, ms->sym->start); in annotation__toggle_full_addr()
2983 notes->start = map__rip_2objdump(ms->map, ms->sym->start); in annotation__toggle_full_addr()
2985 annotation__update_column_widths(notes); in annotation__toggle_full_addr()
2988 static void annotation__calc_lines(struct annotation *notes, struct map *map, in annotation__calc_lines() argument
2994 list_for_each_entry(al, &notes->src->source, node) { in annotation__calc_lines()
3011 al->path = get_srcline(map__dso(map), notes->start + al->offset, NULL, in annotation__calc_lines()
3012 false, true, notes->start + al->offset); in annotation__calc_lines()
3021 struct annotation *notes = symbol__annotation(ms->sym); in symbol__calc_lines() local
3023 annotation__calc_lines(notes, ms->map, root); in symbol__calc_lines()
3101 struct annotation *notes, in annotation_line__max_percent() argument
3107 for (i = 0; i < notes->nr_events; i++) { in annotation_line__max_percent()
3120 static void disasm_line__write(struct disasm_line *dl, struct annotation *notes, in disasm_line__write() argument
3148 disasm_line__scnprintf(dl, bf, size, !annotate_opts.use_offset, notes->widths.max_ins_name); in disasm_line__write()
3151 static void ipc_coverage_string(char *bf, int size, struct annotation *notes) in ipc_coverage_string() argument
3154 struct annotated_branch *branch = annotation__get_branch(notes); in ipc_coverage_string()
3168 static void __annotation_line__write(struct annotation_line *al, struct annotation *notes, in __annotation_line__write() argument
3178 double percent_max = annotation_line__max_percent(al, notes, percent_type); in __annotation_line__write()
3179 int pcnt_width = annotation__pcnt_width(notes), in __annotation_line__write()
3180 cycles_width = annotation__cycles_width(notes); in __annotation_line__write()
3186 if (notes->branch && al->cycles) { in __annotation_line__write()
3196 for (i = 0; i < notes->nr_events; i++) { in __annotation_line__write()
3223 if (notes->branch) { in __annotation_line__write()
3265 ipc_coverage_string(bf, sizeof(bf), notes); in __annotation_line__write()
3276 printed = scnprintf(bf, sizeof(bf), "%-*d ", notes->widths.addr + 1, al->line_nr); in __annotation_line__write()
3278 printed = scnprintf(bf, sizeof(bf), "%-*s ", notes->widths.addr, " "); in __annotation_line__write()
3286 addr += notes->start; in __annotation_line__write()
3296 notes->widths.jumps, in __annotation_line__write()
3305 notes->widths.target, addr); in __annotation_line__write()
3313 notes->widths.addr, " "); in __annotation_line__write()
3323 disasm_line__write(disasm_line(al), notes, obj, bf, sizeof(bf), obj__printf, obj__write_graph); in __annotation_line__write()
3330 void annotation_line__write(struct annotation_line *al, struct annotation *notes, in annotation_line__write() argument
3333 __annotation_line__write(al, notes, wops->first_line, wops->current_entry, in annotation_line__write()
3345 struct annotation *notes = symbol__annotation(sym); in symbol__annotate2() local
3349 notes->src->offsets = zalloc(size * sizeof(struct annotation_line *)); in symbol__annotate2()
3350 if (notes->src->offsets == NULL) in symbol__annotate2()
3362 annotation__set_offsets(notes, size); in symbol__annotate2()
3363 annotation__mark_jump_targets(notes, sym); in symbol__annotate2()
3365 err = annotation__compute_ipc(notes, size); in symbol__annotate2()
3369 annotation__init_column_widths(notes, sym); in symbol__annotate2()
3370 notes->nr_events = nr_pcnt; in symbol__annotate2()
3372 annotation__update_column_widths(notes); in symbol__annotate2()
3378 zfree(&notes->src->offsets); in symbol__annotate2()
3637 struct annotation *notes; in symbol__ensure_annotate() local
3639 notes = symbol__annotation(ms->sym); in symbol__ensure_annotate()
3640 if (!list_empty(&notes->src->source)) in symbol__ensure_annotate()
3647 list_for_each_entry_safe(dl, tmp_dl, &notes->src->source, al.node) { in symbol__ensure_annotate()
3658 struct annotation *notes; in find_disasm_line() local
3660 notes = symbol__annotation(sym); in find_disasm_line()
3662 list_for_each_entry(dl, &notes->src->source, al.node) { in find_disasm_line()