• Namhyung Kim's avatar
    perf report: Add 'symoff' sort key · e2c1c8ff
    Namhyung Kim authored
    The symoff sort key is to print symbol and offset of sample.  This is
    useful for data type profiling to show exact instruction in the function
    which refers the data.
    
      $ perf report -s type,sym,typeoff,symoff --hierarchy
      ...
      #       Overhead  Data Type / Symbol / Data Type Offset / Symbol Offset
      # ..............  .....................................................
      #
          1.23%         struct cfs_rq
            0.84%         update_blocked_averages
              0.19%         struct cfs_rq +336 (leaf_cfs_rq_list.next)
                 0.19%         [k] update_blocked_averages+0x96
              0.19%         struct cfs_rq +0 (load.weight)
                 0.14%         [k] update_blocked_averages+0x104
                 0.04%         [k] update_blocked_averages+0x31c
              0.17%         struct cfs_rq +404 (throttle_count)
                 0.12%         [k] update_blocked_averages+0x9d
                 0.05%         [k] update_blocked_averages+0x1f9
              0.08%         struct cfs_rq +272 (propagate)
                 0.07%         [k] update_blocked_averages+0x3d3
                 0.02%         [k] update_blocked_averages+0x45b
      ...
    
    Committer testing:
    
      # perf report --stdio -s type,typeoff,symoff
      # To display the perf.data header info, please use --header/--header-only options.
      #
      #
      # Total Lost Samples: 0
      #
      # Samples: 4  of event 'cpu_atom/mem-loads,ldlat=30/P'
      # Event count (approx.): 7
      #
      # Overhead  Data Type  Data Type Offset  Symbol Offset
      # ........  .........  ................  .............
      #
          42.86%  struct list_head  struct list_head +8 (prev)  [k] __list_del_entry_valid_or_report+0x7
          28.57%  (unknown)  (unknown) +0 (no field)  [.] _nl_intern_locale_data+0x25
          14.29%  char       char +0 (no field)  [k] strncpy_from_user+0xa5
          14.29%  (unknown)  (unknown) +0 (no field)  [.] _dl_lookup_symbol_x+0x50
    
      #
      # (Tip: To change sampling frequency to 100 Hz: perf record -F 100)
      #
    Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
    Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Ian Rogers <irogers@google.com>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Stephane Eranian <eranian@google.com>
    Cc: linux-toolchains@vger.kernel.org
    Cc: linux-trace-devel@vger.kernel.org
    Link: https://lore.kernel.org/r/20231213001323.718046-14-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    e2c1c8ff
hist.h 17.1 KB