Merge branch 'bind_unbind' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[GitHub/LineageOS/android_kernel_motorola_exynos9610.git] / tools / perf / util / machine.c
index d97e014c3df395e51e61da31f9624e12927a43b2..5de2b86b9880c88a7570674688cfaba50744b5ed 100644 (file)
@@ -572,16 +572,7 @@ static struct dso *machine__findnew_module_dso(struct machine *machine,
                if (dso == NULL)
                        goto out_unlock;
 
-               if (machine__is_host(machine))
-                       dso->symtab_type = DSO_BINARY_TYPE__SYSTEM_PATH_KMODULE;
-               else
-                       dso->symtab_type = DSO_BINARY_TYPE__GUEST_KMODULE;
-
-               /* _KMODULE_COMP should be next to _KMODULE */
-               if (m->kmod && m->comp)
-                       dso->symtab_type++;
-
-               dso__set_short_name(dso, strdup(m->name), true);
+               dso__set_module_info(dso, m, machine);
                dso__set_long_name(dso, strdup(filename), true);
        }
 
@@ -1218,10 +1209,12 @@ int machine__create_kernel_maps(struct machine *machine)
         */
        map_groups__fixup_end(&machine->kmaps);
 
-       if (machine__get_running_kernel_start(machine, &name, &addr)) {
-       } else if (maps__set_kallsyms_ref_reloc_sym(machine->vmlinux_maps, name, addr)) {
-               machine__destroy_kernel_maps(machine);
-               return -1;
+       if (!machine__get_running_kernel_start(machine, &name, &addr)) {
+               if (name &&
+                   maps__set_kallsyms_ref_reloc_sym(machine->vmlinux_maps, name, addr)) {
+                       machine__destroy_kernel_maps(machine);
+                       return -1;
+               }
        }
 
        return 0;