• Anjali K's avatar
    powerpc/perf: Set cpumode flags using sample address · 0300a92e
    Anjali K authored
    Currently in some cases, when the sampled instruction address register
    latches to a specific address during sampling, the privilege bits
    captured in the sampled event register are incorrect.
    
    For example, a snippet from the perf report on a power10 system is:
    
      Overhead  Address             Command       Shared Object      Symbol
      ........  ..................  ............  .................  .......................
           2.41%  0x7fff9f94a02c      null_syscall  [unknown]          [k] 0x00007fff9f94a02c
           2.20%  0x7fff9f94a02c      null_syscall  libc.so.6          [.] syscall
    
    perf_get_misc_flags() function looks at the privilege bits to return
    the corresponding flags to be used for the address symbol and these
    privilege bit details are read from the sampled event register. In the
    above snippet, address "0x00007fff9f94a02c" is shown as "k" (kernel) due
    to the incorrect privilege bits captured in the sampled event register.
    
    To address this case check whether the sampled address is in the kernel
    area. Since this is specific to the latest platform, a new pmu flag
    is added called "PPMU_P10" and is used to contain the proposed fix.
    PPMU_P10_DD1 marked events are also included under PPMU_P10, hence
    remove the code specific to PPMU_P10_DD1 marked events.
    Signed-off-by: default avatarAnjali K <anjalik@linux.ibm.com>
    Reviewed-by: default avatarAthira Rajeev &lt;atrajeev@linux.vnet.ibm.com <mailto:atrajeev@linux.vnet.ibm.com&gt;>
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    Link: https://msgid.link/20240528040356.2722275-1-anjalik@linux.ibm.com
    0300a92e
core-book3s.c 66.6 KB