Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1336637imw; Tue, 5 Jul 2022 07:46:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tvg0X4TffcJSaEdrVy1oukSL6DQQ1sOwAzE22Fyp6GKys5NqgLSLUgRi301N8ue58VhaLE X-Received: by 2002:a63:2a4e:0:b0:412:518c:213 with SMTP id q75-20020a632a4e000000b00412518c0213mr8226523pgq.42.1657032408788; Tue, 05 Jul 2022 07:46:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657032408; cv=none; d=google.com; s=arc-20160816; b=CIU+y0cwC7oAmm1qmuwZL7SrxWwA1jZyQqdthu/X7XC6S+JyERtKs3hNVAoJ+rAhKc MvNMZtcNEZMxS/jTeg1oYrunLQbRItEOg1HPWY7tHNTkov+BIRE0fFmZX3tpfV6lDzye IdyHg+MsVnkkGr4A59IJloI1xds3MCEvLmqMjvG0meRqN5xXxN3DqMoWmMyzmK6Y3h52 gw9OB/F9mvHkosyCDIycy7z/J726QPxP5kxd1pBXgsYgy3peRspJXKxQQWYiWD48JqV/ gS+h+gwzlBMlkUD7ygALQqsDi5HxHnQBBZdV9ugZ0GIkPi5qZO2830pE9F8DGZM1bmEr Fl+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=AA4Q7mm9SgRHdpqv6mDuYpGVaqsUQXOm2790qmD548k=; b=tDBj/GwRCKJjXPyYKp70NawmKSgtrUXCeiAvvYev1MicraqnSY/lQgL7OirDt6de6X /blXr71YS41nkX4X/FtpkFCyGLTdDQaAarZ2LxIkL0xtyUBU1J0IuwH1JNEZcIH3rm6C X8ugS6x/AZMI9wzuxiJ6wVznMpJ+ce7zUoxPQXcGWIYbfHfydWP87wGv9tXybjRsNFpn 2Fc5r1yJe1vTzbV8UKm2Je5fN41QjaOH8ZUVT5rlk7GVYiW03CeTJua4YOy+guWhAo2b /4eTv9XrCASwKCT7+qikl7ZbsU/Qf3cTMpN7d9diVvlePbvF5Iu6nzQ2Nx7ljODZk5HW rYgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q4-20020a17090311c400b0016b8167e375si17973092plh.170.2022.07.05.07.46.34; Tue, 05 Jul 2022 07:46:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231970AbiGEOjI (ORCPT + 99 others); Tue, 5 Jul 2022 10:39:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231215AbiGEOjF (ORCPT ); Tue, 5 Jul 2022 10:39:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82FAE656E for ; Tue, 5 Jul 2022 07:39:04 -0700 (PDT) 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 09329619D9 for ; 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 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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