aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/symbol.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/symbol.h')
-rw-r--r--tools/perf/util/symbol.h52
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
12extern char *cplus_demangle(const char *, int); 14extern 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
54void symbol__delete(struct symbol *self);
55
52struct strlist; 56struct strlist;
53 57
54struct symbol_conf { 58struct 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
85struct ref_reloc_sym {
86 const char *name;
87 u64 addr;
88 u64 unrelocated_addr;
89};
90
80struct addr_location { 91struct 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
107struct dso *dso__new(const char *name); 119struct dso *dso__new(const char *name);
120struct dso *dso__new_kernel(const char *name);
108void dso__delete(struct dso *self); 121void dso__delete(struct dso *self);
109 122
110bool dso__loaded(const struct dso *self, enum map_type type); 123bool dso__loaded(const struct dso *self, enum map_type type);
111bool dso__sorted_by_name(const struct dso *self, enum map_type type); 124bool dso__sorted_by_name(const struct dso *self, enum map_type type);
112 125
126static inline void dso__set_loaded(struct dso *self, enum map_type type)
127{
128 self->loaded |= (1 << type);
129}
130
113void dso__sort_by_name(struct dso *self, enum map_type type); 131void dso__sort_by_name(struct dso *self, enum map_type type);
114 132
115struct perf_session; 133extern struct list_head dsos__user, dsos__kernel;
134
135struct dso *__dsos__findnew(struct list_head *head, const char *name);
136
137static inline struct dso *dsos__findnew(const char *name)
138{
139 return __dsos__findnew(&dsos__user, name);
140}
116 141
117struct dso *dsos__findnew(const char *name); 142int dso__load(struct dso *self, struct map *map, symbol_filter_t filter);
118int dso__load(struct dso *self, struct map *map, struct perf_session *session, 143int dso__load_vmlinux_path(struct dso *self, struct map *map,
119 symbol_filter_t filter); 144 symbol_filter_t filter);
145int dso__load_kallsyms(struct dso *self, const char *filename, struct map *map,
146 symbol_filter_t filter);
120void dsos__fprintf(FILE *fp); 147void dsos__fprintf(FILE *fp);
121size_t dsos__fprintf_buildid(FILE *fp); 148size_t dsos__fprintf_buildid(FILE *fp, bool with_hits);
122 149
123size_t dso__fprintf_buildid(struct dso *self, FILE *fp); 150size_t dso__fprintf_buildid(struct dso *self, FILE *fp);
124size_t dso__fprintf(struct dso *self, enum map_type type, FILE *fp); 151size_t dso__fprintf(struct dso *self, enum map_type type, FILE *fp);
125char dso__symtab_origin(const struct dso *self); 152char dso__symtab_origin(const struct dso *self);
153void dso__set_long_name(struct dso *self, char *name);
126void dso__set_build_id(struct dso *self, void *build_id); 154void dso__set_build_id(struct dso *self, void *build_id);
155void dso__read_running_kernel_build_id(struct dso *self);
127struct symbol *dso__find_symbol(struct dso *self, enum map_type type, u64 addr); 156struct symbol *dso__find_symbol(struct dso *self, enum map_type type, u64 addr);
128struct symbol *dso__find_symbol_by_name(struct dso *self, enum map_type type, 157struct symbol *dso__find_symbol_by_name(struct dso *self, enum map_type type,
129 const char *name); 158 const char *name);
130 159
131int filename__read_build_id(const char *filename, void *bf, size_t size); 160int filename__read_build_id(const char *filename, void *bf, size_t size);
132int sysfs__read_build_id(const char *filename, void *bf, size_t size); 161int sysfs__read_build_id(const char *filename, void *bf, size_t size);
133bool dsos__read_build_ids(void); 162bool dsos__read_build_ids(bool with_hits);
134int build_id__sprintf(u8 *self, int len, char *bf); 163int build_id__sprintf(const u8 *self, int len, char *bf);
164int kallsyms__parse(const char *filename, void *arg,
165 int (*process_symbol)(void *arg, const char *name,
166 char type, u64 start));
135 167
136int symbol__init(void); 168int symbol__init(void);
137int perf_session__create_kernel_maps(struct perf_session *self); 169bool symbol_type__is_a(char symbol_type, enum map_type map_type);
138 170
139extern struct list_head dsos__user, dsos__kernel;
140extern struct dso *vdso;
141#endif /* __PERF_SYMBOL */ 171#endif /* __PERF_SYMBOL */