• Arnaldo Carvalho de Melo's avatar
    perf symbols: Don't try to find a vmlinux file when looking for kernel modules · b5c09518
    Arnaldo Carvalho de Melo authored
    The dso->kernel value is now set to everything that is in
    machine->kmaps, but that was being used to decide if vmlinux lookup is
    needed, which ended up making that lookup be made for kernel modules,
    that now have dso->kernel set, leading to these kinds of warnings when
    running on a machine with compressed kernel modules, like fedora:31:
    
      [root@five ~]# perf record -F 10000 -a sleep 2
      [ perf record: Woken up 1 times to write data ]
      lzma: fopen failed on vmlinux: 'No such file or directory'
      lzma: fopen failed on /boot/vmlinux: 'No such file or directory'
      lzma: fopen failed on /boot/vmlinux-5.5.5-200.fc31.x86_64: 'No such file or directory'
      lzma: fopen failed on /usr/lib/debug/boot/vmlinux-5.5.5-200.fc31.x86_64: 'No such file or directory'
      lzma: fopen failed on /lib/modules/5.5.5-200.fc31.x86_64/build/vmlinux: 'No such file or directory'
      lzma: fopen failed on vmlinux: 'No such file or directory'
      lzma: fopen failed on /boot/vmlinux: 'No such file or directory'
      lzma: fopen failed on /boot/vmlinux-5.5.5-200.fc31.x86_64: 'No such file or directory'
      lzma: fopen failed on /usr/lib/debug/boot/vmlinux-5.5.5-200.fc31.x86_64: 'No such file or directory'
      lzma: fopen failed on /lib/modules/5.5.5-200.fc31.x86_64/build/vmlinux: 'No such file or directory'
      lzma: fopen failed on vmlinux: 'No such file or directory'
      lzma: fopen failed on /boot/vmlinux: 'No such file or directory'
      lzma: fopen failed on /boot/vmlinux-5.5.5-200.fc31.x86_64: 'No such file or directory'
      lzma: fopen failed on /usr/lib/debug/boot/vmlinux-5.5.5-200.fc31.x86_64: 'No such file or directory'
      lzma: fopen failed on /lib/modules/5.5.5-200.fc31.x86_64/build/vmlinux: 'No such file or directory'
      lzma: fopen failed on vmlinux: 'No such file or directory'
      lzma: fopen failed on /boot/vmlinux: 'No such file or directory'
      lzma: fopen failed on /boot/vmlinux-5.5.5-200.fc31.x86_64: 'No such file or directory'
      lzma: fopen failed on /usr/lib/debug/boot/vmlinux-5.5.5-200.fc31.x86_64: 'No such file or directory'
      lzma: fopen failed on /lib/modules/5.5.5-200.fc31.x86_64/build/vmlinux: 'No such file or directory'
      lzma: fopen failed on vmlinux: 'No such file or directory'
      lzma: fopen failed on /boot/vmlinux: 'No such file or directory'
      lzma: fopen failed on /boot/vmlinux-5.5.5-200.fc31.x86_64: 'No such file or directory'
      lzma: fopen failed on /usr/lib/debug/boot/vmlinux-5.5.5-200.fc31.x86_64: 'No such file or directory'
      lzma: fopen failed on /lib/modules/5.5.5-200.fc31.x86_64/build/vmlinux: 'No such file or directory'
      [ perf record: Captured and wrote 1.024 MB perf.data (1366 samples) ]
      [root@five ~]#
    
    This happens when collecting the buildid, when we find samples for
    kernel modules, fix it by checking if the looked up DSO is a kernel
    module by other means.
    
    Fixes: 02213cec ("perf maps: Mark module DSOs with kernel type")
    Tested-by: default avatarJiri Olsa <jolsa@redhat.com>
    Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
    Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
    Cc: Kim Phillips <kim.phillips@amd.com>
    Cc: Michael Petlan <mpetlan@redhat.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
    Link: http://lore.kernel.org/lkml/20200302191007.GD10335@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    b5c09518
symbol.c 54.1 KB