From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9AF4FC433EF for ; Mon, 11 Jul 2022 10:59:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kvd9i8Nh8CINfW3EF4xb9djZfoHiMLtTX55aHEDAoE0=; b=Ww1jHScyexsJ7w dngzoZseaE0iXQA6xeKql/C2lRXvFe2gbZqzsGrM9bV0o2pwZFex3oCK5V5bkm/FDyTrITn1dwHwG ass0HQHGfL4TytWkqdCpSibQ0TCoFN5jIAuBCm+wMCNvA4RAJA/oY48c7ndjXc8IT3dTp8/BLRoxx v7BoAdAWUsQNStJyyMYj0ejFR+hahzbipfc3NBHR/dzSVMLo5sPfcSl/b3D97HlhFmd6OIYv5vnaA GRw6L25JMKogzU21rY57z/cVcgiJofsohGwLS/4aqJv7fd+SziB1ts67FBU84J+B9rQSy4bNmkV4W zniDTlMlLxLJpanbvoIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAr7v-000tDr-NU; Mon, 11 Jul 2022 10:58:55 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAr7r-000tD0-4J for linux-arm-kernel@lists.infradead.org; Mon, 11 Jul 2022 10:58:52 +0000 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oAr7k-0007FM-FO; Mon, 11 Jul 2022 12:58:44 +0200 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1oAr7g-0000h5-UL; Mon, 11 Jul 2022 12:58:40 +0200 Date: Mon, 11 Jul 2022 12:58:40 +0200 From: Sascha Hauer To: Steven Rostedt Cc: LKML , Ingo Molnar , Andrew Morton , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] ftrace: Be more specific about arch impact when function tracer is enabled Message-ID: <20220711105840.GH29790@pengutronix.de> References: <20220706161231.085a83da@gandalf.local.home> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220706161231.085a83da@gandalf.local.home> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220711_035851_188394_2ACFCF71 X-CRM114-Status: GOOD ( 26.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jul 06, 2022 at 04:12:31PM -0400, Steven Rostedt wrote: > From: Steven Rostedt (Google) > > It was brought up that on ARMv7, that because the FUNCTION_TRACER does not > use nops to keep function tracing disabled because of the use of a link > register, it does have some performance impact. > > The start of functions when -pg is used to compile the kernel is: > > push {lr} > bl 8010e7c0 <__gnu_mcount_nc> > > When function tracing is tuned off, it becomes: > > push {lr} > add sp, sp, #4 > > Which just puts the stack back to its normal location. But these two > instructions at the start of every function does incur some overhead. > > Be more honest in the Kconfig FUNCTION_TRACER description and specify that > the overhead being in the noise was x86 specific, but other architectures > may vary. > > Link: https://lore.kernel.org/all/20220705105416.GE5208@pengutronix.de/ > > Reported-by: Sascha Hauer > Signed-off-by: Steven Rostedt (Google) > --- Thanks Steven Acked-by: Sascha Hauer Sascha > diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig > index debbbb083286..ccd6a5ade3e9 100644 > --- a/kernel/trace/Kconfig > +++ b/kernel/trace/Kconfig > @@ -194,7 +194,8 @@ config FUNCTION_TRACER > sequence is then dynamically patched into a tracer call when > tracing is enabled by the administrator. If it's runtime disabled > (the bootup default), then the overhead of the instructions is very > - small and not measurable even in micro-benchmarks. > + small and not measurable even in micro-benchmarks (at least on > + x86, but may have impact on other architectures). > > config FUNCTION_GRAPH_TRACER > bool "Kernel Function Graph Tracer" > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel