From patchwork Mon Sep 21 06:44:32 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Mackerras X-Patchwork-Id: 33982 X-Patchwork-Delegate: paulus@samba.org Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 99E52B7DDC for ; Mon, 21 Sep 2009 16:44:53 +1000 (EST) Received: by ozlabs.org (Postfix) id 8B98CB7334; Mon, 21 Sep 2009 16:44:47 +1000 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: by ozlabs.org (Postfix, from userid 1003) id 89565B7B6F; Mon, 21 Sep 2009 16:44:47 +1000 (EST) MIME-Version: 1.0 Message-ID: <19127.8400.376239.586120@drongo.ozlabs.ibm.com> Date: Mon, 21 Sep 2009 16:44:32 +1000 From: Paul Mackerras To: Ingo Molnar , Peter Zijlstra Subject: [PATCH] perf_counter/powerpc: Fix compilation after perf_counter_overflow change X-Mailer: VM 8.0.12 under 22.3.1 (powerpc-unknown-linux-gnu) Cc: Markus Metzger , linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Commit 5622f295 ("x86, perf_counter, bts: Optimize BTS overflow handling") removed the regs field from struct perf_sample_data and added a regs parameter to perf_counter_overflow(). This breaks the build on powerpc as reported by Sachin Sant: arch/powerpc/kernel/perf_counter.c: In function 'record_and_restart': arch/powerpc/kernel/perf_counter.c:1165: error: unknown field 'regs' specified in initializer cc1: warnings being treated as errors arch/powerpc/kernel/perf_counter.c:1165: error: initialization makes integer from pointer without a cast arch/powerpc/kernel/perf_counter.c:1173: error: too few arguments to function 'perf_counter_overflow' make[1]: *** [arch/powerpc/kernel/perf_counter.o] Error 1 make: *** [arch/powerpc/kernel] Error 2 This adjusts arch/powerpc/kernel/perf_counter.c to correspond with the new struct perf_sample_data and perf_counter_overflow(). Reported-by: Sachin Sant Signed-off-by: Paul Mackerras --- I missed this problem when the "x86, perf_counter, bts: Optimize BTS overflow handling" patch was posted because the headline made it seem entirely x86-specific, and the changes to struct perf_sample_data and perf_counter_overflow() were not mentioned in the changelog. Markus, please take care in future to mention it in the changelog if your patches touch definitions used by other architectures. If you could go so far as to use grep a bit more and fix up other architectures' callsites for the things you're changing, that would be very much appreciated. Thanks. diff --git a/arch/powerpc/kernel/perf_counter.c b/arch/powerpc/kernel/perf_counter.c index 7ceefaf..5ccf9bc 100644 --- a/arch/powerpc/kernel/perf_counter.c +++ b/arch/powerpc/kernel/perf_counter.c @@ -1162,7 +1162,6 @@ static void record_and_restart(struct perf_counter *counter, unsigned long val, */ if (record) { struct perf_sample_data data = { - .regs = regs, .addr = 0, .period = counter->hw.last_period, }; @@ -1170,7 +1169,7 @@ static void record_and_restart(struct perf_counter *counter, unsigned long val, if (counter->attr.sample_type & PERF_SAMPLE_ADDR) perf_get_data_addr(regs, &data.addr); - if (perf_counter_overflow(counter, nmi, &data)) { + if (perf_counter_overflow(counter, nmi, &data, regs)) { /* * Interrupts are coming too fast - throttle them * by setting the counter to 0, so it will be