Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755377AbZFCMrR (ORCPT ); Wed, 3 Jun 2009 08:47:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753390AbZFCMrJ (ORCPT ); Wed, 3 Jun 2009 08:47:09 -0400 Received: from hrndva-omtalb.mail.rr.com ([71.74.56.124]:44953 "EHLO hrndva-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752836AbZFCMrI (ORCPT ); Wed, 3 Jun 2009 08:47:08 -0400 Date: Wed, 3 Jun 2009 08:47:07 -0400 (EDT) From: Steven Rostedt X-X-Sender: rostedt@gandalf.stny.rr.com To: Wang Liming cc: wu zhangjin , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, Wu Zhangjin , Ralf Baechle , Ingo Molnar , Andrew Morton , Frederic Weisbecker , Thomas Gleixner , Nicholas Mc Guire Subject: Re: [PATCH v2 2/6] mips dynamic function tracer support In-Reply-To: <4A26129E.1080008@windriver.com> Message-ID: References: <4A22281B.7020908@windriver.com> <4A26129E.1080008@windriver.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1784 Lines: 59 On Wed, 3 Jun 2009, Wang Liming wrote: > wu zhangjin wrote: > > hi, > > > > sorry, I'm so late to reply your E-mail, a little busy these days. > > > > > > } > > > > > > ----------arch/mips/kernel/module.c:apply_r_mips_26_rel()------------------- > > > > > > v is kernel _mcount's address, location is the address of the instrution > > > that should be relocated; > > > > > > To resolve this problem, we may need to do more work, either on gcc or on > > > the kernel. So I want to hear your test result and if you have solution, > > > please let me know. > > > > > > > yes, current version of mips-specific dynamic ftrace not support modules > > yet. > > > > there is similar solution implemented in PowerPC(something named > > trampoline), > > although I did not look into it, but I'm sure we can implement the > > mips-specific one > > via imitating it. > Good hit. I may have a look on Powerpc implementation. Note, PowerPC uses a trampoline from modules to kernel core. I think MIPS just calls mcount differently. That is, it does a full 32bit address call (64 bit for 64 bit archs?). Something like: lui v1, _mcount addiu v1, v1, _mcount jalr v1 addiu sp, sp, -8 Then a nop would not do. Due to preemption, we can not modify more than one line. But you could modify it to: b 1f addiu v1, v1, _mcount jalr v1 addiu sp, sp, -8 1: Clobbering v1 should not be an issue since it is already used to store _mcount. That is, we still do the addiu v1,v1,_mcount with that branch. But v1 should be ignored. -- Steve -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/