From patchwork Mon Jul 6 10:32:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Fleming X-Patchwork-Id: 34221 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n66AX7JG011099 for ; Mon, 6 Jul 2009 10:33:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753964AbZGFKdE (ORCPT ); Mon, 6 Jul 2009 06:33:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753991AbZGFKdE (ORCPT ); Mon, 6 Jul 2009 06:33:04 -0400 Received: from cs20.apochromatic.org ([204.152.189.161]:51747 "EHLO cs20.apochromatic.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753964AbZGFKdD (ORCPT ); Mon, 6 Jul 2009 06:33:03 -0400 Received: from localhost (localhost [127.0.0.1]) by cs20.apochromatic.org (Postfix) with ESMTP id 8B6E3AD777; Mon, 6 Jul 2009 03:33:07 -0700 (PDT) From: Matt Fleming To: lethal@linux-sh.org Cc: linux-sh@vger.kernel.org, Matt Fleming Subject: [PATCH 1/3] sh: Fix the value of MCOUNT_INSN_OFFSET Date: Mon, 6 Jul 2009 11:32:41 +0100 Message-Id: <441c5c048cf9a9884e0b0d0af90a6f17f846a3bb.1246875978.git.matt@console-pimps.org> X-Mailer: git-send-email 1.6.3.2.316.gda4e In-Reply-To: References: In-Reply-To: References: Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org It seems that MCOUNT_INSN_OFFSET was calculating the distance between the wrong functions. The value that should have actually been computed is the distance between ftrace_call and ftrace_stub. I discovered this when I added some code to ftrace_caller. Signed-off-by: Matt Fleming --- arch/sh/include/asm/ftrace.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/sh/include/asm/ftrace.h b/arch/sh/include/asm/ftrace.h index 8fea7d8..b09311a 100644 --- a/arch/sh/include/asm/ftrace.h +++ b/arch/sh/include/asm/ftrace.h @@ -11,10 +11,10 @@ extern void mcount(void); #define MCOUNT_ADDR ((long)(mcount)) #ifdef CONFIG_DYNAMIC_FTRACE -#define CALLER_ADDR ((long)(ftrace_caller)) +#define CALL_ADDR ((long)(ftrace_call)) #define STUB_ADDR ((long)(ftrace_stub)) -#define MCOUNT_INSN_OFFSET ((STUB_ADDR - CALLER_ADDR) >> 1) +#define MCOUNT_INSN_OFFSET ((STUB_ADDR - CALL_ADDR) - 4) struct dyn_arch_ftrace { /* No extra data needed on sh */