Skip to content
  • Adrian Hunter's avatar
    0affd0e5
    perf symbols: Fix kernel maps for kcore and eBPF · 0affd0e5
    Adrian Hunter authored
    
    
    Adjust 'map->pgoff' also when moving a map's start address.
    
    Example with v5.4.34 based kernel:
    
      Before:
    
        $ sudo tools/perf/perf record -a --kcore -e intel_pt//k sleep 1
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 1.958 MB perf.data ]
        $ sudo tools/perf/perf script --itrace=e >/dev/null
        Warning:
        961 instruction trace errors
    
      After:
    
        $ sudo tools/perf/perf script --itrace=e >/dev/null
        $
    
    Committer testing:
    
      # uname -a
      Linux seventh 5.6.10-100.fc30.x86_64 #1 SMP Mon May 4 15:36:44 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
      #
    
    Before:
    
      # perf record -a --kcore -e intel_pt//k sleep 1
      [ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 0.923 MB perf.data ]
      # perf script --itrace=e >/dev/null
      Warning:
      295 instruction trace errors
      #
    
    After:
    
      # perf record -a --kcore -e intel_pt//k sleep 1
      [ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 0.919 MB perf.data ]
      # perf script --itrace=e >/dev/null
      #
    
    Fixes: fb5a88d4 ("perf tools: Preserve eBPF maps when loading kcore")
    Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
    Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: stable@vger.kernel.org
    Link: http://lore.kernel.org/lkml/20200602112505.1406-1-adrian.hunter@intel.com
    
    
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    0affd0e5
    perf symbols: Fix kernel maps for kcore and eBPF
    Adrian Hunter authored
    
    
    Adjust 'map->pgoff' also when moving a map's start address.
    
    Example with v5.4.34 based kernel:
    
      Before:
    
        $ sudo tools/perf/perf record -a --kcore -e intel_pt//k sleep 1
        [ perf record: Woken up 1 times to write data ]
        [ perf record: Captured and wrote 1.958 MB perf.data ]
        $ sudo tools/perf/perf script --itrace=e >/dev/null
        Warning:
        961 instruction trace errors
    
      After:
    
        $ sudo tools/perf/perf script --itrace=e >/dev/null
        $
    
    Committer testing:
    
      # uname -a
      Linux seventh 5.6.10-100.fc30.x86_64 #1 SMP Mon May 4 15:36:44 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
      #
    
    Before:
    
      # perf record -a --kcore -e intel_pt//k sleep 1
      [ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 0.923 MB perf.data ]
      # perf script --itrace=e >/dev/null
      Warning:
      295 instruction trace errors
      #
    
    After:
    
      # perf record -a --kcore -e intel_pt//k sleep 1
      [ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 0.919 MB perf.data ]
      # perf script --itrace=e >/dev/null
      #
    
    Fixes: fb5a88d4 ("perf tools: Preserve eBPF maps when loading kcore")
    Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
    Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: stable@vger.kernel.org
    Link: http://lore.kernel.org/lkml/20200602112505.1406-1-adrian.hunter@intel.com
    
    
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Loading