Lines Matching refs:notes

6  * copyright notes.
146 struct annotation *notes = symbol__annotation(sym);
148 annotation__lock(notes);
149 if (notes->src != NULL) {
150 memset(notes->src->histograms, 0,
151 notes->src->nr_histograms * sizeof(*notes->src->histograms));
152 hashmap__clear(notes->src->samples);
154 if (notes->branch && notes->branch->cycles_hist) {
155 memset(notes->branch->cycles_hist, 0,
158 annotation__unlock(notes);
260 struct annotated_branch *annotation__get_branch(struct annotation *notes)
262 if (notes == NULL)
265 if (notes->branch == NULL)
266 notes->branch = zalloc(sizeof(*notes->branch));
268 return notes->branch;
274 struct annotation *notes = symbol__annotation(sym);
278 branch = annotation__get_branch(notes);
299 struct annotation *notes = symbol__annotation(sym);
301 if (notes->src == NULL) {
302 notes->src = annotated_source__new();
303 if (notes->src == NULL)
308 if (notes->src->histograms == NULL) {
310 annotated_source__alloc_histograms(notes->src, nr_hists);
313 return notes->src;
438 static unsigned annotation__count_insn(struct annotation *notes, u64 start, u64 end)
443 al = annotated_source__get_line(notes->src, start);
447 list_for_each_entry_from(al, &notes->src->source, node) {
466 static void annotation__count_and_fill(struct annotation *notes, u64 start, u64 end, struct cyc_hist *ch)
471 n_insn = annotation__count_insn(notes, start, end);
481 al = annotated_source__get_line(notes->src, start);
485 list_for_each_entry_from(al, &notes->src->source, node) {
496 branch = annotation__get_branch(notes);
505 static int annotation__compute_ipc(struct annotation *notes, size_t size,
512 if (!notes->branch || !notes->branch->cycles_hist)
515 notes->branch->total_insn = annotation__count_insn(notes, 0, size - 1);
516 notes->branch->hit_cycles = 0;
517 notes->branch->hit_insn = 0;
518 notes->branch->cover_insn = 0;
520 annotation__lock(notes);
524 ch = &notes->branch->cycles_hist[offset];
528 al = annotated_source__get_line(notes->src, offset);
537 annotation__count_and_fill(notes, ch->start, offset, ch);
543 if (al && notes->branch->br_cntr) {
554 memcpy(al->br_cntr, &notes->branch->br_cntr[offset * br_cntr_nr],
562 struct cyc_hist *ch = &notes->branch->cycles_hist[offset];
567 al = annotated_source__get_line(notes->src, offset);
576 annotation__unlock(notes);
593 void annotation__exit(struct annotation *notes)
595 annotated_source__delete(notes->src);
596 annotated_branch__delete(notes->branch);
607 static size_t annotation__hash(const struct annotation *notes)
609 return (size_t)notes;
612 static struct mutex *annotation__get_mutex(const struct annotation *notes)
620 return sharded_mutex__get_mutex(sharded_mutex, annotation__hash(notes));
623 void annotation__lock(struct annotation *notes)
626 struct mutex *mutex = annotation__get_mutex(notes);
632 void annotation__unlock(struct annotation *notes)
635 struct mutex *mutex = annotation__get_mutex(notes);
641 bool annotation__trylock(struct annotation *notes)
643 struct mutex *mutex = annotation__get_mutex(notes);
768 struct annotation *notes = symbol__annotation(sym);
796 list_for_each_entry_from(queue, &notes->src->source, node) {
844 int width = annotation__pcnt_width(notes);
858 static void calc_percent(struct annotation *notes,
865 struct sym_hist *sym_hist = annotation__histogram(notes, evidx);
872 entry = annotated_source__hist_entry(notes->src, evidx, offset);
896 static void annotation__calc_percent(struct annotation *notes,
902 list_for_each_entry(al, &notes->src->source, node) {
909 next = annotation_line__next(al, &notes->src->source);
923 calc_percent(notes, evsel, data, al->offset, end);
930 struct annotation *notes = symbol__annotation(sym);
932 annotation__calc_percent(notes, evsel, symbol__size(sym));
968 struct annotation *notes = symbol__annotation(sym);
983 if (notes->src && !list_empty(&notes->src->source))
989 if (notes->src == NULL) {
990 notes->src = annotated_source__new();
991 if (notes->src == NULL)
1006 notes->src->nr_events = nr ? nr : 1;
1009 notes->src->start = map__objdump_2mem(ms->map, ms->sym->start);
1011 notes->src->start = map__rip_2objdump(ms->map, ms->sym->start);
1144 struct annotation *notes = symbol__annotation(sym);
1145 struct sym_hist *h = annotation__histogram(notes, evidx);
1151 entry = annotated_source__hist_entry(notes->src, evidx, offset);
1180 struct annotation *notes = symbol__annotation(sym);
1181 struct sym_hist *h = annotation__histogram(notes, evsel->core.idx);
1189 int width = annotation__pcnt_width(notes);
1222 addr_fmt_width = annotated_source__addr_fmt_width(&notes->src->source, start);
1224 list_for_each_entry(pos, &notes->src->source, node) {
1313 struct annotation *notes = symbol__annotation(sym);
1325 list_for_each_entry(al, &notes->src->source, node) {
1328 annotation_line__write(al, notes, &wops);
1369 struct annotation *notes = symbol__annotation(sym);
1370 struct sym_hist *h = annotation__histogram(notes, evidx);
1372 memset(h, 0, sizeof(*notes->src->histograms) * notes->src->nr_histograms);
1377 struct annotation *notes = symbol__annotation(sym);
1378 struct sym_hist *h = annotation__histogram(notes, evidx);
1382 list_for_each_entry(al, &notes->src->source, node) {
1388 entry = annotated_source__hist_entry(notes->src, evidx, al->offset);
1446 annotation__mark_jump_targets(struct annotation *notes, struct symbol *sym)
1454 list_for_each_entry(al, &notes->src->source, node) {
1463 target = annotated_source__get_line(notes->src,
1472 if (++target->jump_sources > notes->src->max_jump_sources)
1473 notes->src->max_jump_sources = target->jump_sources;
1477 static void annotation__set_index(struct annotation *notes)
1480 struct annotated_source *src = notes->src;
1508 static int annotation__max_ins_name(struct annotation *notes)
1513 list_for_each_entry(al, &notes->src->source, node) {
1526 annotation__init_column_widths(struct annotation *notes, struct symbol *sym)
1528 notes->src->widths.addr = notes->src->widths.target =
1529 notes->src->widths.min_addr = hex_width(symbol__size(sym));
1530 notes->src->widths.max_addr = hex_width(sym->end);
1531 notes->src->widths.jumps = width_jumps(notes->src->max_jump_sources);
1532 notes->src->widths.max_ins_name = annotation__max_ins_name(notes);
1535 void annotation__update_column_widths(struct annotation *notes)
1538 notes->src->widths.target = notes->src->widths.min_addr;
1540 notes->src->widths.target = BITS_PER_LONG / 4;
1542 notes->src->widths.target = notes->src->widths.max_addr;
1544 notes->src->widths.addr = notes->src->widths.target;
1547 notes->src->widths.addr += notes->src->widths.jumps + 1;
1550 void annotation__toggle_full_addr(struct annotation *notes, struct map_symbol *ms)
1555 notes->src->start = map__objdump_2mem(ms->map, ms->sym->start);
1557 notes->src->start = map__rip_2objdump(ms->map, ms->sym->start);
1559 annotation__update_column_widths(notes);
1562 static void annotation__calc_lines(struct annotation *notes, struct map_symbol *ms,
1568 list_for_each_entry(al, &notes->src->source, node) {
1597 struct annotation *notes = symbol__annotation(ms->sym);
1599 annotation__calc_lines(notes, ms, root);
1694 static void disasm_line__write(struct disasm_line *dl, struct annotation *notes,
1723 notes->src->widths.max_ins_name);
1726 static void ipc_coverage_string(char *bf, int size, struct annotation *notes)
1729 struct annotated_branch *branch = annotation__get_branch(notes);
1886 static void __annotation_line__write(struct annotation_line *al, struct annotation *notes,
1897 int pcnt_width = annotation__pcnt_width(notes),
1898 cycles_width = annotation__cycles_width(notes);
1904 if (notes->branch && al->cycles) {
1941 if (notes->branch) {
1999 ipc_coverage_string(bf, sizeof(bf), notes);
2011 notes->src->widths.addr + 1, al->line_nr);
2014 notes->src->widths.addr, " ");
2022 addr += notes->src->start;
2032 notes->src->widths.jumps,
2041 notes->src->widths.target, addr);
2049 notes->src->widths.addr, " ");
2059 disasm_line__write(disasm_line(al), notes, obj, bf, sizeof(bf), obj__printf, obj__write_graph);
2066 void annotation_line__write(struct annotation_line *al, struct annotation *notes,
2069 __annotation_line__write(al, notes, wops->first_line, wops->current_entry,
2081 struct annotation *notes = symbol__annotation(sym);
2091 annotation__set_index(notes);
2092 annotation__mark_jump_targets(notes, sym);
2094 err = annotation__compute_ipc(notes, size, evsel);
2098 annotation__init_column_widths(notes, sym);
2099 annotation__update_column_widths(notes);
2431 struct annotation *notes;
2433 notes = symbol__annotation(sym);
2435 list_for_each_entry(dl, &notes->src->source, al.node) {
2505 annotation__prev_asm_line(struct annotation *notes, struct disasm_line *curr)
2507 struct list_head *sources = &notes->src->source;
2525 annotation__next_asm_line(struct annotation *notes, struct disasm_line *curr)
2527 struct list_head *sources = &notes->src->source;
2547 struct annotation *notes;
2551 notes = symbol__annotation(ms->sym);
2559 next = annotation__next_asm_line(notes, dl);
2731 struct annotation *notes;
2734 notes = symbol__annotation(ms->sym);
2735 prev_dl = annotation__prev_asm_line(notes, dl);
2832 struct annotation *notes = symbol__annotation(sym);
2840 last_dl = list_last_entry(&notes->src->source,
2843 last_dl = annotation__prev_asm_line(notes, last_dl);
2848 list_for_each_entry_from(dl, &notes->src->source, al.node) {
2881 next_dl = annotation__next_asm_line(notes, dl);