perf machine: Do not require /lib/modules/* on a guest
authorJason Wessel <[email protected]>
Mon, 15 Jul 2013 20:27:53 +0000 (15:27 -0500)
committerArnaldo Carvalho de Melo <[email protected]>
Wed, 7 Aug 2013 20:35:41 +0000 (17:35 -0300)
For some types of work loads and special guest environments, you might
have a kernel that has no kernel modules.  The perf kvm record tool
fails instantiate vmlinux maps when the kernel modules directory cannot
be opened, even though the kallsyms has been properly processed.  This
leads to a perf kvm report that has no guest symbols resolved.

This patch changes the failure to locate kernel modules to be non-fatal.

Signed-off-by: Jason Wessel <[email protected]>
Acked-by: David Ahern <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/util/machine.c

index ef3b49cde04e6797bf0964c48886f70c51fc8874..6fcc358138aeeab27fb0e60ae8db5574025bc422 100644 (file)
@@ -806,7 +806,10 @@ static int machine__create_modules(struct machine *machine)
        free(line);
        fclose(file);
 
-       return machine__set_modules_path(machine);
+       if (machine__set_modules_path(machine) < 0) {
+               pr_debug("Problems setting modules path maps, continuing anyway...\n");
+       }
+       return 0;
 
 out_delete_line:
        free(line);