Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2913385imw; Wed, 6 Jul 2022 14:00:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uoXBhjlW4r++fcQxmjKZ5II445HXKhlpwHj9yZDRbNnB/nz25ZKl5DX1ek3hg7HKV1MzXt X-Received: by 2002:a17:907:2d0b:b0:726:ef78:3399 with SMTP id gs11-20020a1709072d0b00b00726ef783399mr42734024ejc.37.1657141225127; Wed, 06 Jul 2022 14:00:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657141225; cv=none; d=google.com; s=arc-20160816; b=dh3jUgYP28wE0sVeGXyCbKL4OaJYmKMxit2njEYrlXSIHrfWKYW4YbKxvxHtGKc5rM sqAyA33ThYXM5gjzXUamdqYP2Fr+Jsn8zJ5Rpo/Zmh9yVpLYVtk/HbjITc5rLxlXUqzx Fw5dDDcqNJdBgXo55Ok5Q+WBxRUt6wppSkXn2bOLRDaKNFEYtNbfV6fkp5XnOZIIhdvK huOsVUJJvconxMYYBV5Jw7MjuBxAy7zaZuVzV7Ed9+sLPZxfAi6lIaNT4ZjRLAdZ0R/c bw50Q300eGg7rhigCpICa7b5eXIJYcY4ZqttXn7MTTGCpGRmHjEXM5UwLtTJioB77oTG MzkQ== 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 :message-id:subject:cc:to:from:date; bh=+NGdKpcYG75a2WaZb7DuGw7jm1S1WMnGTg0iuy4O8zo=; b=gDAQZyP/5Bt8EZ7WFo9YZlw/Dcqp1gqGY9oyE8irSEpQt9wO0l0KDk7+VY7r3YeMt9 gMzT2YdMrBA0q5xHDtjG3Eo+68Dx2NjIvyN5IEuiyYZlBmO1BMlf8LJqDwGP9c4SwPxQ BVs9Ri582WlKGGoGkEo9ATkXgKkxkHtMugkrcq/pgWLgMsQWuodUYK8VOdfkHmDL7D1f WTMzAQ9K8vfHm60KuRH7+gkbUEGQ80mnTkJIdHxYjz2mtSmvdh9icYZCP4a/XhNhbqNj +0x5nuQmExPTpfGVQGhLHCY1pslEyJ6/8y2x1y4wm/jGVk540ABmXPK9byThKvtc49g4 H3lg== 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 w20-20020a056402269400b00435df4369f4si24272252edd.586.2022.07.06.13.59.53; Wed, 06 Jul 2022 14:00:24 -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 S234389AbiGFUMh (ORCPT + 99 others); Wed, 6 Jul 2022 16:12:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234251AbiGFUMf (ORCPT ); Wed, 6 Jul 2022 16:12:35 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01C7119023 for ; Wed, 6 Jul 2022 13:12:34 -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 8F244620BB for ; Wed, 6 Jul 2022 20:12:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DDF8C3411C; Wed, 6 Jul 2022 20:12:33 +0000 (UTC) Date: Wed, 6 Jul 2022 16:12:31 -0400 From: Steven Rostedt To: LKML Cc: Ingo Molnar , Andrew Morton , Sascha Hauer , linux-arm-kernel@lists.infradead.org Subject: [PATCH] ftrace: Be more specific about arch impact when function tracer is enabled Message-ID: <20220706161231.085a83da@gandalf.local.home> 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 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) --- 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"