From patchwork Fri Jan 30 03:12:03 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geoff Levand X-Patchwork-Id: 21148 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id B30C447685 for ; Fri, 30 Jan 2009 14:13:28 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from VA3EHSOBE005.bigfish.com (outbound-va3.frontbridge.com [216.32.180.16]) by ozlabs.org (Postfix) with ESMTP id 08776474C1 for ; Fri, 30 Jan 2009 14:12:56 +1100 (EST) Received: from mail168-va3-R.bigfish.com (10.7.14.251) by VA3EHSOBE005.bigfish.com (10.7.40.25) with Microsoft SMTP Server id 8.1.291.1; Fri, 30 Jan 2009 03:12:52 +0000 Received: from mail168-va3 (localhost.localdomain [127.0.0.1]) by mail168-va3-R.bigfish.com (Postfix) with ESMTP id BCB33C10292; Fri, 30 Jan 2009 03:12:52 +0000 (UTC) X-BigFish: VPS-25(zz1432R98dR1805Mzzzzz2fh6bh61h) X-Spam-TCS-SCL: 0:0 X-FB-SS: 5, Received: by mail168-va3 (MessageSwitch) id 123328517140489_11990; Fri, 30 Jan 2009 03:12:51 +0000 (UCT) Received: from mail8.fw-sd.sony.com (mail8.fw-sd.sony.com [160.33.66.75]) by mail168-va3.bigfish.com (Postfix) with ESMTP id D2CC832006E; Fri, 30 Jan 2009 03:12:50 +0000 (UTC) Received: from mail3.sjc.in.sel.sony.com (mail3.sjc.in.sel.sony.com [43.134.1.211]) by mail8.fw-sd.sony.com (8.14.2/8.14.2) with ESMTP id n0U3CoIv022665; Fri, 30 Jan 2009 03:12:50 GMT Received: from ussdixhub21.spe.sony.com (ussdixhub21.spe.sony.com [43.130.141.76]) by mail3.sjc.in.sel.sony.com (8.12.11/8.12.11) with ESMTP id n0U3CoTj015931; Fri, 30 Jan 2009 03:12:50 GMT Received: from USSDIXRG02.am.sony.com (43.130.140.32) by ussdixhub21.spe.sony.com (43.130.141.76) with Microsoft SMTP Server id 8.1.291.1; Thu, 29 Jan 2009 19:12:49 -0800 Received: from ussdixms03.am.sony.com ([43.130.140.23]) by USSDIXRG02.am.sony.com with Microsoft SMTPSVC(5.0.2195.6713); Thu, 29 Jan 2009 19:12:49 -0800 Received: from [192.168.1.10] ([43.135.148.226]) by ussdixms03.am.sony.com with Microsoft SMTPSVC(5.0.2195.6713); Thu, 29 Jan 2009 19:12:03 -0800 Message-ID: <49827003.5050307@am.sony.com> Date: Thu, 29 Jan 2009 19:12:03 -0800 From: Geoff Levand User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: Remis Lima Baima Subject: Re: Dynamic-ftrace not working in PlayStation3 References: In-Reply-To: X-Enigmail-Version: 0.95.7 X-OriginalArrivalTime: 30 Jan 2009 03:12:03.0774 (UTC) FILETIME=[86565DE0:01C98288] X-SEL-encryption-scan: scanned Cc: linuxppc-dev@ozlabs.org, Steven Rostedt X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 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@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Hi, Remis Lima Baima wrote: > Hi to all. I was tracing a bug in the snd_usb_audio driver > (PlayStation 3, Kernel 2.6.29-rc2, > git://git.kernel.org/pub/scm/linux/kernel/git/geoff/ps3-linux.git) and > for that I tried to use the "dynamic ftrace" to get less debug output. > But it did not work at all. Ftrace (without the "dynamic ftrace" > support) works normally. So I traced the "dynamic ftrace" bug and I > think that I found the bug location but I got stucked. Could anyone > help, please? Below is the link with the debug output: > > PS1: The problem seems to happen in the file > "./git/linux-2.6/arch/powerpc/kernel/ftrace.c" around the line 217: > "if (ptr != GET_ADDR(addr)) {". It returns true. > PS2: I enabled the "DEBUGP" macro to get the debug output below and > changed the line 218 to "printk(KERN_ERR "addr does not match \nptr: > %lx \naddr: %lx \nGET_ADDR(addr): %lx \n", ptr, addr, > GET_ADDR(addr));". > > //************************************************************************************************************************************* > ip:d000000000045aec jumps to d000000000046340 r2: d000000000050c00 > 3d82ffff 398c5740 ffff5740 toc: d000000000046360 c0000000 00007cac > ip:d0000000000458d0 jumps to d000000000046340 r2: d000000000050c00 > 3d82ffff 398c5740 ffff5740 toc: d000000000046360 c0000000 00007cac > ip:d000000000045838 jumps to d000000000046340 r2: d000000000050c00 > 3d82ffff 398c5740 ffff5740 toc: d000000000046360 c0000000 00007cac > ip:d0000000000456dc jumps to d000000000046340 r2: d000000000050c00 > 3d82ffff 398c5740 ffff5740 toc: d000000000046360 c0000000 00007cac ... > ps3_system_bus_match:362: dev=11.0(lpm_01), drv=11.0(ps3-lpm): match > ps3_system_bus_match:362: dev=11.0(lpm_01), drv=11.0(ps3-lpm): match > ps3-lpm lpm_01: <- ps3_lpm_probe:1245: > ip:d0000000003fe280 jumps to d0000000003ffad8 r2: d000000000422c70 > 3d82fffe 398cce68 fffece68 toc: d00000000040faf8 6c656400 5f5f6b73 > addr does not match > ptr: 6c6564005f5f6b73 > addr: c0000000004ff128 > GET_ADDR(addr): c000000000007cac I don't know so much about ftrace, but to get a better idea of the problem, could you try with the patch below? Is ps3-lpm built as a loadable module, and if so, is it the first one that got loaded? Also, try to either build with CONFIG_PS3_LPM=n, or delete ps3-lpm.ko so it does not get loaded to see what happens. -Geoff --- a/arch/powerpc/kernel/ftrace.c +++ b/arch/powerpc/kernel/ftrace.c @@ -23,7 +23,7 @@ #if 0 #define DEBUGP printk #else -#define DEBUGP(fmt , ...) do { } while (0) +#define DEBUGP printk #endif static unsigned int ftrace_nop = PPC_NOP_INSTR; @@ -213,6 +213,8 @@ __ftrace_make_nop(struct module *mod, ptr = ((unsigned long)jmp[0] << 32) + jmp[1]; + printk("ptr %lx, addr %lx, GET_ADDR %lx\n", ptr, addr, GET_ADDR(addr)); + /* This should match what was called */ if (ptr != GET_ADDR(addr)) { printk(KERN_ERR "addr does not match %lx\n", ptr);