diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-02-22 14:15:39 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-02-25 06:27:17 -0500 |
commit | 3846df2e0a99a2bf10023de0e9c1496592012d4c (patch) | |
tree | d418f91907e7491047905272357cfb73ace2011d /tools/perf | |
parent | c7ad21af2c8b7accb893a576b100296c61c5d610 (diff) |
perf symbols: Improve debugging information about symtab origins
Be more clear about DSO long names and tell from which file
kernel symbols were obtained, all in --verbose mode:
[root@mica ~]# perf report -v > /dev/null
Looking at the vmlinux_path (5 entries long)
Using /lib/modules/2.6.33-rc8-tip-00777-g0918527-dirty/build/vmlinux for symbols
[root@mica ~]# mv /lib/modules/2.6.33-rc8-tip-00777-g0918527-dirty/build/vmlinux /tmp/dd
[root@mica ~]# perf report -v > /dev/null
Looking at the vmlinux_path (5 entries long)
Using /proc/kallsyms for symbols
[root@mica ~]#
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1266866139-6361-1-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/map.c | 5 | ||||
-rw-r--r-- | tools/perf/util/map.h | 2 | ||||
-rw-r--r-- | tools/perf/util/symbol.c | 16 | ||||
-rw-r--r-- | tools/perf/util/thread.c | 5 |
4 files changed, 21 insertions, 7 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index 138e3cb2b727..e509cd59c67d 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c | |||
@@ -5,6 +5,11 @@ | |||
5 | #include <stdio.h> | 5 | #include <stdio.h> |
6 | #include "debug.h" | 6 | #include "debug.h" |
7 | 7 | ||
8 | const char *map_type__name[MAP__NR_TYPES] = { | ||
9 | [MAP__FUNCTION] = "Functions", | ||
10 | [MAP__VARIABLE] = "Variables", | ||
11 | }; | ||
12 | |||
8 | static inline int is_anon_memory(const char *filename) | 13 | static inline int is_anon_memory(const char *filename) |
9 | { | 14 | { |
10 | return strcmp(filename, "//anon") == 0; | 15 | return strcmp(filename, "//anon") == 0; |
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h index 86f77cb1d060..b756368076c6 100644 --- a/tools/perf/util/map.h +++ b/tools/perf/util/map.h | |||
@@ -13,6 +13,8 @@ enum map_type { | |||
13 | 13 | ||
14 | #define MAP__NR_TYPES (MAP__VARIABLE + 1) | 14 | #define MAP__NR_TYPES (MAP__VARIABLE + 1) |
15 | 15 | ||
16 | extern const char *map_type__name[MAP__NR_TYPES]; | ||
17 | |||
16 | struct dso; | 18 | struct dso; |
17 | struct ref_reloc_sym; | 19 | struct ref_reloc_sym; |
18 | struct map_groups; | 20 | struct map_groups; |
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 320b15178e95..7aab4e5f3669 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -367,6 +367,10 @@ size_t dso__fprintf(struct dso *self, enum map_type type, FILE *fp) | |||
367 | struct rb_node *nd; | 367 | struct rb_node *nd; |
368 | size_t ret = fprintf(fp, "dso: %s (", self->short_name); | 368 | size_t ret = fprintf(fp, "dso: %s (", self->short_name); |
369 | 369 | ||
370 | if (self->short_name != self->long_name) | ||
371 | ret += fprintf(fp, "%s, ", self->long_name); | ||
372 | ret += fprintf(fp, "%s, %sloaded, ", map_type__name[type], | ||
373 | self->loaded ? "" : "NOT "); | ||
370 | ret += dso__fprintf_buildid(self, fp); | 374 | ret += dso__fprintf_buildid(self, fp); |
371 | ret += fprintf(fp, ")\n"); | 375 | ret += fprintf(fp, ")\n"); |
372 | for (nd = rb_first(&self->symbols[type]); nd; nd = rb_next(nd)) { | 376 | for (nd = rb_first(&self->symbols[type]); nd; nd = rb_next(nd)) { |
@@ -1580,6 +1584,9 @@ static int dso__load_vmlinux(struct dso *self, struct map *map, | |||
1580 | err = dso__load_sym(self, map, vmlinux, fd, filter, 0); | 1584 | err = dso__load_sym(self, map, vmlinux, fd, filter, 0); |
1581 | close(fd); | 1585 | close(fd); |
1582 | 1586 | ||
1587 | if (err > 0) | ||
1588 | pr_debug("Using %s for symbols\n", vmlinux); | ||
1589 | |||
1583 | return err; | 1590 | return err; |
1584 | } | 1591 | } |
1585 | 1592 | ||
@@ -1594,7 +1601,6 @@ int dso__load_vmlinux_path(struct dso *self, struct map *map, | |||
1594 | for (i = 0; i < vmlinux_path__nr_entries; ++i) { | 1601 | for (i = 0; i < vmlinux_path__nr_entries; ++i) { |
1595 | err = dso__load_vmlinux(self, map, vmlinux_path[i], filter); | 1602 | err = dso__load_vmlinux(self, map, vmlinux_path[i], filter); |
1596 | if (err > 0) { | 1603 | if (err > 0) { |
1597 | pr_debug("Using %s for symbols\n", vmlinux_path[i]); | ||
1598 | dso__set_long_name(self, strdup(vmlinux_path[i])); | 1604 | dso__set_long_name(self, strdup(vmlinux_path[i])); |
1599 | break; | 1605 | break; |
1600 | } | 1606 | } |
@@ -1661,12 +1667,16 @@ static int dso__load_kernel_sym(struct dso *self, struct map *map, | |||
1661 | 1667 | ||
1662 | if (asprintf(&kallsyms_allocated_filename, | 1668 | if (asprintf(&kallsyms_allocated_filename, |
1663 | "%s/.debug/[kernel.kallsyms]/%s", | 1669 | "%s/.debug/[kernel.kallsyms]/%s", |
1664 | getenv("HOME"), sbuild_id) == -1) | 1670 | getenv("HOME"), sbuild_id) == -1) { |
1671 | pr_err("Not enough memory for kallsyms file lookup\n"); | ||
1665 | return -1; | 1672 | return -1; |
1673 | } | ||
1666 | 1674 | ||
1667 | kallsyms_filename = kallsyms_allocated_filename; | 1675 | kallsyms_filename = kallsyms_allocated_filename; |
1668 | 1676 | ||
1669 | if (access(kallsyms_filename, F_OK)) { | 1677 | if (access(kallsyms_filename, F_OK)) { |
1678 | pr_err("No kallsyms or vmlinux with build-id %s " | ||
1679 | "was found\n", sbuild_id); | ||
1670 | free(kallsyms_allocated_filename); | 1680 | free(kallsyms_allocated_filename); |
1671 | return -1; | 1681 | return -1; |
1672 | } | 1682 | } |
@@ -1680,6 +1690,8 @@ static int dso__load_kernel_sym(struct dso *self, struct map *map, | |||
1680 | 1690 | ||
1681 | do_kallsyms: | 1691 | do_kallsyms: |
1682 | err = dso__load_kallsyms(self, kallsyms_filename, map, filter); | 1692 | err = dso__load_kallsyms(self, kallsyms_filename, map, filter); |
1693 | if (err > 0) | ||
1694 | pr_debug("Using %s for symbols\n", kallsyms_filename); | ||
1683 | free(kallsyms_allocated_filename); | 1695 | free(kallsyms_allocated_filename); |
1684 | 1696 | ||
1685 | out_try_fixup: | 1697 | out_try_fixup: |
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c index 9e8995eaf2b6..c090654cb6c0 100644 --- a/tools/perf/util/thread.c +++ b/tools/perf/util/thread.c | |||
@@ -53,11 +53,6 @@ int thread__comm_len(struct thread *self) | |||
53 | return self->comm_len; | 53 | return self->comm_len; |
54 | } | 54 | } |
55 | 55 | ||
56 | static const char *map_type__name[MAP__NR_TYPES] = { | ||
57 | [MAP__FUNCTION] = "Functions", | ||
58 | [MAP__VARIABLE] = "Variables", | ||
59 | }; | ||
60 | |||
61 | static size_t __map_groups__fprintf_maps(struct map_groups *self, | 56 | static size_t __map_groups__fprintf_maps(struct map_groups *self, |
62 | enum map_type type, FILE *fp) | 57 | enum map_type type, FILE *fp) |
63 | { | 58 | { |