diff options
Diffstat (limited to 'tools/perf/util/symbol.h')
-rw-r--r-- | tools/perf/util/symbol.h | 52 |
1 files changed, 41 insertions, 11 deletions
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 8aded2356f79..280dadd32a08 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h | |||
@@ -8,6 +8,8 @@ | |||
8 | #include <linux/rbtree.h> | 8 | #include <linux/rbtree.h> |
9 | #include "event.h" | 9 | #include "event.h" |
10 | 10 | ||
11 | #define DEBUG_CACHE_DIR ".debug" | ||
12 | |||
11 | #ifdef HAVE_CPLUS_DEMANGLE | 13 | #ifdef HAVE_CPLUS_DEMANGLE |
12 | extern char *cplus_demangle(const char *, int); | 14 | extern char *cplus_demangle(const char *, int); |
13 | 15 | ||
@@ -49,6 +51,8 @@ struct symbol { | |||
49 | char name[0]; | 51 | char name[0]; |
50 | }; | 52 | }; |
51 | 53 | ||
54 | void symbol__delete(struct symbol *self); | ||
55 | |||
52 | struct strlist; | 56 | struct strlist; |
53 | 57 | ||
54 | struct symbol_conf { | 58 | struct symbol_conf { |
@@ -58,7 +62,8 @@ struct symbol_conf { | |||
58 | sort_by_name, | 62 | sort_by_name, |
59 | show_nr_samples, | 63 | show_nr_samples, |
60 | use_callchain, | 64 | use_callchain, |
61 | exclude_other; | 65 | exclude_other, |
66 | full_paths; | ||
62 | const char *vmlinux_name, | 67 | const char *vmlinux_name, |
63 | *field_sep; | 68 | *field_sep; |
64 | char *dso_list_str, | 69 | char *dso_list_str, |
@@ -77,6 +82,12 @@ static inline void *symbol__priv(struct symbol *self) | |||
77 | return ((void *)self) - symbol_conf.priv_size; | 82 | return ((void *)self) - symbol_conf.priv_size; |
78 | } | 83 | } |
79 | 84 | ||
85 | struct ref_reloc_sym { | ||
86 | const char *name; | ||
87 | u64 addr; | ||
88 | u64 unrelocated_addr; | ||
89 | }; | ||
90 | |||
80 | struct addr_location { | 91 | struct addr_location { |
81 | struct thread *thread; | 92 | struct thread *thread; |
82 | struct map *map; | 93 | struct map *map; |
@@ -94,6 +105,7 @@ struct dso { | |||
94 | u8 slen_calculated:1; | 105 | u8 slen_calculated:1; |
95 | u8 has_build_id:1; | 106 | u8 has_build_id:1; |
96 | u8 kernel:1; | 107 | u8 kernel:1; |
108 | u8 hit:1; | ||
97 | unsigned char origin; | 109 | unsigned char origin; |
98 | u8 sorted_by_name; | 110 | u8 sorted_by_name; |
99 | u8 loaded; | 111 | u8 loaded; |
@@ -105,37 +117,55 @@ struct dso { | |||
105 | }; | 117 | }; |
106 | 118 | ||
107 | struct dso *dso__new(const char *name); | 119 | struct dso *dso__new(const char *name); |
120 | struct dso *dso__new_kernel(const char *name); | ||
108 | void dso__delete(struct dso *self); | 121 | void dso__delete(struct dso *self); |
109 | 122 | ||
110 | bool dso__loaded(const struct dso *self, enum map_type type); | 123 | bool dso__loaded(const struct dso *self, enum map_type type); |
111 | bool dso__sorted_by_name(const struct dso *self, enum map_type type); | 124 | bool dso__sorted_by_name(const struct dso *self, enum map_type type); |
112 | 125 | ||
126 | static inline void dso__set_loaded(struct dso *self, enum map_type type) | ||
127 | { | ||
128 | self->loaded |= (1 << type); | ||
129 | } | ||
130 | |||
113 | void dso__sort_by_name(struct dso *self, enum map_type type); | 131 | void dso__sort_by_name(struct dso *self, enum map_type type); |
114 | 132 | ||
115 | struct perf_session; | 133 | extern struct list_head dsos__user, dsos__kernel; |
134 | |||
135 | struct dso *__dsos__findnew(struct list_head *head, const char *name); | ||
136 | |||
137 | static inline struct dso *dsos__findnew(const char *name) | ||
138 | { | ||
139 | return __dsos__findnew(&dsos__user, name); | ||
140 | } | ||
116 | 141 | ||
117 | struct dso *dsos__findnew(const char *name); | 142 | int dso__load(struct dso *self, struct map *map, symbol_filter_t filter); |
118 | int dso__load(struct dso *self, struct map *map, struct perf_session *session, | 143 | int dso__load_vmlinux_path(struct dso *self, struct map *map, |
119 | symbol_filter_t filter); | 144 | symbol_filter_t filter); |
145 | int dso__load_kallsyms(struct dso *self, const char *filename, struct map *map, | ||
146 | symbol_filter_t filter); | ||
120 | void dsos__fprintf(FILE *fp); | 147 | void dsos__fprintf(FILE *fp); |
121 | size_t dsos__fprintf_buildid(FILE *fp); | 148 | size_t dsos__fprintf_buildid(FILE *fp, bool with_hits); |
122 | 149 | ||
123 | size_t dso__fprintf_buildid(struct dso *self, FILE *fp); | 150 | size_t dso__fprintf_buildid(struct dso *self, FILE *fp); |
124 | size_t dso__fprintf(struct dso *self, enum map_type type, FILE *fp); | 151 | size_t dso__fprintf(struct dso *self, enum map_type type, FILE *fp); |
125 | char dso__symtab_origin(const struct dso *self); | 152 | char dso__symtab_origin(const struct dso *self); |
153 | void dso__set_long_name(struct dso *self, char *name); | ||
126 | void dso__set_build_id(struct dso *self, void *build_id); | 154 | void dso__set_build_id(struct dso *self, void *build_id); |
155 | void dso__read_running_kernel_build_id(struct dso *self); | ||
127 | struct symbol *dso__find_symbol(struct dso *self, enum map_type type, u64 addr); | 156 | struct symbol *dso__find_symbol(struct dso *self, enum map_type type, u64 addr); |
128 | struct symbol *dso__find_symbol_by_name(struct dso *self, enum map_type type, | 157 | struct symbol *dso__find_symbol_by_name(struct dso *self, enum map_type type, |
129 | const char *name); | 158 | const char *name); |
130 | 159 | ||
131 | int filename__read_build_id(const char *filename, void *bf, size_t size); | 160 | int filename__read_build_id(const char *filename, void *bf, size_t size); |
132 | int sysfs__read_build_id(const char *filename, void *bf, size_t size); | 161 | int sysfs__read_build_id(const char *filename, void *bf, size_t size); |
133 | bool dsos__read_build_ids(void); | 162 | bool dsos__read_build_ids(bool with_hits); |
134 | int build_id__sprintf(u8 *self, int len, char *bf); | 163 | int build_id__sprintf(const u8 *self, int len, char *bf); |
164 | int kallsyms__parse(const char *filename, void *arg, | ||
165 | int (*process_symbol)(void *arg, const char *name, | ||
166 | char type, u64 start)); | ||
135 | 167 | ||
136 | int symbol__init(void); | 168 | int symbol__init(void); |
137 | int perf_session__create_kernel_maps(struct perf_session *self); | 169 | bool symbol_type__is_a(char symbol_type, enum map_type map_type); |
138 | 170 | ||
139 | extern struct list_head dsos__user, dsos__kernel; | ||
140 | extern struct dso *vdso; | ||
141 | #endif /* __PERF_SYMBOL */ | 171 | #endif /* __PERF_SYMBOL */ |