Lines Matching full:notes

6  * copyright notes.
148 struct annotation *notes = symbol__annotation(sym);
150 annotation__lock(notes);
151 if (notes->src != NULL) {
152 memset(notes->src->histograms, 0,
153 notes->src->nr_histograms * sizeof(*notes->src->histograms));
154 hashmap__clear(notes->src->samples);
156 if (notes->branch && notes->branch->cycles_hist) {
157 memset(notes->branch->cycles_hist, 0,
160 annotation__unlock(notes);
262 struct annotated_branch *annotation__get_branch(struct annotation *notes)
264 if (notes == NULL)
267 if (notes->branch == NULL)
268 notes->branch = zalloc(sizeof(*notes->branch));
270 return notes->branch;
276 struct annotation *notes = symbol__annotation(sym);
280 branch = annotation__get_branch(notes);
301 struct annotation *notes = symbol__annotation(sym);
303 if (notes->src == NULL) {
304 notes->src = annotated_source__new();
305 if (notes->src == NULL)
310 if (notes->src->histograms == NULL) {
312 annotated_source__alloc_histograms(notes->src, nr_hists);
315 return notes->src;
440 static unsigned annotation__count_insn(struct annotation *notes, u64 start, u64 end)
445 al = annotated_source__get_line(notes->src, start);
449 list_for_each_entry_from(al, &notes->src->source, node) {
468 static void annotation__count_and_fill(struct annotation *notes, u64 start, u64 end, struct cyc_hist *ch)
473 n_insn = annotation__count_insn(notes, start, end);
483 al = annotated_source__get_line(notes->src, start);
487 list_for_each_entry_from(al, &notes->src->source, node) {
498 branch = annotation__get_branch(notes);
507 static int annotation__compute_ipc(struct annotation *notes, size_t size,
514 if (!notes->branch || !notes->branch->cycles_hist)
517 notes->branch->total_insn = annotation__count_insn(notes, 0, size - 1);
518 notes->branch->hit_cycles = 0;
519 notes->branch->hit_insn = 0;
520 notes->branch->cover_insn = 0;
522 annotation__lock(notes);
526 ch = &notes->branch->cycles_hist[offset];
530 al = annotated_source__get_line(notes->src, offset);
539 annotation__count_and_fill(notes, ch->start, offset, ch);
545 if (al && notes->branch->br_cntr) {
556 memcpy(al->br_cntr, &notes->branch->br_cntr[offset * br_cntr_nr],
564 struct cyc_hist *ch = &notes->branch->cycles_hist[offset];
569 al = annotated_source__get_line(notes->src, offset);
578 annotation__unlock(notes);
595 void annotation__exit(struct annotation *notes)
597 annotated_source__delete(notes->src);
598 annotated_branch__delete(notes->branch);
609 static size_t annotation__hash(const struct annotation *notes)
611 return (size_t)notes;
614 static struct mutex *annotation__get_mutex(const struct annotation *notes)
622 return sharded_mutex__get_mutex(sharded_mutex, annotation__hash(notes));
625 void annotation__lock(struct annotation *notes)
628 struct mutex *mutex = annotation__get_mutex(notes);
634 void annotation__unlock(struct annotation *notes)
637 struct mutex *mutex = annotation__get_mutex(notes);
643 bool annotation__trylock(struct annotation *notes)
645 struct mutex *mutex = annotation__get_mutex(notes);
784 struct annotation *notes = symbol__annotation(sym);
819 list_for_each_entry_from(queue, &notes->src->source, node) {
890 int width = annotation__pcnt_width(notes);
905 static void calc_percent(struct annotation *notes,
911 struct sym_hist *sym_hist = annotation__histogram(notes, evsel);
918 entry = annotated_source__hist_entry(notes->src, evsel, offset);
942 static void annotation__calc_percent(struct annotation *notes,
948 list_for_each_entry(al, &notes->src->source, node) {
955 next = annotation_line__next(al, &notes->src->source);
969 calc_percent(notes, evsel, data, al->offset, end);
976 struct annotation *notes = symbol__annotation(sym);
978 annotation__calc_percent(notes, evsel, symbol__size(sym));
1014 struct annotation *notes = symbol__annotation(sym);
1029 if (notes->src && !list_empty(&notes->src->source))
1035 if (notes->src == NULL) {
1036 notes->src = annotated_source__new();
1037 if (notes->src == NULL)
1052 notes->src->nr_events = nr ? nr : 1;
1055 notes->src->start = map__objdump_2mem(ms->map, ms->sym->start);
1057 notes->src->start = map__rip_2objdump(ms->map, ms->sym->start);
1189 struct annotation *notes = symbol__annotation(sym);
1190 struct sym_hist *h = annotation__histogram(notes, evsel);
1196 entry = annotated_source__hist_entry(notes->src, evsel, offset);
1226 struct annotation *notes = symbol__annotation(sym);
1227 struct sym_hist *h = annotation__histogram(notes, evsel);
1238 int width = annotation__pcnt_width(notes);
1269 apd.addr_fmt_width = annotated_source__addr_fmt_width(&notes->src->source,
1274 list_for_each_entry(pos, &notes->src->source, node) {
1362 struct annotation *notes = symbol__annotation(sym);
1374 list_for_each_entry(al, &notes->src->source, node) {
1377 annotation_line__write(al, notes, &wops);
1418 struct annotation *notes = symbol__annotation(sym);
1419 struct sym_hist *h = annotation__histogram(notes, evsel);
1421 memset(h, 0, sizeof(*notes->src->histograms) * notes->src->nr_histograms);
1426 struct annotation *notes = symbol__annotation(sym);
1427 struct sym_hist *h = annotation__histogram(notes, evsel);
1431 list_for_each_entry(al, &notes->src->source, node) {
1437 entry = annotated_source__hist_entry(notes->src, evsel, al->offset);
1495 annotation__mark_jump_targets(struct annotation *notes, struct symbol *sym)
1503 list_for_each_entry(al, &notes->src->source, node) {
1512 target = annotated_source__get_line(notes->src,
1521 if (++target->jump_sources > notes->src->max_jump_sources)
1522 notes->src->max_jump_sources = target->jump_sources;
1526 static void annotation__set_index(struct annotation *notes)
1529 struct annotated_source *src = notes->src;
1557 static int annotation__max_ins_name(struct annotation *notes)
1562 list_for_each_entry(al, &notes->src->source, node) {
1575 annotation__init_column_widths(struct annotation *notes, struct symbol *sym)
1577 notes->src->widths.addr = notes->src->widths.target =
1578 notes->src->widths.min_addr = hex_width(symbol__size(sym));
1579 notes->src->widths.max_addr = hex_width(sym->end);
1580 notes->src->widths.jumps = width_jumps(notes->src->max_jump_sources);
1581 notes->src->widths.max_ins_name = annotation__max_ins_name(notes);
1584 void annotation__update_column_widths(struct annotation *notes)
1587 notes->src->widths.target = notes->src->widths.min_addr;
1589 notes->src->widths.target = BITS_PER_LONG / 4;
1591 notes->src->widths.target = notes->src->widths.max_addr;
1593 notes->src->widths.addr = notes->src->widths.target;
1596 notes->src->widths.addr += notes->src->widths.jumps + 1;
1599 void annotation__toggle_full_addr(struct annotation *notes, struct map_symbol *ms)
1604 notes->src->start = map__objdump_2mem(ms->map, ms->sym->start);
1606 notes->src->start = map__rip_2objdump(ms->map, ms->sym->start);
1608 annotation__update_column_widths(notes);
1611 static void annotation__calc_lines(struct annotation *notes, struct map_symbol *ms,
1617 list_for_each_entry(al, &notes->src->source, node) {
1646 struct annotation *notes = symbol__annotation(ms->sym);
1648 annotation__calc_lines(notes, ms, root);
1745 static void disasm_line__write(struct disasm_line *dl, struct annotation *notes,
1774 notes->src->widths.max_ins_name);
1777 static void ipc_coverage_string(char *bf, int size, struct annotation *notes)
1780 struct annotated_branch *branch = annotation__get_branch(notes);
1937 static void __annotation_line__write(struct annotation_line *al, struct annotation *notes,
1948 int pcnt_width = annotation__pcnt_width(notes),
1949 cycles_width = annotation__cycles_width(notes);
1955 if (notes->branch && al->cycles) {
1992 if (notes->branch) {
2050 ipc_coverage_string(bf, sizeof(bf), notes);
2062 notes->src->widths.addr + 1, al->line_nr);
2065 notes->src->widths.addr, " ");
2073 addr += notes->src->start;
2083 notes->src->widths.jumps,
2092 notes->src->widths.target, addr);
2100 notes->src->widths.addr, " ");
2110 disasm_line__write(disasm_line(al), notes, obj, bf, sizeof(bf), obj__printf, obj__write_graph);
2117 void annotation_line__write(struct annotation_line *al, struct annotation *notes,
2120 __annotation_line__write(al, notes, wops->first_line, wops->current_entry,
2132 struct annotation *notes = symbol__annotation(sym);
2142 annotation__set_index(notes);
2143 annotation__mark_jump_targets(notes, sym);
2145 err = annotation__compute_ipc(notes, size, evsel);
2149 annotation__init_column_widths(notes, sym);
2150 annotation__update_column_widths(notes);
2548 struct annotation *notes;
2550 notes = symbol__annotation(sym);
2552 list_for_each_entry(dl, &notes->src->source, al.node) {
2622 annotation__prev_asm_line(struct annotation *notes, struct disasm_line *curr)
2624 struct list_head *sources = &notes->src->source;
2642 annotation__next_asm_line(struct annotation *notes, struct disasm_line *curr)
2644 struct list_head *sources = &notes->src->source;
2664 struct annotation *notes;
2668 notes = symbol__annotation(ms->sym);
2676 next = annotation__next_asm_line(notes, dl);
2864 struct annotation *notes;
2867 notes = symbol__annotation(ms->sym);
2868 prev_dl = annotation__prev_asm_line(notes, dl);
2967 struct annotation *notes = symbol__annotation(sym);
2975 last_dl = list_last_entry(&notes->src->source,
2978 last_dl = annotation__prev_asm_line(notes, last_dl);
2983 list_for_each_entry_from(dl, &notes->src->source, al.node) {
3016 next_dl = annotation__next_asm_line(notes, dl);