aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/annotate.h')
-rw-r--r--tools/perf/util/annotate.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h
index 21055034aedd..f6ba3560de5e 100644
--- a/tools/perf/util/annotate.h
+++ b/tools/perf/util/annotate.h
@@ -1,3 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0 */
1#ifndef __PERF_ANNOTATE_H 2#ifndef __PERF_ANNOTATE_H
2#define __PERF_ANNOTATE_H 3#define __PERF_ANNOTATE_H
3 4
@@ -52,7 +53,9 @@ struct ins_ops {
52bool ins__is_jump(const struct ins *ins); 53bool ins__is_jump(const struct ins *ins);
53bool ins__is_call(const struct ins *ins); 54bool ins__is_call(const struct ins *ins);
54bool ins__is_ret(const struct ins *ins); 55bool ins__is_ret(const struct ins *ins);
56bool ins__is_lock(const struct ins *ins);
55int ins__scnprintf(struct ins *ins, char *bf, size_t size, struct ins_operands *ops); 57int ins__scnprintf(struct ins *ins, char *bf, size_t size, struct ins_operands *ops);
58bool ins__is_fused(struct arch *arch, const char *ins1, const char *ins2);
56 59
57struct annotation; 60struct annotation;
58 61
@@ -72,16 +75,22 @@ static inline bool disasm_line__has_offset(const struct disasm_line *dl)
72 return dl->ops.target.offset_avail; 75 return dl->ops.target.offset_avail;
73} 76}
74 77
78struct sym_hist_entry {
79 u64 nr_samples;
80 u64 period;
81};
82
75void disasm_line__free(struct disasm_line *dl); 83void disasm_line__free(struct disasm_line *dl);
76struct disasm_line *disasm__get_next_ip_line(struct list_head *head, struct disasm_line *pos); 84struct disasm_line *disasm__get_next_ip_line(struct list_head *head, struct disasm_line *pos);
77int disasm_line__scnprintf(struct disasm_line *dl, char *bf, size_t size, bool raw); 85int disasm_line__scnprintf(struct disasm_line *dl, char *bf, size_t size, bool raw);
78size_t disasm__fprintf(struct list_head *head, FILE *fp); 86size_t disasm__fprintf(struct list_head *head, FILE *fp);
79double disasm__calc_percent(struct annotation *notes, int evidx, s64 offset, 87double disasm__calc_percent(struct annotation *notes, int evidx, s64 offset,
80 s64 end, const char **path, u64 *nr_samples); 88 s64 end, const char **path, struct sym_hist_entry *sample);
81 89
82struct sym_hist { 90struct sym_hist {
83 u64 sum; 91 u64 nr_samples;
84 u64 addr[0]; 92 u64 period;
93 struct sym_hist_entry addr[0];
85}; 94};
86 95
87struct cyc_hist { 96struct cyc_hist {
@@ -147,20 +156,22 @@ static inline struct annotation *symbol__annotation(struct symbol *sym)
147 return (void *)sym - symbol_conf.priv_size; 156 return (void *)sym - symbol_conf.priv_size;
148} 157}
149 158
150int addr_map_symbol__inc_samples(struct addr_map_symbol *ams, int evidx); 159int addr_map_symbol__inc_samples(struct addr_map_symbol *ams, struct perf_sample *sample,
160 int evidx);
151 161
152int addr_map_symbol__account_cycles(struct addr_map_symbol *ams, 162int addr_map_symbol__account_cycles(struct addr_map_symbol *ams,
153 struct addr_map_symbol *start, 163 struct addr_map_symbol *start,
154 unsigned cycles); 164 unsigned cycles);
155 165
156int hist_entry__inc_addr_samples(struct hist_entry *he, int evidx, u64 addr); 166int hist_entry__inc_addr_samples(struct hist_entry *he, struct perf_sample *sample,
167 int evidx, u64 addr);
157 168
158int symbol__alloc_hist(struct symbol *sym); 169int symbol__alloc_hist(struct symbol *sym);
159void symbol__annotate_zero_histograms(struct symbol *sym); 170void symbol__annotate_zero_histograms(struct symbol *sym);
160 171
161int symbol__disassemble(struct symbol *sym, struct map *map, 172int symbol__disassemble(struct symbol *sym, struct map *map,
162 const char *arch_name, size_t privsize, 173 const char *arch_name, size_t privsize,
163 struct arch **parch); 174 struct arch **parch, char *cpuid);
164 175
165enum symbol_disassemble_errno { 176enum symbol_disassemble_errno {
166 SYMBOL_ANNOTATE_ERRNO__SUCCESS = 0, 177 SYMBOL_ANNOTATE_ERRNO__SUCCESS = 0,