瀏覽代碼

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>
Alexandru-Cezar Sardan 11 年之前
父節點
當前提交
0d7d9b3a45
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      arch/powerpc/perf/core-fsl-emb.c

+ 3 - 1
arch/powerpc/perf/core-fsl-emb.c

@@ -330,9 +330,11 @@ static int fsl_emb_pmu_add(struct perf_event *event, int flags)
 	}
 	}
 	local64_set(&event->hw.prev_count, val);
 	local64_set(&event->hw.prev_count, val);
 
 
-	if (!(flags & PERF_EF_START)) {
+	if (unlikely(!(flags & PERF_EF_START))) {
 		event->hw.state = PERF_HES_STOPPED | PERF_HES_UPTODATE;
 		event->hw.state = PERF_HES_STOPPED | PERF_HES_UPTODATE;
 		val = 0;
 		val = 0;
+	} else {
+		event->hw.state &= ~(PERF_HES_STOPPED | PERF_HES_UPTODATE);
 	}
 	}
 
 
 	write_pmc(i, val);
 	write_pmc(i, val);