diff options
Diffstat (limited to 'tools/perf/util/annotate.h')
-rw-r--r-- | tools/perf/util/annotate.h | 23 |
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 { | |||
52 | bool ins__is_jump(const struct ins *ins); | 53 | bool ins__is_jump(const struct ins *ins); |
53 | bool ins__is_call(const struct ins *ins); | 54 | bool ins__is_call(const struct ins *ins); |
54 | bool ins__is_ret(const struct ins *ins); | 55 | bool ins__is_ret(const struct ins *ins); |
56 | bool ins__is_lock(const struct ins *ins); | ||
55 | int ins__scnprintf(struct ins *ins, char *bf, size_t size, struct ins_operands *ops); | 57 | int ins__scnprintf(struct ins *ins, char *bf, size_t size, struct ins_operands *ops); |
58 | bool ins__is_fused(struct arch *arch, const char *ins1, const char *ins2); | ||
56 | 59 | ||
57 | struct annotation; | 60 | struct 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 | ||
78 | struct sym_hist_entry { | ||
79 | u64 nr_samples; | ||
80 | u64 period; | ||
81 | }; | ||
82 | |||
75 | void disasm_line__free(struct disasm_line *dl); | 83 | void disasm_line__free(struct disasm_line *dl); |
76 | struct disasm_line *disasm__get_next_ip_line(struct list_head *head, struct disasm_line *pos); | 84 | struct disasm_line *disasm__get_next_ip_line(struct list_head *head, struct disasm_line *pos); |
77 | int disasm_line__scnprintf(struct disasm_line *dl, char *bf, size_t size, bool raw); | 85 | int disasm_line__scnprintf(struct disasm_line *dl, char *bf, size_t size, bool raw); |
78 | size_t disasm__fprintf(struct list_head *head, FILE *fp); | 86 | size_t disasm__fprintf(struct list_head *head, FILE *fp); |
79 | double disasm__calc_percent(struct annotation *notes, int evidx, s64 offset, | 87 | double 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 | ||
82 | struct sym_hist { | 90 | struct 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 | ||
87 | struct cyc_hist { | 96 | struct 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 | ||
150 | int addr_map_symbol__inc_samples(struct addr_map_symbol *ams, int evidx); | 159 | int addr_map_symbol__inc_samples(struct addr_map_symbol *ams, struct perf_sample *sample, |
160 | int evidx); | ||
151 | 161 | ||
152 | int addr_map_symbol__account_cycles(struct addr_map_symbol *ams, | 162 | int 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 | ||
156 | int hist_entry__inc_addr_samples(struct hist_entry *he, int evidx, u64 addr); | 166 | int hist_entry__inc_addr_samples(struct hist_entry *he, struct perf_sample *sample, |
167 | int evidx, u64 addr); | ||
157 | 168 | ||
158 | int symbol__alloc_hist(struct symbol *sym); | 169 | int symbol__alloc_hist(struct symbol *sym); |
159 | void symbol__annotate_zero_histograms(struct symbol *sym); | 170 | void symbol__annotate_zero_histograms(struct symbol *sym); |
160 | 171 | ||
161 | int symbol__disassemble(struct symbol *sym, struct map *map, | 172 | int 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 | ||
165 | enum symbol_disassemble_errno { | 176 | enum symbol_disassemble_errno { |
166 | SYMBOL_ANNOTATE_ERRNO__SUCCESS = 0, | 177 | SYMBOL_ANNOTATE_ERRNO__SUCCESS = 0, |