Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp220225lqq; Thu, 13 Jun 2024 00:33:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX7lBNjc/4L49ymBGYl4Ub/rwV90LjiKrbn31o9rGmkRKBWozEjK0rKvNVGaBWJerE/d4i9uA7fPmzhEFih1FCPXAqx287FG/YaP6q0Yw== X-Google-Smtp-Source: AGHT+IGBL5i7ahh395wowNxLabC10xvQPjkKrvRnAHfdHwtVls9kHVS/f2KlF8hvTFjNHz6IYS+7 X-Received: by 2002:a50:c058:0:b0:57c:9da5:fc09 with SMTP id 4fb4d7f45d1cf-57ca976b402mr2475388a12.23.1718264018757; Thu, 13 Jun 2024 00:33:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718264018; cv=pass; d=google.com; s=arc-20160816; b=radY1WDgpZqZA1s8aYWhgmnKdAcWnr2Kz6SaJ0kMOYusEzbB5we1/1mEVCqtUbPp9O p1vIF28i/yh3l2K9/Ft9Y1+xzuYC1aCXLz0Bt1nFKG7o16xOg9I3YPegCPCG7wrxfvU4 W6LlERC1dRAZloKnpyV2Aj6taU+nkLbwd3iYCKuPShNnXsndZuIB/5KcYX3wL+MVydvI Zxshe53CrZyv/BwyZCfhlv8/WByQ/g4NzNj7RDH92M5Q+7xkbp0Gg9DRmdyNSLxPqvyZ EatVHvVVGhV1kGz3qB8aLkNo+oR2QbjFwLfY84hDO1vwRo9HflRgMA6lhWCXYU/UWKzc WUvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=FQsuZ21+9cGptdlB0BPgeEv8WU9oI426BLaNkf2S+w0=; fh=wmFM1I2umfPilX4lhBJW2LQY8sxT3O9BM1z26htsg9Y=; b=OXDYJq2pYE0gPHo0c9a4BVdk+qCLUcrLRV8Wwu0ycSASnMPqCoSL1DzInuxLYetI81 miset6b46zebzoc3ee+lA3jUFkdmgOyRXpQeqLWoZ3k+io3L3y7RXlymHe14bFG80P5n Ec2mRJt+oqW8B3q3OXQUK3dKGooJ8mk/sSnJThSgSXcQ5jgHGwe/sA3dEVNhDLCrPVWV zvEFpQ2x7X2OTO0cNA3GLIJeQ38mb0jyy0wzbIzC86r/WjF7v9JtWasS5+JUuu9yyDwF cSzIHSjxNHyvkGPmtNmVmWri3+5CafdKfCINF+Sn14zmJhVS/pT//gx5ylCn4BrFRf1g WMtA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b="etP/LdQK"; arc=pass (i=1 spf=pass spfdomain=sifive.com dkim=pass dkdomain=sifive.com dmarc=pass fromdomain=sifive.com); spf=pass (google.com: domain of linux-kernel+bounces-212711-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212711-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57cb72d60a5si434145a12.12.2024.06.13.00.33.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 00:33:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212711-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b="etP/LdQK"; arc=pass (i=1 spf=pass spfdomain=sifive.com dkim=pass dkdomain=sifive.com dmarc=pass fromdomain=sifive.com); spf=pass (google.com: domain of linux-kernel+bounces-212711-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212711-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A1B801F21A61 for ; Thu, 13 Jun 2024 07:33:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6CEFB13CABB; Thu, 13 Jun 2024 07:32:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="etP/LdQK" Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41CD213C9D5 for ; Thu, 13 Jun 2024 07:32:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263969; cv=none; b=riBfeXTLvnvABACODMUqwKSgSH9plsff6x+6jMBIcPj7QYXYuyTx7hnV13IwVBfKQVQ0Zr7Ua3WnJqpTfBokq+6g71SgC7103eWAQ9euuyAqVtPozGl6cq/zuejnmcI54qwcc6bFHxH55N0jkUS1/rfmtNX9833QreI3PSGGaB0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718263969; c=relaxed/simple; bh=vgghTaDxluToi5kVZZlG6AV2uIZ41UbFwSgx4K8n064=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DYflUeXAooeKX4ixWzLOYA4DkJUhB9rtyPjSUH+2yUBNfm+YX7cNX4Ss6ZZENrFA1OJaVadzu8BGJqVP4FT6ohCsvpw0aMGeHY+i5SEnOO5Odi1bcWgaJngwVdkKjEqWY7cBpQytTxAA1H+xrIGOeH+I6mVvWdoQhPXRhXuXC3I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sifive.com; spf=pass smtp.mailfrom=sifive.com; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b=etP/LdQK; arc=none smtp.client-ip=209.85.210.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sifive.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sifive.com Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-705959a2dfbso497663b3a.1 for ; Thu, 13 Jun 2024 00:32:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1718263967; x=1718868767; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=FQsuZ21+9cGptdlB0BPgeEv8WU9oI426BLaNkf2S+w0=; b=etP/LdQKyC3qb2zXfttY13aPyp4lbQJSHThwPFHEZQmKBlrzDRfA1y6lR4uMZYATe6 V+OCUa/8NMQONuM38CD388H5XUH/WZa6pTNxoYx2wKr9j3+RQkjchGBgInGwMxnGtzmd cbbUU1FD8S5KoyaGrqyKIMWY/4i5vQr5fUM3mn1JduSSaptEMQqIj4AfFJhxWPzry+MV huaa4WT5nzwFIDPP4/06hjQrXtThG/37yjeUIBNdr7Lu/rJxC8ucf88tLFTeRj/VH+/O m0jR20ArNZH4xunC6yqvVdkLzewbY37UM3hMzfgLirBtsKzsHIrPk01ozwGKRywAwOo1 l4ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718263967; x=1718868767; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FQsuZ21+9cGptdlB0BPgeEv8WU9oI426BLaNkf2S+w0=; b=RcjCun++5YxKGHblOS9FBjfR7xEuYYjq2F/voy+PlN3yOjh00YNxASCeacHKNDp6Lp ZbKQxID1jd5dqQizHa9iuewcCv/FTCru1Se9oaq4WpG0MTDLeJm9xvGRXVUylVPFRLAE ht+47hA1LykKtwsM5o1BOlW+0vRMPgJltwbG6avAUcVnaqBCttDx10bT9ksi60zMz9js A5eyUzCezklqbQ7JmrqGi1bIWBKaTW8LOPNKSy9z7gssntYN0TLnuMWZ9LWbaRVvB8jA XjggA8gHJuQDWkPYYfxacAcX/DVA/RDIg4y/QhkyjR0dQQH+YFAUfm2XH1NQRsBbiJ4b 7FGA== X-Forwarded-Encrypted: i=1; AJvYcCW81atqxBZil8fvF3PCKTxc9o6Gl6Qo0NEA8hXKG0abu6JdV2S5LEL/QFHmM6RPF0HWI3vQyj3xPnzRvfMo2aceG8W2q56Br6aMg39x X-Gm-Message-State: AOJu0YzpFNf/JSJox8TIr/CT9r9opVyZy9hHf7lV39EcubxUdfjCrZJy 7SkBaHrL31DxAVYUNw+awj1DWHQFnC1fIkdTArEsLndVb+xSRIxycKMRFI8UHho= X-Received: by 2002:a62:ab02:0:b0:705:d101:90ff with SMTP id d2e1a72fcca58-705d101919bmr283959b3a.16.1718263967547; Thu, 13 Jun 2024 00:32:47 -0700 (PDT) Received: from [127.0.1.1] (59-124-168-89.hinet-ip.hinet.net. [59.124.168.89]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-705cc78a1a0sm730028b3a.0.2024.06.13.00.32.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 00:32:47 -0700 (PDT) From: Andy Chiu Date: Thu, 13 Jun 2024 15:11:07 +0800 Subject: [PATCH 2/8] tracing: do not trace kernel_text_address() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240613-dev-andyc-dyn-ftrace-v4-v1-2-1a538e12c01e@sifive.com> References: <20240613-dev-andyc-dyn-ftrace-v4-v1-0-1a538e12c01e@sifive.com> In-Reply-To: <20240613-dev-andyc-dyn-ftrace-v4-v1-0-1a538e12c01e@sifive.com> To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Zong Li , Steven Rostedt , Masami Hiramatsu , Mark Rutland , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Puranjay Mohan Cc: Palmer Dabbelt , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, llvm@lists.linux.dev, Andy Chiu X-Mailer: b4 0.12.4 kernel_text_address() and __kernel_text_address() are called in arch_stack_walk() of riscv. This results in excess amount of un-related traces when the kernel is compiled with CONFIG_TRACE_IRQFLAGS. The situation worsens when function_graph is active, as it calls local_irq_save/restore in each function's entry/exit. This patch adds both functions to notrace, so they won't show up on the trace records. Signed-off-by: Andy Chiu --- kernel/extable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/extable.c b/kernel/extable.c index 71f482581cab..d03fa462fa8b 100644 --- a/kernel/extable.c +++ b/kernel/extable.c @@ -74,7 +74,7 @@ int notrace core_kernel_text(unsigned long addr) return 0; } -int __kernel_text_address(unsigned long addr) +int notrace __kernel_text_address(unsigned long addr) { if (kernel_text_address(addr)) return 1; @@ -91,7 +91,7 @@ int __kernel_text_address(unsigned long addr) return 0; } -int kernel_text_address(unsigned long addr) +int notrace kernel_text_address(unsigned long addr) { bool no_rcu; int ret = 1; -- 2.43.0