diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-03-11 11:13:36 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-03-11 11:28:45 -0500 |
commit | 878b439dccd064d6908800fab0b47bd3c3a87ebb (patch) | |
tree | f2d91701a9077663b4edbf52092ee124160e15db /tools/perf | |
parent | 8b8ba4a9a5b04916858f79cee71873f973931649 (diff) |
perf symbols: Rename dso->origin to dso->symtab_type
And the DSO__ORIG_ enum to SYMTAB__, to clarify that this is about from
where the symtab was obtained.
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: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/builtin-top.c | 4 | ||||
-rw-r--r-- | tools/perf/util/annotate.c | 2 | ||||
-rw-r--r-- | tools/perf/util/symbol.c | 64 | ||||
-rw-r--r-- | tools/perf/util/symbol.h | 26 |
4 files changed, 48 insertions, 48 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 4976400a1438..31ea7a68baa4 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -152,7 +152,7 @@ static int parse_source(struct sym_entry *syme) | |||
152 | /* | 152 | /* |
153 | * We can't annotate with just /proc/kallsyms | 153 | * We can't annotate with just /proc/kallsyms |
154 | */ | 154 | */ |
155 | if (map->dso->origin == DSO__ORIG_KERNEL) { | 155 | if (map->dso->symtab_type == SYMTAB__KALLSYMS) { |
156 | pr_err("Can't annotate %s: No vmlinux file was found in the " | 156 | pr_err("Can't annotate %s: No vmlinux file was found in the " |
157 | "path\n", sym->name); | 157 | "path\n", sym->name); |
158 | sleep(1); | 158 | sleep(1); |
@@ -769,7 +769,7 @@ static void perf_event__process_sample(const union perf_event *event, | |||
769 | struct symbol *sym = sym_entry__symbol(top.sym_filter_entry); | 769 | struct symbol *sym = sym_entry__symbol(top.sym_filter_entry); |
770 | 770 | ||
771 | pr_err("Can't annotate %s", sym->name); | 771 | pr_err("Can't annotate %s", sym->name); |
772 | if (top.sym_filter_entry->map->dso->origin == DSO__ORIG_KERNEL) { | 772 | if (top.sym_filter_entry->map->dso->symtab_type == SYMTAB__KALLSYMS) { |
773 | pr_err(": No vmlinux file was found in the path:\n"); | 773 | pr_err(": No vmlinux file was found in the path:\n"); |
774 | machine__fprintf_vmlinux_path(machine, stderr); | 774 | machine__fprintf_vmlinux_path(machine, stderr); |
775 | } else | 775 | } else |
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 0d0830c98cd7..e01af2b1a469 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c | |||
@@ -294,7 +294,7 @@ fallback: | |||
294 | free_filename = false; | 294 | free_filename = false; |
295 | } | 295 | } |
296 | 296 | ||
297 | if (dso->origin == DSO__ORIG_KERNEL) { | 297 | if (dso->symtab_type == SYMTAB__KALLSYMS) { |
298 | char bf[BUILD_ID_SIZE * 2 + 16] = " with build id "; | 298 | char bf[BUILD_ID_SIZE * 2 + 16] = " with build id "; |
299 | char *build_id_msg = NULL; | 299 | char *build_id_msg = NULL; |
300 | 300 | ||
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 00014e32c288..651dbfe7f4f3 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -207,7 +207,7 @@ struct dso *dso__new(const char *name) | |||
207 | dso__set_short_name(self, self->name); | 207 | dso__set_short_name(self, self->name); |
208 | for (i = 0; i < MAP__NR_TYPES; ++i) | 208 | for (i = 0; i < MAP__NR_TYPES; ++i) |
209 | self->symbols[i] = self->symbol_names[i] = RB_ROOT; | 209 | self->symbols[i] = self->symbol_names[i] = RB_ROOT; |
210 | self->origin = DSO__ORIG_NOT_FOUND; | 210 | self->symtab_type = SYMTAB__NOT_FOUND; |
211 | self->loaded = 0; | 211 | self->loaded = 0; |
212 | self->sorted_by_name = 0; | 212 | self->sorted_by_name = 0; |
213 | self->has_build_id = 0; | 213 | self->has_build_id = 0; |
@@ -680,9 +680,9 @@ int dso__load_kallsyms(struct dso *self, const char *filename, | |||
680 | return -1; | 680 | return -1; |
681 | 681 | ||
682 | if (self->kernel == DSO_TYPE_GUEST_KERNEL) | 682 | if (self->kernel == DSO_TYPE_GUEST_KERNEL) |
683 | self->origin = DSO__ORIG_GUEST_KERNEL; | 683 | self->symtab_type = SYMTAB__GUEST_KALLSYMS; |
684 | else | 684 | else |
685 | self->origin = DSO__ORIG_KERNEL; | 685 | self->symtab_type = SYMTAB__KALLSYMS; |
686 | 686 | ||
687 | return dso__split_kallsyms(self, map, filter); | 687 | return dso__split_kallsyms(self, map, filter); |
688 | } | 688 | } |
@@ -1204,7 +1204,7 @@ static int dso__load_sym(struct dso *self, struct map *map, const char *name, | |||
1204 | } | 1204 | } |
1205 | curr_map->map_ip = identity__map_ip; | 1205 | curr_map->map_ip = identity__map_ip; |
1206 | curr_map->unmap_ip = identity__map_ip; | 1206 | curr_map->unmap_ip = identity__map_ip; |
1207 | curr_dso->origin = self->origin; | 1207 | curr_dso->symtab_type = self->symtab_type; |
1208 | map_groups__insert(kmap->kmaps, curr_map); | 1208 | map_groups__insert(kmap->kmaps, curr_map); |
1209 | dsos__add(&self->node, curr_dso); | 1209 | dsos__add(&self->node, curr_dso); |
1210 | dso__set_loaded(curr_dso, map->type); | 1210 | dso__set_loaded(curr_dso, map->type); |
@@ -1430,21 +1430,21 @@ out: | |||
1430 | char dso__symtab_origin(const struct dso *self) | 1430 | char dso__symtab_origin(const struct dso *self) |
1431 | { | 1431 | { |
1432 | static const char origin[] = { | 1432 | static const char origin[] = { |
1433 | [DSO__ORIG_KERNEL] = 'k', | 1433 | [SYMTAB__KALLSYMS] = 'k', |
1434 | [DSO__ORIG_JAVA_JIT] = 'j', | 1434 | [SYMTAB__JAVA_JIT] = 'j', |
1435 | [DSO__ORIG_BUILD_ID_CACHE] = 'B', | 1435 | [SYMTAB__BUILD_ID_CACHE] = 'B', |
1436 | [DSO__ORIG_FEDORA] = 'f', | 1436 | [SYMTAB__FEDORA_DEBUGINFO] = 'f', |
1437 | [DSO__ORIG_UBUNTU] = 'u', | 1437 | [SYMTAB__UBUNTU_DEBUGINFO] = 'u', |
1438 | [DSO__ORIG_BUILDID] = 'b', | 1438 | [SYMTAB__BUILDID_DEBUGINFO] = 'b', |
1439 | [DSO__ORIG_DSO] = 'd', | 1439 | [SYMTAB__SYSTEM_PATH_DSO] = 'd', |
1440 | [DSO__ORIG_KMODULE] = 'K', | 1440 | [SYMTAB__SYSTEM_PATH_KMODULE] = 'K', |
1441 | [DSO__ORIG_GUEST_KERNEL] = 'g', | 1441 | [SYMTAB__GUEST_KALLSYMS] = 'g', |
1442 | [DSO__ORIG_GUEST_KMODULE] = 'G', | 1442 | [SYMTAB__GUEST_KMODULE] = 'G', |
1443 | }; | 1443 | }; |
1444 | 1444 | ||
1445 | if (self == NULL || self->origin == DSO__ORIG_NOT_FOUND) | 1445 | if (self == NULL || self->symtab_type == SYMTAB__NOT_FOUND) |
1446 | return '!'; | 1446 | return '!'; |
1447 | return origin[self->origin]; | 1447 | return origin[self->symtab_type]; |
1448 | } | 1448 | } |
1449 | 1449 | ||
1450 | int dso__load(struct dso *self, struct map *map, symbol_filter_t filter) | 1450 | int dso__load(struct dso *self, struct map *map, symbol_filter_t filter) |
@@ -1477,8 +1477,8 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter) | |||
1477 | 1477 | ||
1478 | if (strncmp(self->name, "/tmp/perf-", 10) == 0) { | 1478 | if (strncmp(self->name, "/tmp/perf-", 10) == 0) { |
1479 | ret = dso__load_perf_map(self, map, filter); | 1479 | ret = dso__load_perf_map(self, map, filter); |
1480 | self->origin = ret > 0 ? DSO__ORIG_JAVA_JIT : | 1480 | self->symtab_type = ret > 0 ? SYMTAB__JAVA_JIT : |
1481 | DSO__ORIG_NOT_FOUND; | 1481 | SYMTAB__NOT_FOUND; |
1482 | return ret; | 1482 | return ret; |
1483 | } | 1483 | } |
1484 | 1484 | ||
@@ -1486,26 +1486,26 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter) | |||
1486 | * On the first pass, only load images if they have a full symtab. | 1486 | * On the first pass, only load images if they have a full symtab. |
1487 | * Failing that, do a second pass where we accept .dynsym also | 1487 | * Failing that, do a second pass where we accept .dynsym also |
1488 | */ | 1488 | */ |
1489 | for (self->origin = DSO__ORIG_BUILD_ID_CACHE, want_symtab = 1; | 1489 | for (self->symtab_type = SYMTAB__BUILD_ID_CACHE, want_symtab = 1; |
1490 | self->origin != DSO__ORIG_NOT_FOUND; | 1490 | self->symtab_type != SYMTAB__NOT_FOUND; |
1491 | self->origin++) { | 1491 | self->symtab_type++) { |
1492 | switch (self->origin) { | 1492 | switch (self->symtab_type) { |
1493 | case DSO__ORIG_BUILD_ID_CACHE: | 1493 | case SYMTAB__BUILD_ID_CACHE: |
1494 | /* skip the locally configured cache if a symfs is given */ | 1494 | /* skip the locally configured cache if a symfs is given */ |
1495 | if (symbol_conf.symfs[0] || | 1495 | if (symbol_conf.symfs[0] || |
1496 | (dso__build_id_filename(self, name, size) == NULL)) { | 1496 | (dso__build_id_filename(self, name, size) == NULL)) { |
1497 | continue; | 1497 | continue; |
1498 | } | 1498 | } |
1499 | break; | 1499 | break; |
1500 | case DSO__ORIG_FEDORA: | 1500 | case SYMTAB__FEDORA_DEBUGINFO: |
1501 | snprintf(name, size, "%s/usr/lib/debug%s.debug", | 1501 | snprintf(name, size, "%s/usr/lib/debug%s.debug", |
1502 | symbol_conf.symfs, self->long_name); | 1502 | symbol_conf.symfs, self->long_name); |
1503 | break; | 1503 | break; |
1504 | case DSO__ORIG_UBUNTU: | 1504 | case SYMTAB__UBUNTU_DEBUGINFO: |
1505 | snprintf(name, size, "%s/usr/lib/debug%s", | 1505 | snprintf(name, size, "%s/usr/lib/debug%s", |
1506 | symbol_conf.symfs, self->long_name); | 1506 | symbol_conf.symfs, self->long_name); |
1507 | break; | 1507 | break; |
1508 | case DSO__ORIG_BUILDID: { | 1508 | case SYMTAB__BUILDID_DEBUGINFO: { |
1509 | char build_id_hex[BUILD_ID_SIZE * 2 + 1]; | 1509 | char build_id_hex[BUILD_ID_SIZE * 2 + 1]; |
1510 | 1510 | ||
1511 | if (!self->has_build_id) | 1511 | if (!self->has_build_id) |
@@ -1519,11 +1519,11 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter) | |||
1519 | symbol_conf.symfs, build_id_hex, build_id_hex + 2); | 1519 | symbol_conf.symfs, build_id_hex, build_id_hex + 2); |
1520 | } | 1520 | } |
1521 | break; | 1521 | break; |
1522 | case DSO__ORIG_DSO: | 1522 | case SYMTAB__SYSTEM_PATH_DSO: |
1523 | snprintf(name, size, "%s%s", | 1523 | snprintf(name, size, "%s%s", |
1524 | symbol_conf.symfs, self->long_name); | 1524 | symbol_conf.symfs, self->long_name); |
1525 | break; | 1525 | break; |
1526 | case DSO__ORIG_GUEST_KMODULE: | 1526 | case SYMTAB__GUEST_KMODULE: |
1527 | if (map->groups && machine) | 1527 | if (map->groups && machine) |
1528 | root_dir = machine->root_dir; | 1528 | root_dir = machine->root_dir; |
1529 | else | 1529 | else |
@@ -1532,7 +1532,7 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter) | |||
1532 | root_dir, self->long_name); | 1532 | root_dir, self->long_name); |
1533 | break; | 1533 | break; |
1534 | 1534 | ||
1535 | case DSO__ORIG_KMODULE: | 1535 | case SYMTAB__SYSTEM_PATH_KMODULE: |
1536 | snprintf(name, size, "%s%s", symbol_conf.symfs, | 1536 | snprintf(name, size, "%s%s", symbol_conf.symfs, |
1537 | self->long_name); | 1537 | self->long_name); |
1538 | break; | 1538 | break; |
@@ -1544,7 +1544,7 @@ int dso__load(struct dso *self, struct map *map, symbol_filter_t filter) | |||
1544 | */ | 1544 | */ |
1545 | if (want_symtab) { | 1545 | if (want_symtab) { |
1546 | want_symtab = 0; | 1546 | want_symtab = 0; |
1547 | self->origin = DSO__ORIG_BUILD_ID_CACHE; | 1547 | self->symtab_type = SYMTAB__BUILD_ID_CACHE; |
1548 | } else | 1548 | } else |
1549 | continue; | 1549 | continue; |
1550 | } | 1550 | } |
@@ -1757,9 +1757,9 @@ struct map *machine__new_module(struct machine *self, u64 start, | |||
1757 | return NULL; | 1757 | return NULL; |
1758 | 1758 | ||
1759 | if (machine__is_host(self)) | 1759 | if (machine__is_host(self)) |
1760 | dso->origin = DSO__ORIG_KMODULE; | 1760 | dso->symtab_type = SYMTAB__SYSTEM_PATH_KMODULE; |
1761 | else | 1761 | else |
1762 | dso->origin = DSO__ORIG_GUEST_KMODULE; | 1762 | dso->symtab_type = SYMTAB__GUEST_KMODULE; |
1763 | map_groups__insert(&self->kmaps, map); | 1763 | map_groups__insert(&self->kmaps, map); |
1764 | return map; | 1764 | return map; |
1765 | } | 1765 | } |
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 4d7ed09fe332..db39c0c63608 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h | |||
@@ -137,7 +137,7 @@ struct dso { | |||
137 | u8 annotate_warned:1; | 137 | u8 annotate_warned:1; |
138 | u8 sname_alloc:1; | 138 | u8 sname_alloc:1; |
139 | u8 lname_alloc:1; | 139 | u8 lname_alloc:1; |
140 | unsigned char origin; | 140 | unsigned char symtab_type; |
141 | u8 sorted_by_name; | 141 | u8 sorted_by_name; |
142 | u8 loaded; | 142 | u8 loaded; |
143 | u8 build_id[BUILD_ID_SIZE]; | 143 | u8 build_id[BUILD_ID_SIZE]; |
@@ -188,18 +188,18 @@ size_t dso__fprintf_buildid(struct dso *self, FILE *fp); | |||
188 | size_t dso__fprintf_symbols_by_name(struct dso *self, enum map_type type, FILE *fp); | 188 | size_t dso__fprintf_symbols_by_name(struct dso *self, enum map_type type, FILE *fp); |
189 | size_t dso__fprintf(struct dso *self, enum map_type type, FILE *fp); | 189 | size_t dso__fprintf(struct dso *self, enum map_type type, FILE *fp); |
190 | 190 | ||
191 | enum dso_origin { | 191 | enum symtab_type { |
192 | DSO__ORIG_KERNEL = 0, | 192 | SYMTAB__KALLSYMS = 0, |
193 | DSO__ORIG_GUEST_KERNEL, | 193 | SYMTAB__GUEST_KALLSYMS, |
194 | DSO__ORIG_JAVA_JIT, | 194 | SYMTAB__JAVA_JIT, |
195 | DSO__ORIG_BUILD_ID_CACHE, | 195 | SYMTAB__BUILD_ID_CACHE, |
196 | DSO__ORIG_FEDORA, | 196 | SYMTAB__FEDORA_DEBUGINFO, |
197 | DSO__ORIG_UBUNTU, | 197 | SYMTAB__UBUNTU_DEBUGINFO, |
198 | DSO__ORIG_BUILDID, | 198 | SYMTAB__BUILDID_DEBUGINFO, |
199 | DSO__ORIG_DSO, | 199 | SYMTAB__SYSTEM_PATH_DSO, |
200 | DSO__ORIG_GUEST_KMODULE, | 200 | SYMTAB__GUEST_KMODULE, |
201 | DSO__ORIG_KMODULE, | 201 | SYMTAB__SYSTEM_PATH_KMODULE, |
202 | DSO__ORIG_NOT_FOUND, | 202 | SYMTAB__NOT_FOUND, |
203 | }; | 203 | }; |
204 | 204 | ||
205 | char dso__symtab_origin(const struct dso *self); | 205 | char dso__symtab_origin(const struct dso *self); |