Message ID | 20201021085329.384535-4-maddy@linux.ibm.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | [1/5] powerpc/perf: Add new power pmu flag "PPMU_P10_DD1" for power10 DD1 | expand |
Context | Check | Description |
---|---|---|
snowpatch_ozlabs/apply_patch | success | Successfully applied on branch powerpc/merge (598b738031de83cadbcf745ad0ad2bd69a0ee012) |
snowpatch_ozlabs/checkpatch | success | |
snowpatch_ozlabs/needsstable | success | Patch has no Fixes tags |
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c index 6be0349e01ad..e675c7c8ce0e 100644 --- a/arch/powerpc/perf/core-book3s.c +++ b/arch/powerpc/perf/core-book3s.c @@ -2142,6 +2142,18 @@ static void record_and_restart(struct perf_event *event, unsigned long val, local64_set(&event->hw.period_left, left); perf_event_update_userpage(event); + /* + * Setting exclude_kernel will only freeze the + * Performance Monitor counters and we may have + * kernel address captured in SIAR. Hence drop + * the kernel sample captured during user space + * profiling. Setting `record` to zero will also + * make sure event throlling is handled. + */ + if (event->attr.exclude_kernel && record) + if (is_kernel_addr(mfspr(SPRN_SIAR))) + record = 0; + /* * Finally record data if requested. */