Lines Matching full:notes
6 * copyright notes.
809 struct annotation *notes = symbol__annotation(sym); in symbol__alloc_hist_cycles() local
812 notes->src->cycles_hist = calloc(size, sizeof(struct cyc_hist)); in symbol__alloc_hist_cycles()
813 if (notes->src->cycles_hist == NULL) in symbol__alloc_hist_cycles()
820 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_zero_histograms() local
822 pthread_mutex_lock(¬es->lock); in symbol__annotate_zero_histograms()
823 if (notes->src != NULL) { in symbol__annotate_zero_histograms()
824 memset(notes->src->histograms, 0, in symbol__annotate_zero_histograms()
825 notes->src->nr_histograms * notes->src->sizeof_sym_hist); in symbol__annotate_zero_histograms()
826 if (notes->src->cycles_hist) in symbol__annotate_zero_histograms()
827 memset(notes->src->cycles_hist, 0, in symbol__annotate_zero_histograms()
830 pthread_mutex_unlock(¬es->lock); in symbol__annotate_zero_histograms()
921 struct annotation *notes = symbol__annotation(sym); in symbol__cycles_hist() local
923 if (notes->src == NULL) { in symbol__cycles_hist()
924 notes->src = annotated_source__new(); in symbol__cycles_hist()
925 if (notes->src == NULL) in symbol__cycles_hist()
930 if (!notes->src->cycles_hist) { in symbol__cycles_hist()
935 return notes->src->cycles_hist; in symbol__cycles_hist()
940 struct annotation *notes = symbol__annotation(sym); in symbol__hists() local
942 if (notes->src == NULL) { in symbol__hists()
943 notes->src = annotated_source__new(); in symbol__hists()
944 if (notes->src == NULL) in symbol__hists()
949 if (notes->src->histograms == NULL) { in symbol__hists()
951 annotated_source__alloc_histograms(notes->src, symbol__size(sym), in symbol__hists()
955 return notes->src; in symbol__hists()
1032 static unsigned annotation__count_insn(struct annotation *notes, u64 start, u64 end) in annotation__count_insn() argument
1038 if (notes->offsets[offset]) in annotation__count_insn()
1044 static void annotation__count_and_fill(struct annotation *notes, u64 start, u64 end, struct cyc_his… in annotation__count_and_fill() argument
1050 n_insn = annotation__count_insn(notes, start, end); in annotation__count_and_fill()
1059 struct annotation_line *al = notes->offsets[offset]; in annotation__count_and_fill()
1068 notes->hit_cycles += ch->cycles; in annotation__count_and_fill()
1069 notes->hit_insn += n_insn * ch->num; in annotation__count_and_fill()
1070 notes->cover_insn += cover_insn; in annotation__count_and_fill()
1075 void annotation__compute_ipc(struct annotation *notes, size_t size) in annotation__compute_ipc() argument
1079 if (!notes->src || !notes->src->cycles_hist) in annotation__compute_ipc()
1082 notes->total_insn = annotation__count_insn(notes, 0, size - 1); in annotation__compute_ipc()
1083 notes->hit_cycles = 0; in annotation__compute_ipc()
1084 notes->hit_insn = 0; in annotation__compute_ipc()
1085 notes->cover_insn = 0; in annotation__compute_ipc()
1087 pthread_mutex_lock(¬es->lock); in annotation__compute_ipc()
1091 ch = ¬es->src->cycles_hist[offset]; in annotation__compute_ipc()
1096 annotation__count_and_fill(notes, ch->start, offset, ch); in annotation__compute_ipc()
1097 al = notes->offsets[offset]; in annotation__compute_ipc()
1103 notes->have_cycles = true; in annotation__compute_ipc()
1106 pthread_mutex_unlock(¬es->lock); in annotation__compute_ipc()
1379 struct annotation *notes = symbol__annotation(sym); in annotation_line__print() local
1401 list_for_each_entry_from(queue, ¬es->src->source, node) { in annotation_line__print()
1492 struct annotation *notes = symbol__annotation(sym); in symbol__parse_objdump_line() local
1546 annotation_line__add(&dl->al, ¬es->src->source); in symbol__parse_objdump_line()
1558 struct annotation *notes = symbol__annotation(sym); in delete_last_nop() local
1559 struct list_head *list = ¬es->src->source; in delete_last_nop()
1699 struct annotation *notes = symbol__annotation(sym); in symbol__disassemble_bpf() local
1818 ¬es->src->source); in symbol__disassemble_bpf()
1828 annotation_line__add(&dl->al, ¬es->src->source); in symbol__disassemble_bpf()
1853 struct annotation *notes = symbol__annotation(sym); in symbol__disassemble_bpf_image() local
1861 annotation_line__add(&dl->al, ¬es->src->source); in symbol__disassemble_bpf_image()
2137 static void annotation__calc_percent(struct annotation *notes, in annotation__calc_percent() argument
2143 list_for_each_entry(al, ¬es->src->source, node) { in annotation__calc_percent()
2150 next = annotation_line__next(al, ¬es->src->source); in annotation__calc_percent()
2160 sym_hist = annotation__histogram(notes, evsel->idx); in annotation__calc_percent()
2170 struct annotation *notes = symbol__annotation(sym); in symbol__calc_percent() local
2172 annotation__calc_percent(notes, evsel, symbol__size(sym)); in symbol__calc_percent()
2179 struct annotation *notes = symbol__annotation(sym); in symbol__annotate() local
2210 notes->start = map__rip_2objdump(ms->map, sym->start); in symbol__annotate()
2342 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_hits() local
2343 struct sym_hist *h = annotation__histogram(notes, evsel->idx); in symbol__annotate_hits()
2375 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_printf() local
2376 struct sym_hist *h = annotation__histogram(notes, evsel->idx); in symbol__annotate_printf()
2417 addr_fmt_width = annotated_source__addr_fmt_width(¬es->src->source, start); in symbol__annotate_printf()
2419 list_for_each_entry(pos, ¬es->src->source, node) { in symbol__annotate_printf()
2509 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_fprintf2() local
2521 list_for_each_entry(al, ¬es->src->source, node) { in symbol__annotate_fprintf2()
2522 if (annotation_line__filter(al, notes)) in symbol__annotate_fprintf2()
2524 annotation_line__write(al, notes, &wops, opts); in symbol__annotate_fprintf2()
2566 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_zero_histogram() local
2567 struct sym_hist *h = annotation__histogram(notes, evidx); in symbol__annotate_zero_histogram()
2569 memset(h, 0, notes->src->sizeof_sym_hist); in symbol__annotate_zero_histogram()
2574 struct annotation *notes = symbol__annotation(sym); in symbol__annotate_decay_histogram() local
2575 struct sym_hist *h = annotation__histogram(notes, evidx); in symbol__annotate_decay_histogram()
2633 void annotation__mark_jump_targets(struct annotation *notes, struct symbol *sym) in annotation__mark_jump_targets() argument
2642 struct annotation_line *al = notes->offsets[offset]; in annotation__mark_jump_targets()
2650 al = notes->offsets[dl->ops.target.offset]; in annotation__mark_jump_targets()
2659 if (++al->jump_sources > notes->max_jump_sources) in annotation__mark_jump_targets()
2660 notes->max_jump_sources = al->jump_sources; in annotation__mark_jump_targets()
2664 void annotation__set_offsets(struct annotation *notes, s64 size) in annotation__set_offsets() argument
2668 notes->max_line_len = 0; in annotation__set_offsets()
2669 notes->nr_entries = 0; in annotation__set_offsets()
2670 notes->nr_asm_entries = 0; in annotation__set_offsets()
2672 list_for_each_entry(al, ¬es->src->source, node) { in annotation__set_offsets()
2675 if (notes->max_line_len < line_len) in annotation__set_offsets()
2676 notes->max_line_len = line_len; in annotation__set_offsets()
2677 al->idx = notes->nr_entries++; in annotation__set_offsets()
2679 al->idx_asm = notes->nr_asm_entries++; in annotation__set_offsets()
2688 notes->offsets[al->offset] = al; in annotation__set_offsets()
2703 static int annotation__max_ins_name(struct annotation *notes) in annotation__max_ins_name() argument
2708 list_for_each_entry(al, ¬es->src->source, node) { in annotation__max_ins_name()
2720 void annotation__init_column_widths(struct annotation *notes, struct symbol *sym) in annotation__init_column_widths() argument
2722 notes->widths.addr = notes->widths.target = in annotation__init_column_widths()
2723 notes->widths.min_addr = hex_width(symbol__size(sym)); in annotation__init_column_widths()
2724 notes->widths.max_addr = hex_width(sym->end); in annotation__init_column_widths()
2725 notes->widths.jumps = width_jumps(notes->max_jump_sources); in annotation__init_column_widths()
2726 notes->widths.max_ins_name = annotation__max_ins_name(notes); in annotation__init_column_widths()
2729 void annotation__update_column_widths(struct annotation *notes) in annotation__update_column_widths() argument
2731 if (notes->options->use_offset) in annotation__update_column_widths()
2732 notes->widths.target = notes->widths.min_addr; in annotation__update_column_widths()
2734 notes->widths.target = notes->widths.max_addr; in annotation__update_column_widths()
2736 notes->widths.addr = notes->widths.target; in annotation__update_column_widths()
2738 if (notes->options->show_nr_jumps) in annotation__update_column_widths()
2739 notes->widths.addr += notes->widths.jumps + 1; in annotation__update_column_widths()
2742 static void annotation__calc_lines(struct annotation *notes, struct map *map, in annotation__calc_lines() argument
2749 list_for_each_entry(al, ¬es->src->source, node) { in annotation__calc_lines()
2766 al->path = get_srcline(map->dso, notes->start + al->offset, NULL, in annotation__calc_lines()
2767 false, true, notes->start + al->offset); in annotation__calc_lines()
2777 struct annotation *notes = symbol__annotation(ms->sym); in symbol__calc_lines() local
2779 annotation__calc_lines(notes, ms->map, root, opts); in symbol__calc_lines()
2842 struct annotation *notes, in annotation_line__max_percent() argument
2848 for (i = 0; i < notes->nr_events; i++) { in annotation_line__max_percent()
2861 static void disasm_line__write(struct disasm_line *dl, struct annotation *notes, in disasm_line__write() argument
2889 disasm_line__scnprintf(dl, bf, size, !notes->options->use_offset, notes->widths.max_ins_name); in disasm_line__write()
2892 static void ipc_coverage_string(char *bf, int size, struct annotation *notes) in ipc_coverage_string() argument
2896 if (notes->hit_cycles) in ipc_coverage_string()
2897 ipc = notes->hit_insn / ((double)notes->hit_cycles); in ipc_coverage_string()
2899 if (notes->total_insn) { in ipc_coverage_string()
2900 coverage = notes->cover_insn * 100.0 / in ipc_coverage_string()
2901 ((double)notes->total_insn); in ipc_coverage_string()
2908 static void __annotation_line__write(struct annotation_line *al, struct annotation *notes, in __annotation_line__write() argument
2918 double percent_max = annotation_line__max_percent(al, notes, percent_type); in __annotation_line__write()
2919 int pcnt_width = annotation__pcnt_width(notes), in __annotation_line__write()
2920 cycles_width = annotation__cycles_width(notes); in __annotation_line__write()
2926 if (notes->have_cycles) { in __annotation_line__write()
2936 for (i = 0; i < notes->nr_events; i++) { in __annotation_line__write()
2963 if (notes->have_cycles) { in __annotation_line__write()
2971 if (!notes->options->show_minmax_cycle) { in __annotation_line__write()
3005 ipc_coverage_string(bf, sizeof(bf), notes); in __annotation_line__write()
3015 if (al->line_nr && notes->options->show_linenr) in __annotation_line__write()
3016 printed = scnprintf(bf, sizeof(bf), "%-*d ", notes->widths.addr + 1, al->line_nr); in __annotation_line__write()
3018 printed = scnprintf(bf, sizeof(bf), "%-*s ", notes->widths.addr, " "); in __annotation_line__write()
3025 if (!notes->options->use_offset) in __annotation_line__write()
3026 addr += notes->start; in __annotation_line__write()
3028 if (!notes->options->use_offset) { in __annotation_line__write()
3032 notes->options->offset_level >= ANNOTATION__OFFSET_JUMP_TARGETS) { in __annotation_line__write()
3033 if (notes->options->show_nr_jumps) { in __annotation_line__write()
3036 notes->widths.jumps, in __annotation_line__write()
3045 notes->widths.target, addr); in __annotation_line__write()
3047 notes->options->offset_level >= ANNOTATION__OFFSET_CALL) { in __annotation_line__write()
3049 } else if (notes->options->offset_level == ANNOTATION__MAX_OFFSET_LEVEL) { in __annotation_line__write()
3053 notes->widths.addr, " "); in __annotation_line__write()
3063 disasm_line__write(disasm_line(al), notes, obj, bf, sizeof(bf), obj__printf, obj__write_graph); in __annotation_line__write()
3070 void annotation_line__write(struct annotation_line *al, struct annotation *notes, in annotation_line__write() argument
3074 __annotation_line__write(al, notes, wops->first_line, wops->current_entry, in annotation_line__write()
3086 struct annotation *notes = symbol__annotation(sym); in symbol__annotate2() local
3090 notes->offsets = zalloc(size * sizeof(struct annotation_line *)); in symbol__annotate2()
3091 if (notes->offsets == NULL) in symbol__annotate2()
3101 notes->options = options; in symbol__annotate2()
3105 annotation__set_offsets(notes, size); in symbol__annotate2()
3106 annotation__mark_jump_targets(notes, sym); in symbol__annotate2()
3107 annotation__compute_ipc(notes, size); in symbol__annotate2()
3108 annotation__init_column_widths(notes, sym); in symbol__annotate2()
3109 notes->nr_events = nr_pcnt; in symbol__annotate2()
3111 annotation__update_column_widths(notes); in symbol__annotate2()
3117 zfree(¬es->offsets); in symbol__annotate2()