From: Peter Zijlstra <peterz@infradead.org>
To: Stephane Eranian <eranian@google.com>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, andi@firstfloor.org,
ming.m.lin@intel.com
Subject: Re: [PATCH 2/3] perf_events: fix validation of events using an extra reg (v3)
Date: Mon, 30 May 2011 15:11:14 +0200 [thread overview]
Message-ID: <1306761074.1200.2975.camel@twins> (raw)
In-Reply-To: <20110523161252.GA11607@quad>
On Mon, 2011-05-23 at 18:12 +0200, Stephane Eranian wrote:
> +static struct cpu_hw_events *allocate_fake_cpuc(void)
> +{
> + struct cpu_hw_events *cpuc;
> + int cpu = smp_processor_id();
> +
> + cpuc = kzalloc(sizeof(*cpuc), GFP_KERNEL);
> + if (!cpuc)
> + return ERR_PTR(-ENOMEM);
> +
> + /* only needed, if we have extra_regs */
> + if (x86_pmu.extra_regs) {
> + cpuc->shared_regs = allocate_shared_regs(cpu);
> + if (!cpuc->shared_regs)
> + goto error;
> + }
> + return cpuc;
> +error:
> + free_fake_cpuc(cpuc);
> + return ERR_PTR(-ENOMEM);
> +}
Ingo found a case where that use of allocate_shared_regs() failed to
compile but didn't provide a .config. I suspect its CONFIG_CPU_SUP_INTEL
and the below should fix it. I will try to push that again later today.
---
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c
index 41178c8..cf90e31 100644
--- a/arch/x86/kernel/cpu/perf_event_intel.c
+++ b/arch/x86/kernel/cpu/perf_event_intel.c
@@ -1528,4 +1623,9 @@ static int intel_pmu_init(void)
return 0;
}
+static struct intel_shared_regs *allocate_shared_regs(int cpu)
+{
+ return NULL;
+}
+
#endif /* CONFIG_CPU_SUP_INTEL */
next prev parent reply other threads:[~2011-05-30 13:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-23 16:12 [PATCH 2/3] perf_events: fix validation of events using an extra reg (v3) Stephane Eranian
2011-05-30 13:11 ` Peter Zijlstra [this message]
2011-05-30 13:16 ` Stephane Eranian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1306761074.1200.2975.camel@twins \
--to=peterz@infradead.org \
--cc=andi@firstfloor.org \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.m.lin@intel.com \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox