diff options
Diffstat (limited to 'tools/perf/util/symbol.c')
-rw-r--r-- | tools/perf/util/symbol.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index ea62ecd191fa..04300dd5221f 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -917,6 +917,10 @@ int dso__load_vmlinux(struct dso *dso, struct map *map, | |||
917 | symsrc__destroy(&ss); | 917 | symsrc__destroy(&ss); |
918 | 918 | ||
919 | if (err > 0) { | 919 | if (err > 0) { |
920 | if (dso->kernel == DSO_TYPE_GUEST_KERNEL) | ||
921 | dso->data_type = DSO_BINARY_TYPE__GUEST_VMLINUX; | ||
922 | else | ||
923 | dso->data_type = DSO_BINARY_TYPE__VMLINUX; | ||
920 | dso__set_long_name(dso, (char *)vmlinux); | 924 | dso__set_long_name(dso, (char *)vmlinux); |
921 | dso__set_loaded(dso, map->type); | 925 | dso__set_loaded(dso, map->type); |
922 | pr_debug("Using %s for symbols\n", symfs_vmlinux); | 926 | pr_debug("Using %s for symbols\n", symfs_vmlinux); |
@@ -989,7 +993,7 @@ static int dso__load_kernel_sym(struct dso *dso, struct map *map, | |||
989 | dso__set_long_name(dso, | 993 | dso__set_long_name(dso, |
990 | strdup(symbol_conf.vmlinux_name)); | 994 | strdup(symbol_conf.vmlinux_name)); |
991 | dso->lname_alloc = 1; | 995 | dso->lname_alloc = 1; |
992 | goto out_fixup; | 996 | return err; |
993 | } | 997 | } |
994 | return err; | 998 | return err; |
995 | } | 999 | } |
@@ -997,7 +1001,7 @@ static int dso__load_kernel_sym(struct dso *dso, struct map *map, | |||
997 | if (vmlinux_path != NULL) { | 1001 | if (vmlinux_path != NULL) { |
998 | err = dso__load_vmlinux_path(dso, map, filter); | 1002 | err = dso__load_vmlinux_path(dso, map, filter); |
999 | if (err > 0) | 1003 | if (err > 0) |
1000 | goto out_fixup; | 1004 | return err; |
1001 | } | 1005 | } |
1002 | 1006 | ||
1003 | /* do not try local files if a symfs was given */ | 1007 | /* do not try local files if a symfs was given */ |
@@ -1058,7 +1062,6 @@ do_kallsyms: | |||
1058 | 1062 | ||
1059 | if (err > 0) { | 1063 | if (err > 0) { |
1060 | dso__set_long_name(dso, strdup("[kernel.kallsyms]")); | 1064 | dso__set_long_name(dso, strdup("[kernel.kallsyms]")); |
1061 | out_fixup: | ||
1062 | map__fixup_start(map); | 1065 | map__fixup_start(map); |
1063 | map__fixup_end(map); | 1066 | map__fixup_end(map); |
1064 | } | 1067 | } |
@@ -1089,7 +1092,7 @@ static int dso__load_guest_kernel_sym(struct dso *dso, struct map *map, | |||
1089 | if (symbol_conf.default_guest_vmlinux_name != NULL) { | 1092 | if (symbol_conf.default_guest_vmlinux_name != NULL) { |
1090 | err = dso__load_vmlinux(dso, map, | 1093 | err = dso__load_vmlinux(dso, map, |
1091 | symbol_conf.default_guest_vmlinux_name, filter); | 1094 | symbol_conf.default_guest_vmlinux_name, filter); |
1092 | goto out_try_fixup; | 1095 | return err; |
1093 | } | 1096 | } |
1094 | 1097 | ||
1095 | kallsyms_filename = symbol_conf.default_guest_kallsyms; | 1098 | kallsyms_filename = symbol_conf.default_guest_kallsyms; |
@@ -1101,15 +1104,10 @@ static int dso__load_guest_kernel_sym(struct dso *dso, struct map *map, | |||
1101 | } | 1104 | } |
1102 | 1105 | ||
1103 | err = dso__load_kallsyms(dso, kallsyms_filename, map, filter); | 1106 | err = dso__load_kallsyms(dso, kallsyms_filename, map, filter); |
1104 | if (err > 0) | ||
1105 | pr_debug("Using %s for symbols\n", kallsyms_filename); | ||
1106 | |||
1107 | out_try_fixup: | ||
1108 | if (err > 0) { | 1107 | if (err > 0) { |
1109 | if (kallsyms_filename != NULL) { | 1108 | pr_debug("Using %s for symbols\n", kallsyms_filename); |
1110 | machine__mmap_name(machine, path, sizeof(path)); | 1109 | machine__mmap_name(machine, path, sizeof(path)); |
1111 | dso__set_long_name(dso, strdup(path)); | 1110 | dso__set_long_name(dso, strdup(path)); |
1112 | } | ||
1113 | map__fixup_start(map); | 1111 | map__fixup_start(map); |
1114 | map__fixup_end(map); | 1112 | map__fixup_end(map); |
1115 | } | 1113 | } |