diff options
Diffstat (limited to 'tools/perf/util')
| -rw-r--r-- | tools/perf/util/probe-event.c | 15 | ||||
| -rw-r--r-- | tools/perf/util/symbol.c | 4 | ||||
| -rw-r--r-- | tools/perf/util/symbol.h | 2 |
3 files changed, 16 insertions, 5 deletions
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index 3b6a5297bf1..b71acd6423c 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c | |||
| @@ -114,6 +114,8 @@ static struct symbol *__find_kernel_function_by_name(const char *name, | |||
| 114 | const char *kernel_get_module_path(const char *module) | 114 | const char *kernel_get_module_path(const char *module) |
| 115 | { | 115 | { |
| 116 | struct dso *dso; | 116 | struct dso *dso; |
| 117 | struct map *map; | ||
| 118 | const char *vmlinux_name; | ||
| 117 | 119 | ||
| 118 | if (module) { | 120 | if (module) { |
| 119 | list_for_each_entry(dso, &machine.kernel_dsos, node) { | 121 | list_for_each_entry(dso, &machine.kernel_dsos, node) { |
| @@ -123,10 +125,17 @@ const char *kernel_get_module_path(const char *module) | |||
| 123 | } | 125 | } |
| 124 | pr_debug("Failed to find module %s.\n", module); | 126 | pr_debug("Failed to find module %s.\n", module); |
| 125 | return NULL; | 127 | return NULL; |
| 128 | } | ||
| 129 | |||
| 130 | map = machine.vmlinux_maps[MAP__FUNCTION]; | ||
| 131 | dso = map->dso; | ||
| 132 | |||
| 133 | vmlinux_name = symbol_conf.vmlinux_name; | ||
| 134 | if (vmlinux_name) { | ||
| 135 | if (dso__load_vmlinux(dso, map, vmlinux_name, NULL) <= 0) | ||
| 136 | return NULL; | ||
| 126 | } else { | 137 | } else { |
| 127 | dso = machine.vmlinux_maps[MAP__FUNCTION]->dso; | 138 | if (dso__load_vmlinux_path(dso, map, NULL) < 0) { |
| 128 | if (dso__load_vmlinux_path(dso, | ||
| 129 | machine.vmlinux_maps[MAP__FUNCTION], NULL) < 0) { | ||
| 130 | pr_debug("Failed to load kernel map.\n"); | 139 | pr_debug("Failed to load kernel map.\n"); |
| 131 | return NULL; | 140 | return NULL; |
| 132 | } | 141 | } |
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index d628c8d1cf5..439ab947daf 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
| @@ -1780,8 +1780,8 @@ out_failure: | |||
| 1780 | return -1; | 1780 | return -1; |
| 1781 | } | 1781 | } |
| 1782 | 1782 | ||
| 1783 | static int dso__load_vmlinux(struct dso *self, struct map *map, | 1783 | int dso__load_vmlinux(struct dso *self, struct map *map, |
| 1784 | const char *vmlinux, symbol_filter_t filter) | 1784 | const char *vmlinux, symbol_filter_t filter) |
| 1785 | { | 1785 | { |
| 1786 | int err = -1, fd; | 1786 | int err = -1, fd; |
| 1787 | 1787 | ||
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 038f2201ee0..6c6eafdb932 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h | |||
| @@ -166,6 +166,8 @@ void dso__sort_by_name(struct dso *self, enum map_type type); | |||
| 166 | struct dso *__dsos__findnew(struct list_head *head, const char *name); | 166 | struct dso *__dsos__findnew(struct list_head *head, const char *name); |
| 167 | 167 | ||
| 168 | int dso__load(struct dso *self, struct map *map, symbol_filter_t filter); | 168 | int dso__load(struct dso *self, struct map *map, symbol_filter_t filter); |
| 169 | int dso__load_vmlinux(struct dso *self, struct map *map, | ||
| 170 | const char *vmlinux, symbol_filter_t filter); | ||
| 169 | int dso__load_vmlinux_path(struct dso *self, struct map *map, | 171 | int dso__load_vmlinux_path(struct dso *self, struct map *map, |
| 170 | symbol_filter_t filter); | 172 | symbol_filter_t filter); |
| 171 | int dso__load_kallsyms(struct dso *self, const char *filename, struct map *map, | 173 | int dso__load_kallsyms(struct dso *self, const char *filename, struct map *map, |
