diff options
author | Anshuman Khandual <khandual@linux.vnet.ibm.com> | 2013-06-10 01:53:28 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-07-24 00:42:31 -0400 |
commit | 7689bdcab1dca061c4c91f0e1703cef1b7b67e71 (patch) | |
tree | 96995e475dbe8601429008133d000e84c11c3d64 | |
parent | 679750054ae8129a536734bccf526ff6da35376a (diff) |
powerpc/perf: Ignore separate BHRB privilege state filter request
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: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Acked-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/perf/power8-pmu.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/arch/powerpc/perf/power8-pmu.c b/arch/powerpc/perf/power8-pmu.c index 09def196f5c4..7466374d2787 100644 --- a/arch/powerpc/perf/power8-pmu.c +++ b/arch/powerpc/perf/power8-pmu.c | |||
@@ -561,18 +561,13 @@ static int power8_generic_events[] = { | |||
561 | static u64 power8_bhrb_filter_map(u64 branch_sample_type) | 561 | static u64 power8_bhrb_filter_map(u64 branch_sample_type) |
562 | { | 562 | { |
563 | u64 pmu_bhrb_filter = 0; | 563 | u64 pmu_bhrb_filter = 0; |
564 | u64 br_privilege = branch_sample_type & ONLY_PLM; | ||
565 | 564 | ||
566 | /* BHRB and regular PMU events share the same prvillege state | 565 | /* BHRB and regular PMU events share the same privilege state |
567 | * filter configuration. BHRB is always recorded along with a | 566 | * filter configuration. BHRB is always recorded along with a |
568 | * regular PMU event. So privilege state filter criteria for BHRB | 567 | * regular PMU event. As the privilege state filter is handled |
569 | * and the companion PMU events has to be the same. As a default | 568 | * in the basic PMC configuration of the accompanying regular |
570 | * "perf record" tool sets all privillege bits ON when no filter | 569 | * PMU event, we ignore any separate BHRB specific request. |
571 | * criteria is provided in the command line. So as along as all | ||
572 | * privillege bits are ON or they are OFF, we are good to go. | ||
573 | */ | 570 | */ |
574 | if ((br_privilege != 7) && (br_privilege != 0)) | ||
575 | return -1; | ||
576 | 571 | ||
577 | /* No branch filter requested */ | 572 | /* No branch filter requested */ |
578 | if (branch_sample_type & PERF_SAMPLE_BRANCH_ANY) | 573 | if (branch_sample_type & PERF_SAMPLE_BRANCH_ANY) |