From patchwork Thu Jan 3 10:12:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: kpark3469@gmail.com X-Patchwork-Id: 1926861 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 84B023FC33 for ; Thu, 3 Jan 2013 10:16:05 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TqhnY-0000aa-US; Thu, 03 Jan 2013 10:13:17 +0000 Received: from mail-bk0-f50.google.com ([209.85.214.50]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TqhnV-0000aA-Hf for linux-arm-kernel@lists.infradead.org; Thu, 03 Jan 2013 10:13:14 +0000 Received: by mail-bk0-f50.google.com with SMTP id jf3so6403182bkc.23 for ; Thu, 03 Jan 2013 02:13:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=Yk0TmBWWmLjt++IrpBk91+q7eTzB08awoj91o6vavWc=; b=JI5WP54oyAWit2qWEvMRm/T52D8eM3tQy60WUVRkY67lCJhB+tD28hwGFdjfkg28zn EjEFPO2LJrEuftfZhx0owkaG3YeHUVKDVtNn9jxqcClSHbU35XA3GGF5vyXHbuYoZ4y7 EkC3nfuXxcgvHyi57xjZfzd2xDfDiFcGBn0bopAuCRZ1VhxUslDTVknWQIsrF2yGKAuJ WTPijJKs8PVCGsY4bNNjQCRylkf1+bxnPvxkJHPTWFnBUAJSPI8TUZlxBWEfSJsY5j9v JX8UguiOiKrPy855J1dkBhTp94uKp10jxBGKtJ5SCG2XHcjfkpGkty3bVVSY1OwHq88Y zrRg== X-Received: by 10.204.148.12 with SMTP id n12mr23389424bkv.138.1357207989834; Thu, 03 Jan 2013 02:13:09 -0800 (PST) Received: from localhost.localdomain ([61.107.31.52]) by mx.google.com with ESMTPS id c10sm33205601bkw.1.2013.01.03.02.13.04 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 03 Jan 2013 02:13:09 -0800 (PST) From: kpark3469@gmail.com To: rostedt@goodmis.org Subject: [PATCH 2/2] arm: make return_address available for ARM_UNWIND Date: Thu, 3 Jan 2013 19:12:29 +0900 Message-Id: <1357207949-3349-2-git-send-email-kpark3469@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1357207949-3349-1-git-send-email-kpark3469@gmail.com> References: <1357207949-3349-1-git-send-email-kpark3469@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130103_051313_778909_2E8C4E33 X-CRM114-Status: GOOD ( 14.95 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (kpark3469[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (kpark3469[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.50 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: sahara , linux@arm.linux.org.uk, fweisbec@gmail.com, linux-kernel@vger.kernel.org, mingo@redhat.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: sahara This fixes a warning saying: warning: #warning "TODO: return_address should use unwind tables" And, this enables return_address using unwind information. If ARM_UNWIND is selected, unwind_frame in unwind.c will be called in walk_stackframe. Signed-off-by: sahara --- arch/arm/include/asm/ftrace.h | 6 ++---- arch/arm/kernel/return_address.c | 10 +++------- arch/arm/kernel/stacktrace.c | 3 +++ 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h index f89515a..3552ad9 100644 --- a/arch/arm/include/asm/ftrace.h +++ b/arch/arm/include/asm/ftrace.h @@ -32,13 +32,11 @@ extern void ftrace_call_old(void); #ifndef __ASSEMBLY__ -#if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) +#if defined(CONFIG_FRAME_POINTER) || defined(CONFIG_ARM_UNWIND) /* * return_address uses walk_stackframe to do it's work. If both * CONFIG_FRAME_POINTER=y and CONFIG_ARM_UNWIND=y walk_stackframe uses unwind - * information. For this to work in the function tracer many functions would - * have to be marked with __notrace. So for now just depend on - * !CONFIG_ARM_UNWIND. + * information. */ void *return_address(unsigned int); diff --git a/arch/arm/kernel/return_address.c b/arch/arm/kernel/return_address.c index fafedd8..f202bc0 100644 --- a/arch/arm/kernel/return_address.c +++ b/arch/arm/kernel/return_address.c @@ -11,7 +11,7 @@ #include #include -#if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) +#if defined(CONFIG_FRAME_POINTER) || defined(CONFIG_ARM_UNWIND) #include #include @@ -57,17 +57,13 @@ void *return_address(unsigned int level) return NULL; } -#else /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) */ - -#if defined(CONFIG_ARM_UNWIND) -#warning "TODO: return_address should use unwind tables" -#endif +#else /* CONFIG_FRAME_POINTER || CONFIG_ARM_UNWIND */ void *return_address(unsigned int level) { return NULL; } -#endif /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) / else */ +#endif /* CONFIG_FRAME_POINTER || CONFIG_ARM_UNWIND */ EXPORT_SYMBOL_GPL(return_address); diff --git a/arch/arm/kernel/stacktrace.c b/arch/arm/kernel/stacktrace.c index 00f79e5..aab144b 100644 --- a/arch/arm/kernel/stacktrace.c +++ b/arch/arm/kernel/stacktrace.c @@ -6,6 +6,9 @@ #if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) /* + * If both CONFIG_FRAME_POINTER=y and CONFIG_ARM_UNWIND=y walk_stackframe uses + * unwind information. So for now just depend on !CONFIG_ARM_UNWIND. + * * Unwind the current stack frame and store the new register values in the * structure passed as argument. Unwinding is equivalent to a function return, * hence the new PC value rather than LR should be used for backtrace.