diff options
author | Zhang, Yanmin <yanmin_zhang@linux.intel.com> | 2010-04-19 01:32:50 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-04-19 05:37:24 -0400 |
commit | a1645ce12adb6c9cc9e19d7695466204e3f017fe (patch) | |
tree | 5d31aaaf534997e6e9cebc07f38eca35f76986cf /tools/perf/util/symbol.h | |
parent | ff9d07a0e7ce756a183e7c2e483aec452ee6b574 (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.h | 43 |
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 | |||
117 | enum dso_kernel_type { | ||
118 | DSO_TYPE_USER = 0, | ||
119 | DSO_TYPE_KERNEL, | ||
120 | DSO_TYPE_GUEST_KERNEL | ||
109 | }; | 121 | }; |
110 | 122 | ||
111 | struct dso { | 123 | struct 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 | ||
144 | void dso__sort_by_name(struct dso *self, enum map_type type); | 156 | void dso__sort_by_name(struct dso *self, enum map_type type); |
145 | 157 | ||
146 | extern struct list_head dsos__user, dsos__kernel; | ||
147 | |||
148 | struct dso *__dsos__findnew(struct list_head *head, const char *name); | 158 | struct dso *__dsos__findnew(struct list_head *head, const char *name); |
149 | 159 | ||
150 | static inline struct dso *dsos__findnew(const char *name) | ||
151 | { | ||
152 | return __dsos__findnew(&dsos__user, name); | ||
153 | } | ||
154 | |||
155 | int dso__load(struct dso *self, struct map *map, symbol_filter_t filter); | 160 | int dso__load(struct dso *self, struct map *map, symbol_filter_t filter); |
156 | int dso__load_vmlinux_path(struct dso *self, struct map *map, | 161 | int dso__load_vmlinux_path(struct dso *self, struct map *map, |
157 | symbol_filter_t filter); | 162 | symbol_filter_t filter); |
158 | int dso__load_kallsyms(struct dso *self, const char *filename, struct map *map, | 163 | int dso__load_kallsyms(struct dso *self, const char *filename, struct map *map, |
159 | symbol_filter_t filter); | 164 | symbol_filter_t filter); |
160 | void dsos__fprintf(FILE *fp); | 165 | void dsos__fprintf(struct rb_root *kerninfo_root, FILE *fp); |
161 | size_t dsos__fprintf_buildid(FILE *fp, bool with_hits); | 166 | size_t dsos__fprintf_buildid(struct rb_root *kerninfo_root, |
167 | FILE *fp, bool with_hits); | ||
162 | 168 | ||
163 | size_t dso__fprintf_buildid(struct dso *self, FILE *fp); | 169 | size_t dso__fprintf_buildid(struct dso *self, FILE *fp); |
164 | size_t dso__fprintf(struct dso *self, enum map_type type, FILE *fp); | 170 | size_t dso__fprintf(struct dso *self, enum map_type type, FILE *fp); |
165 | 171 | ||
166 | enum dso_origin { | 172 | enum 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 { | |||
178 | char dso__symtab_origin(const struct dso *self); | 186 | char dso__symtab_origin(const struct dso *self); |
179 | void dso__set_long_name(struct dso *self, char *name); | 187 | void dso__set_long_name(struct dso *self, char *name); |
180 | void dso__set_build_id(struct dso *self, void *build_id); | 188 | void dso__set_build_id(struct dso *self, void *build_id); |
181 | void dso__read_running_kernel_build_id(struct dso *self); | 189 | void dso__read_running_kernel_build_id(struct dso *self, |
190 | struct kernel_info *kerninfo); | ||
182 | struct symbol *dso__find_symbol(struct dso *self, enum map_type type, u64 addr); | 191 | struct symbol *dso__find_symbol(struct dso *self, enum map_type type, u64 addr); |
183 | struct symbol *dso__find_symbol_by_name(struct dso *self, enum map_type type, | 192 | struct symbol *dso__find_symbol_by_name(struct dso *self, enum map_type type, |
184 | const char *name); | 193 | const char *name); |
185 | 194 | ||
186 | int filename__read_build_id(const char *filename, void *bf, size_t size); | 195 | int filename__read_build_id(const char *filename, void *bf, size_t size); |
187 | int sysfs__read_build_id(const char *filename, void *bf, size_t size); | 196 | int sysfs__read_build_id(const char *filename, void *bf, size_t size); |
188 | bool dsos__read_build_ids(bool with_hits); | 197 | bool __dsos__read_build_ids(struct list_head *head, bool with_hits); |
189 | int build_id__sprintf(const u8 *self, int len, char *bf); | 198 | int build_id__sprintf(const u8 *self, int len, char *bf); |
190 | int kallsyms__parse(const char *filename, void *arg, | 199 | int 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 | ||
203 | int __map_groups__create_kernel_maps(struct map_groups *self, | ||
204 | struct map *vmlinux_maps[MAP__NR_TYPES], | ||
205 | struct dso *kernel); | ||
206 | int map_groups__create_kernel_maps(struct rb_root *kerninfo_root, pid_t pid); | ||
207 | int map_groups__create_guest_kernel_maps(struct rb_root *kerninfo_root); | ||
208 | |||
194 | int symbol__init(void); | 209 | int symbol__init(void); |
195 | bool symbol_type__is_a(char symbol_type, enum map_type map_type); | 210 | bool symbol_type__is_a(char symbol_type, enum map_type map_type); |
196 | 211 | ||