• Anshuman Khandual's avatar
    powerpc/perf: Ignore separate BHRB privilege state filter request · 7689bdca
    Anshuman Khandual authored
    Completely ignore BHRB privilege state filter request as we are
    already configuring that with privilege state filtering attribute
    for the accompanying PMU event. This would help achieve cleaner
    user space interaction for BHRB.
    
    This patch fixes a situation like this
    
    Before patch:-
    ------------
    ./perf record -j any -e branch-misses:k ls
    Error:
    The sys_perf_event_open() syscall returned with 95 (Operation not
    supported) for event (branch-misses:k).
    /bin/dmesg may provide additional information.
    No CONFIG_PERF_EVENTS=y kernel support configured?
    
    Here 'perf record' actually copies over ':k' filter request into BHRB
    privilege state filter config and our previous check in kernel would
    fail that.
    
    After patch:-
    -------------
    ./perf record -j any -e branch-misses:k ls
    perf  perf.data  perf.data.old  test-mmap-ring
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Captured and wrote 0.002 MB perf.data (~102 samples)]
    Signed-off-by: default avatarAnshuman Khandual <khandual@linux.vnet.ibm.com>
    Acked-by: default avatarMichael Neuling <mikey@neuling.org>
    Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    7689bdca
power8-pmu.c 18.8 KB