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 C03CFC43334 for ; Tue, 5 Jul 2022 14:40:08 +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:MIME-Version:References:In-Reply-To: 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=p+wbX9cdFUGFzlRsqIOKGgoFtEG4fkR4v/GJU03Cxe0=; b=Jvj47mXyfi3j0l BsbEGUvXgBO7voN3ALPtPAKQFZVfBTLfZcSDKU17SFSiYNh69KQA6jn/p1noamdkq5nrQG8uOif+8 Zw5Hp4dHeUGxJTNPPgmSUEFe8T+IVAMd+oJ3vK4OKNnH29VjoOT2TqNS85yrHTpuAsA2LKGHxa2kQ H7LCOfcighDpITaNHGfGxjO4uM4Cc2cXsMTKZuGwPT9l6CvGTCq7BJT68BhV8yA+zbkVQKD5BHri5 DCaBlETPsDnb9xtYJQV8otNdeUBuivpijr5Y3zDhppYVdJRcQ+BSkicDoswEpe+FccOPNWE9oh/oB 1VVHcGPce1BwAqhSv+cQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8jhk-000t15-C9; Tue, 05 Jul 2022 14:39:08 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8jhg-000sz8-Ob for linux-arm-kernel@lists.infradead.org; Tue, 05 Jul 2022 14:39:06 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 009C5619BA; Tue, 5 Jul 2022 14:39:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 917FEC341C7; Tue, 5 Jul 2022 14:39:02 +0000 (UTC) Date: Tue, 5 Jul 2022 10:39:01 -0400 From: Steven Rostedt To: Sascha Hauer Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ingo Molnar , kernel@pengutronix.de Subject: Re: Performance impact of CONFIG_FUNCTION_TRACER Message-ID: <20220705103901.41a70cf0@rorschach.local.home> In-Reply-To: <20220705105416.GE5208@pengutronix.de> References: <20220705105416.GE5208@pengutronix.de> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220705_073904_895737_5C6A22F2 X-CRM114-Status: GOOD ( 23.01 ) 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 Tue, 5 Jul 2022 12:54:16 +0200 Sascha Hauer wrote: > Hi, > > I ran some lmbench subtests on a ARMv7 machine (NXP i.MX6q) with and > without CONFIG_FUNCTION_TRACER enabled (with CONFIG_DYNAMIC_FTRACE > enabled and no tracing active), see below. The Kconfig help text of this > option reads as: > > > If it's runtime disabled (the bootup default), then the overhead of > > the instructions is very small and not measurable even in > > micro-benchmarks. Well, this is true for x86 ;-) > > In my tests the overhead is small, but it surely exists and is > measurable at least on ARMv7 machines. Is this expected? Should the help > text be rephrased a little less optimistic? You mean "(but may vary by architecture)" As I believe due to using a link register for function calls, ARM requires adding two 4 byte nops to every function where as x86 only adds a single 5 byte nop. Although nops are very fast (they should not be processed in the CPU's pipe line, but I don't know if that's true for every arch). It also affects instruction cache misses, as adding 8 bytes around the code will cause more cache misses than when they do not exist. Also, there's some configurations that use the old mcount that does add some more code to handle the mcount case. So if this is just to have us change the kconfig, I'm happy to do that. -- Steve _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel