| To: | ralf@linux-mips.org, a.p.zijlstra@chello.nl, fweisbec@gmail.com, will.deacon@arm.com |
|---|---|
| Subject: | [PATCH v2 3/5] MIPS/Perf-events: Fix event check in validate_event() |
| From: | Deng-Cheng Zhu <dengcheng.zhu@gmail.com> |
| Date: | Fri, 26 Nov 2010 11:05:05 +0800 |
| Cc: | linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, wuzhangjin@gmail.com, paulus@samba.org, mingo@elte.hu, acme@redhat.com, dengcheng.zhu@gmail.com |
| Dkim-signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=TTwn7Sa7hhzDGQmuonoWGRuERvKySdxN9gNkdSjKDEs=; b=mH9Al/T7TB9p4ro58c4kjkdkbkVxImVTPbYUlhWwsuU+ga5sCrIXXKhSs33FekVGJI DhrCVsBFgVqTObTpV4wPg54QVc+x+keOk1w8z49Ne8nvuA96mDopoLX6YxpT0/LxvkmX hVNWBoZ6lBNK8LFmxLXybtumEA3HY8OPh5YKU= |
| Domainkey-signature: | a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=IPkDy+cKxkKZfcdbJs66tf6E7W/alEr9CIK1YMW9T3KAMqvs7iPmsxDc4k8y0Rj9CI A87o135b+QmZTZ8f4IobaOpCySDp0BW6YRaZoH/UinE7T4JaqktyTt2gWlfIFNDCp4uy 1ixsSsxH3dO/6DIm5Kluz6A7zk74N9sTTm430= |
| In-reply-to: | <1290740707-32586-1-git-send-email-dengcheng.zhu@gmail.com> |
| Original-recipient: | rfc822;linux-mips@linux-mips.org |
| References: | <1290740707-32586-1-git-send-email-dengcheng.zhu@gmail.com> |
| Sender: | linux-mips-bounce@linux-mips.org |
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@gmail.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
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH v2 2/5] MIPS/Perf-events: Work with the new PMU interface, Deng-Cheng Zhu |
|---|---|
| Next by Date: | [PATCH v2 5/5] MIPS/Perf-events: Use unsigned delta for right shift in event update, Deng-Cheng Zhu |
| Previous by Thread: | [PATCH v2 2/5] MIPS/Perf-events: Work with the new PMU interface, Deng-Cheng Zhu |
| Next by Thread: | Re: [PATCH v2 3/5] MIPS/Perf-events: Fix event check in validate_event(), Will Deacon |
| Indexes: | [Date] [Thread] [Top] [All Lists] |