Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf/powerpc: reset event hw state when adding it to the PMU

When adding an event to the PMU with PERF_EF_START the STOPPED and UPTODATE
flags need to be cleared in the hw.event status variable because they are
preventing the update of the event count on overflow interrupt.

Signed-off-by: Alexandru-Cezar Sardan <alexandru.sardan@freescale.com>
Signed-off-by: Scott Wood <scottwood@freescale.com>

authored by

Alexandru-Cezar Sardan and committed by
Scott Wood
0d7d9b3a 5db43128

+3 -1
+3 -1
arch/powerpc/perf/core-fsl-emb.c
··· 330 330 } 331 331 local64_set(&event->hw.prev_count, val); 332 332 333 - if (!(flags & PERF_EF_START)) { 333 + if (unlikely(!(flags & PERF_EF_START))) { 334 334 event->hw.state = PERF_HES_STOPPED | PERF_HES_UPTODATE; 335 335 val = 0; 336 + } else { 337 + event->hw.state &= ~(PERF_HES_STOPPED | PERF_HES_UPTODATE); 336 338 } 337 339 338 340 write_pmc(i, val);