Lines Matching full:notes

6  * copyright notes.
810 struct annotation *notes = symbol__annotation(sym); in symbol__alloc_hist_cycles() local
813 notes->src->cycles_hist = calloc(size, sizeof(struct cyc_hist)); in symbol__alloc_hist_cycles()
814 if (notes->src->cycles_hist == NULL) in symbol__alloc_hist_cycles()
821 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_zero_histograms() local
823 mutex_lock(&notes->lock); in symbol__annotate_zero_histograms()
824 if (notes->src != NULL) { in symbol__annotate_zero_histograms()
825 memset(notes->src->histograms, 0, in symbol__annotate_zero_histograms()
826 notes->src->nr_histograms * notes->src->sizeof_sym_hist); in symbol__annotate_zero_histograms()
827 if (notes->src->cycles_hist) in symbol__annotate_zero_histograms()
828 memset(notes->src->cycles_hist, 0, in symbol__annotate_zero_histograms()
831 mutex_unlock(&notes->lock); in symbol__annotate_zero_histograms()
922 struct annotation *notes = symbol__annotation(sym); in symbol__cycles_hist() local
924 if (notes->src == NULL) { in symbol__cycles_hist()
925 notes->src = annotated_source__new(); in symbol__cycles_hist()
926 if (notes->src == NULL) in symbol__cycles_hist()
931 if (!notes->src->cycles_hist) { in symbol__cycles_hist()
936 return notes->src->cycles_hist; in symbol__cycles_hist()
941 struct annotation *notes = symbol__annotation(sym); in symbol__hists() local
943 if (notes->src == NULL) { in symbol__hists()
944 notes->src = annotated_source__new(); in symbol__hists()
945 if (notes->src == NULL) in symbol__hists()
950 if (notes->src->histograms == NULL) { in symbol__hists()
952 annotated_source__alloc_histograms(notes->src, symbol__size(sym), in symbol__hists()
956 return notes->src; in symbol__hists()
1033 static unsigned annotation__count_insn(struct annotation *notes, u64 start, u64 end) in annotation__count_insn() argument
1039 if (notes->offsets[offset]) in annotation__count_insn()
1045 static void annotation__count_and_fill(struct annotation *notes, u64 start, u64 end, struct cyc_his… in annotation__count_and_fill() argument
1051 n_insn = annotation__count_insn(notes, start, end); in annotation__count_and_fill()
1060 struct annotation_line *al = notes->offsets[offset]; in annotation__count_and_fill()
1069 notes->hit_cycles += ch->cycles; in annotation__count_and_fill()
1070 notes->hit_insn += n_insn * ch->num; in annotation__count_and_fill()
1071 notes->cover_insn += cover_insn; in annotation__count_and_fill()
1076 void annotation__compute_ipc(struct annotation *notes, size_t size) in annotation__compute_ipc() argument
1080 if (!notes->src || !notes->src->cycles_hist) in annotation__compute_ipc()
1083 notes->total_insn = annotation__count_insn(notes, 0, size - 1); in annotation__compute_ipc()
1084 notes->hit_cycles = 0; in annotation__compute_ipc()
1085 notes->hit_insn = 0; in annotation__compute_ipc()
1086 notes->cover_insn = 0; in annotation__compute_ipc()
1088 mutex_lock(&notes->lock); in annotation__compute_ipc()
1092 ch = &notes->src->cycles_hist[offset]; in annotation__compute_ipc()
1097 annotation__count_and_fill(notes, ch->start, offset, ch); in annotation__compute_ipc()
1098 al = notes->offsets[offset]; in annotation__compute_ipc()
1104 notes->have_cycles = true; in annotation__compute_ipc()
1107 mutex_unlock(&notes->lock); in annotation__compute_ipc()
1258 void annotation__init(struct annotation *notes) in annotation__init() argument
1260 mutex_init(&notes->lock); in annotation__init()
1263 void annotation__exit(struct annotation *notes) in annotation__exit() argument
1265 annotated_source__delete(notes->src); in annotation__exit()
1266 mutex_destroy(&notes->lock); in annotation__exit()
1392 struct annotation *notes = symbol__annotation(sym); in annotation_line__print() local
1414 list_for_each_entry_from(queue, &notes->src->source, node) { in annotation_line__print()
1504 struct annotation *notes = symbol__annotation(sym); in symbol__parse_objdump_line() local
1560 annotation_line__add(&dl->al, &notes->src->source); in symbol__parse_objdump_line()
1572 struct annotation *notes = symbol__annotation(sym); in delete_last_nop() local
1573 struct list_head *list = &notes->src->source; in delete_last_nop()
1729 struct annotation *notes = symbol__annotation(sym); in symbol__disassemble_bpf() local
1845 &notes->src->source); in symbol__disassemble_bpf()
1856 annotation_line__add(&dl->al, &notes->src->source); in symbol__disassemble_bpf()
1881 struct annotation *notes = symbol__annotation(sym); in symbol__disassemble_bpf_image() local
1890 annotation_line__add(&dl->al, &notes->src->source); in symbol__disassemble_bpf_image()
2169 static void annotation__calc_percent(struct annotation *notes, in annotation__calc_percent() argument
2175 list_for_each_entry(al, &notes->src->source, node) { in annotation__calc_percent()
2182 next = annotation_line__next(al, &notes->src->source); in annotation__calc_percent()
2192 sym_hist = annotation__histogram(notes, evsel->core.idx); in annotation__calc_percent()
2202 struct annotation *notes = symbol__annotation(sym); in symbol__calc_percent() local
2204 annotation__calc_percent(notes, evsel, symbol__size(sym)); in symbol__calc_percent()
2211 struct annotation *notes = symbol__annotation(sym); in symbol__annotate() local
2242 if (notes->options && notes->options->full_addr) in symbol__annotate()
2243 notes->start = map__objdump_2mem(ms->map, ms->sym->start); in symbol__annotate()
2245 notes->start = map__rip_2objdump(ms->map, ms->sym->start); in symbol__annotate()
2377 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_hits() local
2378 struct sym_hist *h = annotation__histogram(notes, evsel->core.idx); in symbol__annotate_hits()
2410 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_printf() local
2411 struct sym_hist *h = annotation__histogram(notes, evsel->core.idx); in symbol__annotate_printf()
2452 addr_fmt_width = annotated_source__addr_fmt_width(&notes->src->source, start); in symbol__annotate_printf()
2454 list_for_each_entry(pos, &notes->src->source, node) { in symbol__annotate_printf()
2544 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_fprintf2() local
2556 list_for_each_entry(al, &notes->src->source, node) { in symbol__annotate_fprintf2()
2557 if (annotation_line__filter(al, notes)) in symbol__annotate_fprintf2()
2559 annotation_line__write(al, notes, &wops, opts); in symbol__annotate_fprintf2()
2601 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_zero_histogram() local
2602 struct sym_hist *h = annotation__histogram(notes, evidx); in symbol__annotate_zero_histogram()
2604 memset(h, 0, notes->src->sizeof_sym_hist); in symbol__annotate_zero_histogram()
2609 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_decay_histogram() local
2610 struct sym_hist *h = annotation__histogram(notes, evidx); in symbol__annotate_decay_histogram()
2668 void annotation__mark_jump_targets(struct annotation *notes, struct symbol *sym) in annotation__mark_jump_targets() argument
2677 struct annotation_line *al = notes->offsets[offset]; in annotation__mark_jump_targets()
2685 al = notes->offsets[dl->ops.target.offset]; in annotation__mark_jump_targets()
2694 if (++al->jump_sources > notes->max_jump_sources) in annotation__mark_jump_targets()
2695 notes->max_jump_sources = al->jump_sources; in annotation__mark_jump_targets()
2699 void annotation__set_offsets(struct annotation *notes, s64 size) in annotation__set_offsets() argument
2703 notes->max_line_len = 0; in annotation__set_offsets()
2704 notes->nr_entries = 0; in annotation__set_offsets()
2705 notes->nr_asm_entries = 0; in annotation__set_offsets()
2707 list_for_each_entry(al, &notes->src->source, node) { in annotation__set_offsets()
2710 if (notes->max_line_len < line_len) in annotation__set_offsets()
2711 notes->max_line_len = line_len; in annotation__set_offsets()
2712 al->idx = notes->nr_entries++; in annotation__set_offsets()
2714 al->idx_asm = notes->nr_asm_entries++; in annotation__set_offsets()
2723 notes->offsets[al->offset] = al; in annotation__set_offsets()
2738 static int annotation__max_ins_name(struct annotation *notes) in annotation__max_ins_name() argument
2743 list_for_each_entry(al, &notes->src->source, node) { in annotation__max_ins_name()
2755 void annotation__init_column_widths(struct annotation *notes, struct symbol *sym) in annotation__init_column_widths() argument
2757 notes->widths.addr = notes->widths.target = in annotation__init_column_widths()
2758 notes->widths.min_addr = hex_width(symbol__size(sym)); in annotation__init_column_widths()
2759 notes->widths.max_addr = hex_width(sym->end); in annotation__init_column_widths()
2760 notes->widths.jumps = width_jumps(notes->max_jump_sources); in annotation__init_column_widths()
2761 notes->widths.max_ins_name = annotation__max_ins_name(notes); in annotation__init_column_widths()
2764 void annotation__update_column_widths(struct annotation *notes) in annotation__update_column_widths() argument
2766 if (notes->options->use_offset) in annotation__update_column_widths()
2767 notes->widths.target = notes->widths.min_addr; in annotation__update_column_widths()
2768 else if (notes->options->full_addr) in annotation__update_column_widths()
2769 notes->widths.target = BITS_PER_LONG / 4; in annotation__update_column_widths()
2771 notes->widths.target = notes->widths.max_addr; in annotation__update_column_widths()
2773 notes->widths.addr = notes->widths.target; in annotation__update_column_widths()
2775 if (notes->options->show_nr_jumps) in annotation__update_column_widths()
2776 notes->widths.addr += notes->widths.jumps + 1; in annotation__update_column_widths()
2779 void annotation__toggle_full_addr(struct annotation *notes, struct map_symbol *ms) in annotation__toggle_full_addr() argument
2781 notes->options->full_addr = !notes->options->full_addr; in annotation__toggle_full_addr()
2783 if (notes->options->full_addr) in annotation__toggle_full_addr()
2784 notes->start = map__objdump_2mem(ms->map, ms->sym->start); in annotation__toggle_full_addr()
2786 notes->start = map__rip_2objdump(ms->map, ms->sym->start); in annotation__toggle_full_addr()
2788 annotation__update_column_widths(notes); in annotation__toggle_full_addr()
2791 static void annotation__calc_lines(struct annotation *notes, struct map *map, in annotation__calc_lines() argument
2798 list_for_each_entry(al, &notes->src->source, node) { in annotation__calc_lines()
2815 al->path = get_srcline(map->dso, notes->start + al->offset, NULL, in annotation__calc_lines()
2816 false, true, notes->start + al->offset); in annotation__calc_lines()
2826 struct annotation *notes = symbol__annotation(ms->sym); in symbol__calc_lines() local
2828 annotation__calc_lines(notes, ms->map, root, opts); in symbol__calc_lines()
2907 struct annotation *notes, in annotation_line__max_percent() argument
2913 for (i = 0; i < notes->nr_events; i++) { in annotation_line__max_percent()
2926 static void disasm_line__write(struct disasm_line *dl, struct annotation *notes, in disasm_line__write() argument
2954 disasm_line__scnprintf(dl, bf, size, !notes->options->use_offset, notes->widths.max_ins_name); in disasm_line__write()
2957 static void ipc_coverage_string(char *bf, int size, struct annotation *notes) in ipc_coverage_string() argument
2961 if (notes->hit_cycles) in ipc_coverage_string()
2962 ipc = notes->hit_insn / ((double)notes->hit_cycles); in ipc_coverage_string()
2964 if (notes->total_insn) { in ipc_coverage_string()
2965 coverage = notes->cover_insn * 100.0 / in ipc_coverage_string()
2966 ((double)notes->total_insn); in ipc_coverage_string()
2973 static void __annotation_line__write(struct annotation_line *al, struct annotation *notes, in __annotation_line__write() argument
2983 double percent_max = annotation_line__max_percent(al, notes, percent_type); in __annotation_line__write()
2984 int pcnt_width = annotation__pcnt_width(notes), in __annotation_line__write()
2985 cycles_width = annotation__cycles_width(notes); in __annotation_line__write()
2991 if (notes->have_cycles) { in __annotation_line__write()
3001 for (i = 0; i < notes->nr_events; i++) { in __annotation_line__write()
3028 if (notes->have_cycles) { in __annotation_line__write()
3036 if (!notes->options->show_minmax_cycle) { in __annotation_line__write()
3070 ipc_coverage_string(bf, sizeof(bf), notes); in __annotation_line__write()
3080 if (al->line_nr && notes->options->show_linenr) in __annotation_line__write()
3081 printed = scnprintf(bf, sizeof(bf), "%-*d ", notes->widths.addr + 1, al->line_nr); in __annotation_line__write()
3083 printed = scnprintf(bf, sizeof(bf), "%-*s ", notes->widths.addr, " "); in __annotation_line__write()
3090 if (!notes->options->use_offset) in __annotation_line__write()
3091 addr += notes->start; in __annotation_line__write()
3093 if (!notes->options->use_offset) { in __annotation_line__write()
3097 notes->options->offset_level >= ANNOTATION__OFFSET_JUMP_TARGETS) { in __annotation_line__write()
3098 if (notes->options->show_nr_jumps) { in __annotation_line__write()
3101 notes->widths.jumps, in __annotation_line__write()
3110 notes->widths.target, addr); in __annotation_line__write()
3112 notes->options->offset_level >= ANNOTATION__OFFSET_CALL) { in __annotation_line__write()
3114 } else if (notes->options->offset_level == ANNOTATION__MAX_OFFSET_LEVEL) { in __annotation_line__write()
3118 notes->widths.addr, " "); in __annotation_line__write()
3128 disasm_line__write(disasm_line(al), notes, obj, bf, sizeof(bf), obj__printf, obj__write_graph); in __annotation_line__write()
3135 void annotation_line__write(struct annotation_line *al, struct annotation *notes, in annotation_line__write() argument
3139 __annotation_line__write(al, notes, wops->first_line, wops->current_entry, in annotation_line__write()
3151 struct annotation *notes = symbol__annotation(sym); in symbol__annotate2() local
3155 notes->offsets = zalloc(size * sizeof(struct annotation_line *)); in symbol__annotate2()
3156 if (notes->offsets == NULL) in symbol__annotate2()
3166 notes->options = options; in symbol__annotate2()
3170 annotation__set_offsets(notes, size); in symbol__annotate2()
3171 annotation__mark_jump_targets(notes, sym); in symbol__annotate2()
3172 annotation__compute_ipc(notes, size); in symbol__annotate2()
3173 annotation__init_column_widths(notes, sym); in symbol__annotate2()
3174 notes->nr_events = nr_pcnt; in symbol__annotate2()
3176 annotation__update_column_widths(notes); in symbol__annotate2()
3182 zfree(&notes->offsets); in symbol__annotate2()