[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1290740707-32586-4-git-send-email-dengcheng.zhu@gmail.com>
Date: Fri, 26 Nov 2010 11:05:05 +0800
From: Deng-Cheng Zhu <dengcheng.zhu@...il.com>
To: ralf@...ux-mips.org, a.p.zijlstra@...llo.nl, fweisbec@...il.com,
will.deacon@....com
Cc: linux-mips@...ux-mips.org, linux-kernel@...r.kernel.org,
wuzhangjin@...il.com, paulus@...ba.org, mingo@...e.hu,
acme@...hat.com, dengcheng.zhu@...il.com
Subject: [PATCH v2 3/5] MIPS/Perf-events: Fix event check in validate_event()
Ignore events that are in off/error state or belong to a different PMU.
This patch originates from the following commit for ARM by Will Deacon:
65b4711ff513767341aa1915c822de6ec0de65cb
ARM: 6352/1: perf: fix event validation
Signed-off-by: Deng-Cheng Zhu <dengcheng.zhu@...il.com>
---
arch/mips/kernel/perf_event.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/mips/kernel/perf_event.c b/arch/mips/kernel/perf_event.c
index 1ee44a3..3d55761 100644
--- a/arch/mips/kernel/perf_event.c
+++ b/arch/mips/kernel/perf_event.c
@@ -486,8 +486,9 @@ static int validate_event(struct cpu_hw_events *cpuc,
{
struct hw_perf_event fake_hwc = event->hw;
- if (event->pmu && event->pmu != &pmu)
- return 0;
+ /* Allow mixed event group. So return 1 to pass validation. */
+ if (event->pmu != &pmu || event->state <= PERF_EVENT_STATE_OFF)
+ return 1;
return mipspmu->alloc_counter(cpuc, &fake_hwc) >= 0;
}
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists