diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/symbol.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index fd3d9c8e90fc..559fb06210f5 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
@@ -833,7 +833,7 @@ int dso__load_modules(struct dso *self, symbol_filter_t filter, int v) | |||
833 | struct mod_dso *mods = mod_dso__new_dso("modules"); | 833 | struct mod_dso *mods = mod_dso__new_dso("modules"); |
834 | struct module *pos; | 834 | struct module *pos; |
835 | struct rb_node *next; | 835 | struct rb_node *next; |
836 | int err; | 836 | int err, count = 0; |
837 | 837 | ||
838 | err = mod_dso__load_modules(mods); | 838 | err = mod_dso__load_modules(mods); |
839 | 839 | ||
@@ -852,14 +852,16 @@ int dso__load_modules(struct dso *self, symbol_filter_t filter, int v) | |||
852 | break; | 852 | break; |
853 | 853 | ||
854 | next = rb_next(&pos->rb_node); | 854 | next = rb_next(&pos->rb_node); |
855 | count += err; | ||
855 | } | 856 | } |
856 | 857 | ||
857 | if (err < 0) { | 858 | if (err < 0) { |
858 | mod_dso__delete_modules(mods); | 859 | mod_dso__delete_modules(mods); |
859 | mod_dso__delete_self(mods); | 860 | mod_dso__delete_self(mods); |
861 | return err; | ||
860 | } | 862 | } |
861 | 863 | ||
862 | return err; | 864 | return count; |
863 | } | 865 | } |
864 | 866 | ||
865 | static inline void dso__fill_symbol_holes(struct dso *self) | 867 | static inline void dso__fill_symbol_holes(struct dso *self) |
@@ -913,8 +915,15 @@ int dso__load_kernel(struct dso *self, const char *vmlinux, | |||
913 | 915 | ||
914 | if (vmlinux) { | 916 | if (vmlinux) { |
915 | err = dso__load_vmlinux(self, vmlinux, filter, v); | 917 | err = dso__load_vmlinux(self, vmlinux, filter, v); |
916 | if (err > 0 && use_modules) | 918 | if (err > 0 && use_modules) { |
917 | err = dso__load_modules(self, filter, v); | 919 | int syms = dso__load_modules(self, filter, v); |
920 | |||
921 | if (syms < 0) { | ||
922 | fprintf(stderr, "dso__load_modules failed!\n"); | ||
923 | return syms; | ||
924 | } | ||
925 | err += syms; | ||
926 | } | ||
918 | } | 927 | } |
919 | 928 | ||
920 | if (err <= 0) | 929 | if (err <= 0) |