From patchwork Sat Mar 23 22:10:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rabin Vincent X-Patchwork-Id: 2325191 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 D0AC73FC8A for ; Sat, 23 Mar 2013 22:14:56 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UJWeT-0006SJ-Dv; Sat, 23 Mar 2013 22:11:01 +0000 Received: from mail-la0-x236.google.com ([2a00:1450:4010:c03::236]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UJWeP-0006Rt-JP for linux-arm-kernel@lists.infradead.org; Sat, 23 Mar 2013 22:10:59 +0000 Received: by mail-la0-f54.google.com with SMTP id gw10so9371559lab.13 for ; Sat, 23 Mar 2013 15:10:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer; bh=1UYUoWH0RB6GkNA1uqVeZfyANQ3B1tdHnQ3bh+r/t1s=; b=IpLz30W1fWOcclihQfSOwKR2cwfhqAPvuvOhuheBUtKHbdMt23AcfL08RQbTBYUmes qvJX5yO+wmI5Tqor0Ih1kupCE5IOd0MPnHHD7ydmGH23gQHMDf65fAHLiGqRnoEoEkgo kWr92P40VoZDRaSnlYJMCCXEV0HmtbNLjy41JibTljq/kGv93h/H7K+2bxtWrTXwyuK4 q5Z/jekrzCPFbt5tgApIEi5ud8ki1dbXLjJKm9Ubyy7JzmTqj5pXWoPWZoMiSiEtZjzi gdzp0s0FLTy4MdVM42JD76qLbPSo2cbuxUOPf1604xvudw2sxzLOxCXSOoburtBmzlLd wJJw== X-Received: by 10.112.88.72 with SMTP id be8mr3421576lbb.116.1364076654540; Sat, 23 Mar 2013 15:10:54 -0700 (PDT) Received: from localhost.localdomain (c83-254-193-108.bredband.comhem.se. [83.254.193.108]) by mx.google.com with ESMTPS id iq6sm2800564lab.10.2013.03.23.15.10.52 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 23 Mar 2013 15:10:53 -0700 (PDT) From: Rabin Vincent To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: add unwind annotations to ftrace asm Date: Sat, 23 Mar 2013 23:10:49 +0100 Message-Id: <1364076649-16841-1-git-send-email-rabin@rab.in> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130323_181057_830676_67F9ED24 X-CRM114-Status: UNSURE ( 8.90 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (rabin.vincent[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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: Rabin Vincent X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add unwind annotations to the ftrace assembly code so that the function tracer's stacktracing options (func_stack_trace, etc.) work when CONFIG_ARM_UNWIND is enabled. Signed-off-by: Rabin Vincent --- arch/arm/kernel/entry-common.S | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 3248cde..fefd7f9 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -276,7 +276,13 @@ ENDPROC(ftrace_graph_caller_old) */ .macro mcount_enter +/* + * This pad compensates for the push {lr} at the call site. Note that we are + * unable to unwind through a function which does not otherwise save its lr. + */ + UNWIND(.pad #4) stmdb sp!, {r0-r3, lr} + UNWIND(.save {r0-r3, lr}) .endm .macro mcount_get_lr reg @@ -289,6 +295,7 @@ ENDPROC(ftrace_graph_caller_old) .endm ENTRY(__gnu_mcount_nc) +UNWIND(.fnstart) #ifdef CONFIG_DYNAMIC_FTRACE mov ip, lr ldmia sp!, {lr} @@ -296,17 +303,22 @@ ENTRY(__gnu_mcount_nc) #else __mcount #endif +UNWIND(.fnend) ENDPROC(__gnu_mcount_nc) #ifdef CONFIG_DYNAMIC_FTRACE ENTRY(ftrace_caller) +UNWIND(.fnstart) __ftrace_caller +UNWIND(.fnend) ENDPROC(ftrace_caller) #endif #ifdef CONFIG_FUNCTION_GRAPH_TRACER ENTRY(ftrace_graph_caller) +UNWIND(.fnstart) __ftrace_graph_caller +UNWIND(.fnend) ENDPROC(ftrace_graph_caller) #endif