• Namhyung Kim's avatar
    perf tools: Add 'addr' sort key · 762461f1
    Namhyung Kim authored
    Sometimes users want to see actual (virtual) address of sampled instructions.
    Add a new 'addr' sort key to display the raw addresses.
    
      $ perf record -o- true | perf report -i- -s addr
      # To display the perf.data header info, please use --header/--header-only options.
      #
      [ perf record: Woken up 1 times to write data ]
      [ perf record: Captured and wrote 0.000 MB - ]
      #
      # Total Lost Samples: 0
      #
      # Samples: 12  of event 'cycles:u'
      # Event count (approx.): 252512
      #
      # Overhead  Address
      # ........  ..................
      #
          42.96%  0x7f96f08443d7
          29.55%  0x7f96f0859b50
          14.76%  0x7f96f0852e02
           8.30%  0x7f96f0855028
           4.43%  0xffffffff8de01087
    
    Note that it just compares and displays the sample ip.  Each process can
    have a different memory layout and the ip will be different even if they run
    the same binary.  So this sort key is mostly meaningful for per-process
    profile data.
    Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
    Acked-by: default avatarIan Rogers <irogers@google.com>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Stephane Eranian <eranian@google.com>
    Link: https://lore.kernel.org/r/20220923173142.805896-4-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    762461f1
sort.h 7.27 KB