aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/symbol.h
diff options
context:
space:
mode:
authorZhang, Yanmin <yanmin_zhang@linux.intel.com>2010-04-19 01:32:50 -0400
committerAvi Kivity <avi@redhat.com>2010-04-19 05:37:24 -0400
commita1645ce12adb6c9cc9e19d7695466204e3f017fe (patch)
tree5d31aaaf534997e6e9cebc07f38eca35f76986cf /tools/perf/util/symbol.h
parentff9d07a0e7ce756a183e7c2e483aec452ee6b574 (diff)
perf: 'perf kvm' tool for monitoring guest performance from host
Here is the patch of userspace perf tool. Signed-off-by: Zhang Yanmin <yanmin_zhang@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'tools/perf/util/symbol.h')
-rw-r--r--tools/perf/util/symbol.h43
1 files changed, 29 insertions, 14 deletions
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 757fae3f5ee0..478f5ab37787 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -69,10 +69,15 @@ struct symbol_conf {
69 show_nr_samples, 69 show_nr_samples,
70 use_callchain, 70 use_callchain,
71 exclude_other, 71 exclude_other,
72 full_paths; 72 full_paths,
73 show_cpu_utilization;
73 const char *vmlinux_name, 74 const char *vmlinux_name,
74 *field_sep; 75 *field_sep;
75 char *dso_list_str, 76 const char *default_guest_vmlinux_name,
77 *default_guest_kallsyms,
78 *default_guest_modules;
79 const char *guestmount;
80 char *dso_list_str,
76 *comm_list_str, 81 *comm_list_str,
77 *sym_list_str, 82 *sym_list_str,
78 *col_width_list_str; 83 *col_width_list_str;
@@ -106,6 +111,13 @@ struct addr_location {
106 u64 addr; 111 u64 addr;
107 char level; 112 char level;
108 bool filtered; 113 bool filtered;
114 unsigned int cpumode;
115};
116
117enum dso_kernel_type {
118 DSO_TYPE_USER = 0,
119 DSO_TYPE_KERNEL,
120 DSO_TYPE_GUEST_KERNEL
109}; 121};
110 122
111struct dso { 123struct dso {
@@ -115,7 +127,7 @@ struct dso {
115 u8 adjust_symbols:1; 127 u8 adjust_symbols:1;
116 u8 slen_calculated:1; 128 u8 slen_calculated:1;
117 u8 has_build_id:1; 129 u8 has_build_id:1;
118 u8 kernel:1; 130 enum dso_kernel_type kernel;
119 u8 hit:1; 131 u8 hit:1;
120 u8 annotate_warned:1; 132 u8 annotate_warned:1;
121 unsigned char origin; 133 unsigned char origin;
@@ -143,34 +155,30 @@ static inline void dso__set_loaded(struct dso *self, enum map_type type)
143 155
144void dso__sort_by_name(struct dso *self, enum map_type type); 156void dso__sort_by_name(struct dso *self, enum map_type type);
145 157
146extern struct list_head dsos__user, dsos__kernel;
147
148struct dso *__dsos__findnew(struct list_head *head, const char *name); 158struct dso *__dsos__findnew(struct list_head *head, const char *name);
149 159
150static inline struct dso *dsos__findnew(const char *name)
151{
152 return __dsos__findnew(&dsos__user, name);
153}
154
155int dso__load(struct dso *self, struct map *map, symbol_filter_t filter); 160int dso__load(struct dso *self, struct map *map, symbol_filter_t filter);
156int dso__load_vmlinux_path(struct dso *self, struct map *map, 161int dso__load_vmlinux_path(struct dso *self, struct map *map,
157 symbol_filter_t filter); 162 symbol_filter_t filter);
158int dso__load_kallsyms(struct dso *self, const char *filename, struct map *map, 163int dso__load_kallsyms(struct dso *self, const char *filename, struct map *map,
159 symbol_filter_t filter); 164 symbol_filter_t filter);
160void dsos__fprintf(FILE *fp); 165void dsos__fprintf(struct rb_root *kerninfo_root, FILE *fp);
161size_t dsos__fprintf_buildid(FILE *fp, bool with_hits); 166size_t dsos__fprintf_buildid(struct rb_root *kerninfo_root,
167 FILE *fp, bool with_hits);
162 168
163size_t dso__fprintf_buildid(struct dso *self, FILE *fp); 169size_t dso__fprintf_buildid(struct dso *self, FILE *fp);
164size_t dso__fprintf(struct dso *self, enum map_type type, FILE *fp); 170size_t dso__fprintf(struct dso *self, enum map_type type, FILE *fp);
165 171
166enum dso_origin { 172enum dso_origin {
167 DSO__ORIG_KERNEL = 0, 173 DSO__ORIG_KERNEL = 0,
174 DSO__ORIG_GUEST_KERNEL,
168 DSO__ORIG_JAVA_JIT, 175 DSO__ORIG_JAVA_JIT,
169 DSO__ORIG_BUILD_ID_CACHE, 176 DSO__ORIG_BUILD_ID_CACHE,
170 DSO__ORIG_FEDORA, 177 DSO__ORIG_FEDORA,
171 DSO__ORIG_UBUNTU, 178 DSO__ORIG_UBUNTU,
172 DSO__ORIG_BUILDID, 179 DSO__ORIG_BUILDID,
173 DSO__ORIG_DSO, 180 DSO__ORIG_DSO,
181 DSO__ORIG_GUEST_KMODULE,
174 DSO__ORIG_KMODULE, 182 DSO__ORIG_KMODULE,
175 DSO__ORIG_NOT_FOUND, 183 DSO__ORIG_NOT_FOUND,
176}; 184};
@@ -178,19 +186,26 @@ enum dso_origin {
178char dso__symtab_origin(const struct dso *self); 186char dso__symtab_origin(const struct dso *self);
179void dso__set_long_name(struct dso *self, char *name); 187void dso__set_long_name(struct dso *self, char *name);
180void dso__set_build_id(struct dso *self, void *build_id); 188void dso__set_build_id(struct dso *self, void *build_id);
181void dso__read_running_kernel_build_id(struct dso *self); 189void dso__read_running_kernel_build_id(struct dso *self,
190 struct kernel_info *kerninfo);
182struct symbol *dso__find_symbol(struct dso *self, enum map_type type, u64 addr); 191struct symbol *dso__find_symbol(struct dso *self, enum map_type type, u64 addr);
183struct symbol *dso__find_symbol_by_name(struct dso *self, enum map_type type, 192struct symbol *dso__find_symbol_by_name(struct dso *self, enum map_type type,
184 const char *name); 193 const char *name);
185 194
186int filename__read_build_id(const char *filename, void *bf, size_t size); 195int filename__read_build_id(const char *filename, void *bf, size_t size);
187int sysfs__read_build_id(const char *filename, void *bf, size_t size); 196int sysfs__read_build_id(const char *filename, void *bf, size_t size);
188bool dsos__read_build_ids(bool with_hits); 197bool __dsos__read_build_ids(struct list_head *head, bool with_hits);
189int build_id__sprintf(const u8 *self, int len, char *bf); 198int build_id__sprintf(const u8 *self, int len, char *bf);
190int kallsyms__parse(const char *filename, void *arg, 199int kallsyms__parse(const char *filename, void *arg,
191 int (*process_symbol)(void *arg, const char *name, 200 int (*process_symbol)(void *arg, const char *name,
192 char type, u64 start)); 201 char type, u64 start));
193 202
203int __map_groups__create_kernel_maps(struct map_groups *self,
204 struct map *vmlinux_maps[MAP__NR_TYPES],
205 struct dso *kernel);
206int map_groups__create_kernel_maps(struct rb_root *kerninfo_root, pid_t pid);
207int map_groups__create_guest_kernel_maps(struct rb_root *kerninfo_root);
208
194int symbol__init(void); 209int symbol__init(void);
195bool symbol_type__is_a(char symbol_type, enum map_type map_type); 210bool symbol_type__is_a(char symbol_type, enum map_type map_type);
196 211