aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/symbol.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-03-31 09:56:28 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-04-19 07:18:35 -0400
commitaeafcbaf4fcfeb74aeed65609ea5ead48dfc09f8 (patch)
tree5d23ddb538925fa4860353e2d7a23c8168c33966 /tools/perf/util/symbol.h
parentc8e5910edf8bbe2e5c6c35a4ef2a578cc7893b25 (diff)
perf symbols: Give more useful names to 'self' parameters
One more installment on an area that is mostly dormant. Suggested-by: Thomas Gleixner <tglx@linutronix.de> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/symbol.h')
-rw-r--r--tools/perf/util/symbol.h78
1 files changed, 41 insertions, 37 deletions
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 713b0b40cc4a..242de0101a86 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -62,7 +62,7 @@ struct symbol {
62 char name[0]; 62 char name[0];
63}; 63};
64 64
65void symbol__delete(struct symbol *self); 65void symbol__delete(struct symbol *sym);
66 66
67struct strlist; 67struct strlist;
68 68
@@ -96,9 +96,9 @@ struct symbol_conf {
96 96
97extern struct symbol_conf symbol_conf; 97extern struct symbol_conf symbol_conf;
98 98
99static inline void *symbol__priv(struct symbol *self) 99static inline void *symbol__priv(struct symbol *sym)
100{ 100{
101 return ((void *)self) - symbol_conf.priv_size; 101 return ((void *)sym) - symbol_conf.priv_size;
102} 102}
103 103
104struct ref_reloc_sym { 104struct ref_reloc_sym {
@@ -155,43 +155,45 @@ struct dso {
155 155
156struct dso *dso__new(const char *name); 156struct dso *dso__new(const char *name);
157struct dso *dso__new_kernel(const char *name); 157struct dso *dso__new_kernel(const char *name);
158void dso__delete(struct dso *self); 158void dso__delete(struct dso *dso);
159 159
160int dso__name_len(const struct dso *self); 160int dso__name_len(const struct dso *dso);
161 161
162bool dso__loaded(const struct dso *self, enum map_type type); 162bool dso__loaded(const struct dso *dso, enum map_type type);
163bool dso__sorted_by_name(const struct dso *self, enum map_type type); 163bool dso__sorted_by_name(const struct dso *dso, enum map_type type);
164 164
165static inline void dso__set_loaded(struct dso *self, enum map_type type) 165static inline void dso__set_loaded(struct dso *dso, enum map_type type)
166{ 166{
167 self->loaded |= (1 << type); 167 dso->loaded |= (1 << type);
168} 168}
169 169
170void dso__sort_by_name(struct dso *self, enum map_type type); 170void dso__sort_by_name(struct dso *dso, enum map_type type);
171 171
172struct dso *__dsos__findnew(struct list_head *head, const char *name); 172struct dso *__dsos__findnew(struct list_head *head, const char *name);
173 173
174int dso__load(struct dso *self, struct map *map, symbol_filter_t filter); 174int dso__load(struct dso *dso, struct map *map, symbol_filter_t filter);
175int dso__load_vmlinux(struct dso *self, struct map *map, 175int dso__load_vmlinux(struct dso *dso, struct map *map,
176 const char *vmlinux, symbol_filter_t filter); 176 const char *vmlinux, symbol_filter_t filter);
177int dso__load_vmlinux_path(struct dso *self, struct map *map, 177int dso__load_vmlinux_path(struct dso *dso, struct map *map,
178 symbol_filter_t filter); 178 symbol_filter_t filter);
179int dso__load_kallsyms(struct dso *self, const char *filename, struct map *map, 179int dso__load_kallsyms(struct dso *dso, const char *filename, struct map *map,
180 symbol_filter_t filter); 180 symbol_filter_t filter);
181int machine__load_kallsyms(struct machine *self, const char *filename, 181int machine__load_kallsyms(struct machine *machine, const char *filename,
182 enum map_type type, symbol_filter_t filter); 182 enum map_type type, symbol_filter_t filter);
183int machine__load_vmlinux_path(struct machine *self, enum map_type type, 183int machine__load_vmlinux_path(struct machine *machine, enum map_type type,
184 symbol_filter_t filter); 184 symbol_filter_t filter);
185 185
186size_t __dsos__fprintf(struct list_head *head, FILE *fp); 186size_t __dsos__fprintf(struct list_head *head, FILE *fp);
187 187
188size_t machine__fprintf_dsos_buildid(struct machine *self, FILE *fp, bool with_hits); 188size_t machine__fprintf_dsos_buildid(struct machine *machine,
189size_t machines__fprintf_dsos(struct rb_root *self, FILE *fp); 189 FILE *fp, bool with_hits);
190size_t machines__fprintf_dsos_buildid(struct rb_root *self, FILE *fp, bool with_hits); 190size_t machines__fprintf_dsos(struct rb_root *machines, FILE *fp);
191 191size_t machines__fprintf_dsos_buildid(struct rb_root *machines,
192size_t dso__fprintf_buildid(struct dso *self, FILE *fp); 192 FILE *fp, bool with_hits);
193size_t dso__fprintf_symbols_by_name(struct dso *self, enum map_type type, FILE *fp); 193size_t dso__fprintf_buildid(struct dso *dso, FILE *fp);
194size_t dso__fprintf(struct dso *self, enum map_type type, FILE *fp); 194size_t dso__fprintf_symbols_by_name(struct dso *dso,
195 enum map_type type, FILE *fp);
196size_t dso__fprintf(struct dso *dso, enum map_type type, FILE *fp);
195 197
196enum symtab_type { 198enum symtab_type {
197 SYMTAB__KALLSYMS = 0, 199 SYMTAB__KALLSYMS = 0,
@@ -207,34 +209,36 @@ enum symtab_type {
207 SYMTAB__NOT_FOUND, 209 SYMTAB__NOT_FOUND,
208}; 210};
209 211
210char dso__symtab_origin(const struct dso *self); 212char dso__symtab_origin(const struct dso *dso);
211void dso__set_long_name(struct dso *self, char *name); 213void dso__set_long_name(struct dso *dso, char *name);
212void dso__set_build_id(struct dso *self, void *build_id); 214void dso__set_build_id(struct dso *dso, void *build_id);
213void dso__read_running_kernel_build_id(struct dso *self, struct machine *machine); 215void dso__read_running_kernel_build_id(struct dso *dso,
214struct symbol *dso__find_symbol(struct dso *self, enum map_type type, u64 addr); 216 struct machine *machine);
215struct symbol *dso__find_symbol_by_name(struct dso *self, enum map_type type, 217struct symbol *dso__find_symbol(struct dso *dso, enum map_type type,
218 u64 addr);
219struct symbol *dso__find_symbol_by_name(struct dso *dso, enum map_type type,
216 const char *name); 220 const char *name);
217 221
218int filename__read_build_id(const char *filename, void *bf, size_t size); 222int filename__read_build_id(const char *filename, void *bf, size_t size);
219int sysfs__read_build_id(const char *filename, void *bf, size_t size); 223int sysfs__read_build_id(const char *filename, void *bf, size_t size);
220bool __dsos__read_build_ids(struct list_head *head, bool with_hits); 224bool __dsos__read_build_ids(struct list_head *head, bool with_hits);
221int build_id__sprintf(const u8 *self, int len, char *bf); 225int build_id__sprintf(const u8 *build_id, int len, char *bf);
222int kallsyms__parse(const char *filename, void *arg, 226int kallsyms__parse(const char *filename, void *arg,
223 int (*process_symbol)(void *arg, const char *name, 227 int (*process_symbol)(void *arg, const char *name,
224 char type, u64 start, u64 end)); 228 char type, u64 start, u64 end));
225 229
226void machine__destroy_kernel_maps(struct machine *self); 230void machine__destroy_kernel_maps(struct machine *machine);
227int __machine__create_kernel_maps(struct machine *self, struct dso *kernel); 231int __machine__create_kernel_maps(struct machine *machine, struct dso *kernel);
228int machine__create_kernel_maps(struct machine *self); 232int machine__create_kernel_maps(struct machine *machine);
229 233
230int machines__create_kernel_maps(struct rb_root *self, pid_t pid); 234int machines__create_kernel_maps(struct rb_root *machines, pid_t pid);
231int machines__create_guest_kernel_maps(struct rb_root *self); 235int machines__create_guest_kernel_maps(struct rb_root *machines);
232void machines__destroy_guest_kernel_maps(struct rb_root *self); 236void machines__destroy_guest_kernel_maps(struct rb_root *machines);
233 237
234int symbol__init(void); 238int symbol__init(void);
235void symbol__exit(void); 239void symbol__exit(void);
236bool symbol_type__is_a(char symbol_type, enum map_type map_type); 240bool symbol_type__is_a(char symbol_type, enum map_type map_type);
237 241
238size_t machine__fprintf_vmlinux_path(struct machine *self, FILE *fp); 242size_t machine__fprintf_vmlinux_path(struct machine *machine, FILE *fp);
239 243
240#endif /* __PERF_SYMBOL */ 244#endif /* __PERF_SYMBOL */