lkml.org 
[lkml]   [2010]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/5] MIPS/Perf-events: Check event state in validate_event()
Date
Ignore events that are not for this PMU or are in off/error state.

Signed-off-by: Deng-Cheng Zhu <dengcheng.zhu@gmail.com>
---
arch/mips/kernel/perf_event.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/mips/kernel/perf_event.c b/arch/mips/kernel/perf_event.c
index 1ee44a3..9c6442a 100644
--- a/arch/mips/kernel/perf_event.c
+++ b/arch/mips/kernel/perf_event.c
@@ -486,7 +486,7 @@ static int validate_event(struct cpu_hw_events *cpuc,
{
struct hw_perf_event fake_hwc = event->hw;

- if (event->pmu && event->pmu != &pmu)
+ if (event->pmu != &pmu || event->state <= PERF_EVENT_STATE_OFF)
return 0;

return mipspmu->alloc_counter(cpuc, &fake_hwc) >= 0;
--
1.7.1


\
 
 \ /
  Last update: 2010-11-18 08:05    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site