From patchwork Fri Nov 3 11:44:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Thierry X-Patchwork-Id: 10039865 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3C81C6032D for ; Fri, 3 Nov 2017 11:45:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D77E29592 for ; Fri, 3 Nov 2017 11:45:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22508295B4; Fri, 3 Nov 2017 11:45:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 78A8129592 for ; Fri, 3 Nov 2017 11:45:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=4dOSkYMbv0mGEgs6UdIMC7kPDNcE3YMeMDqj+CDKjgY=; b=n1jn7FLKbqCg0+veXzNb77erD0 C73G40ijIWKALtCdwjAFYehY1BhAoEHuJvpDMkwx0YpJhvZYRdT6VJu3Ha8nYXJJ+tRDwaV/oUA3b DoQZzkjLj/u3SX/gB25MGIDI+tSiQrFMXG7aVNRDa9iJChc3IwIPTbJ1PfBfTO97Z2hx8xsNUTQ1G ZISkHHAzI8s5oQZAu9tfigpXUqHzR66gfWWnGhH9D7/09dks6FAvJtgkvFq93/DEFvcNwA4qY4bPQ +1SRh8rSbLAkBzASgE9/PTUldVOBQQVsZj/M7/4pX5YS6e7uuaERwxUmB1LbKXATrl3mPq1C3zZYm KNGhVP8Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eAaPh-00021n-GM; Fri, 03 Nov 2017 11:45:29 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eAaP0-0008Io-4x for linux-arm-kernel@lists.infradead.org; Fri, 03 Nov 2017 11:44:49 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 75490164F; Fri, 3 Nov 2017 04:44:30 -0700 (PDT) Received: from e112298-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 66C073F25D; Fri, 3 Nov 2017 04:44:29 -0700 (PDT) From: Julien Thierry To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/3] arm: ftrace: function_graph with DYNAMIC_FTRACE Date: Fri, 3 Nov 2017 11:44:17 +0000 Message-Id: <1509709458-44541-3-git-send-email-julien.thierry@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509709458-44541-1-git-send-email-julien.thierry@arm.com> References: <1509709458-44541-1-git-send-email-julien.thierry@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171103_044446_364724_98D20A80 X-CRM114-Status: UNSURE ( 8.57 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: takahiro.akashi@linaro.org, Russell King , rostedt@goodmis.org, Julien Thierry MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Function graph does not work currently when CONFIG_DYNAMIC_TRACE is not set. This is because ftrace_function_trace is not always set to ftrace_stub when function_graph is in use. Do not skip checking of graph tracer functions when ftrace_function_trace is set. Suggested-by: AKASHI Takahiro Signed-off-by: Julien Thierry Cc: Russell King --- arch/arm/kernel/entry-ftrace.S | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) Takahiro's patch was not signed-off, let me know if I need to change the Suggested-by into a Signed-off-by. -- 1.9.1 diff --git a/arch/arm/kernel/entry-ftrace.S b/arch/arm/kernel/entry-ftrace.S index efcd9f2..e3555f8 100644 --- a/arch/arm/kernel/entry-ftrace.S +++ b/arch/arm/kernel/entry-ftrace.S @@ -68,7 +68,13 @@ ldr r2, [r0] adr r0, .Lftrace_stub cmp r0, r2 - bne 1f + beq 1f + + mcount_get_lr r1 @ lr of instrumented func + mcount_adjust_addr r0, lr @ instrumented function + badr lr, 1f + mov pc, r2 +1: #ifdef CONFIG_FUNCTION_GRAPH_TRACER ldr r1, =ftrace_graph_return @@ -84,12 +90,6 @@ #endif mcount_exit - -1: mcount_get_lr r1 @ lr of instrumented func - mcount_adjust_addr r0, lr @ instrumented function - badr lr, 2f - mov pc, r2 -2: mcount_exit .endm #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS