Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2480673pxj; Sat, 19 Jun 2021 13:43:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkQdCHscIpGloii3vH94Vx1y01CeFuWM8IE5iksGZ+uw74ou0uSPzuFUd2eKBroT8/FP00 X-Received: by 2002:a92:c152:: with SMTP id b18mr12240609ilh.282.1624135407592; Sat, 19 Jun 2021 13:43:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624135407; cv=none; d=google.com; s=arc-20160816; b=Zem5ROFUPS/yg5KKBZZxPSRtbphTvRvOBdmKHDpIymeFDfPXuHqEb3AEzUCCvAbcij 3+O570gCL/P/FbwuPfTv1Q3gmSiFwHwnQt9yFK4TDk2BX530mNn2OsxHPrAtLNYthOtR YEgzUxR0U2i4y4QZeG6LUaLitO8jTGXp9FfJ6KUNBMXlzdDIsL3CmJ30Kx4uKZVPxsgF XRYuNTvEUaJ8RKtOibuJ/O+lkZqgPGguBrj0LvECVSHU8DoPqKJM7eb38PlwfSxQen2Z DELxC7k4zwglDV+3GWZ3/QeHAr/SFyHB9uuHtnMVED7LnjKICkSSH1COxWunBro/IxP9 MNlg== 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=MR5wP1JByb37xxnnAb2n7d3DwoRarGcKs83MnvrsDVA=; b=d/8qHBqiyS2QN9xeseFGuVXTbN9b+FSRpTToIkCmo0VJBAYcuOuKsr7oarJK8YkHGz NyL4UvEVIwAbluL0/JI8v6obAN3lEoAbZLzeK8ont9iIfHbsrExH4i3/Bg3atM9MVXSB IFjY+nkKcP37lWhu2lmiRkp91Qk6GdZ+ybDtJT1Imkg4Qz6tmAPnOAPDvwWCx4G/Qhbx mMFIJqgSJr/4bnW5jxCrQA4W6cRfkab7bVq6WLrP61bJd8iURNpfEb1CKBoCJLJ6vOsM aMNWKOgmJ1j2l5MOfrzqHtA6w0PFGmw+5ObNX8JNuVgkk3diBTKcfBQgQOvctvxWwWlB 5P+A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g27si17879519iob.54.2021.06.19.13.43.15; Sat, 19 Jun 2021 13:43:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234530AbhFSPYQ (ORCPT + 99 others); Sat, 19 Jun 2021 11:24:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:35732 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230024AbhFSPYP (ORCPT ); Sat, 19 Jun 2021 11:24:15 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4849A60FE5; Sat, 19 Jun 2021 15:22:04 +0000 (UTC) Date: Sat, 19 Jun 2021 11:22:02 -0400 From: Steven Rostedt To: Tiezhu Yang Cc: Ingo Molnar , Jonathan Corbet , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Xuefeng Li Subject: Re: [RFC PATCH 1/2] ftrace: Introduce cmdline argument ftrace_disabled Message-ID: <20210619112202.0a2c7196@gandalf.local.home> In-Reply-To: <1624084160-3342-2-git-send-email-yangtiezhu@loongson.cn> References: <1624084160-3342-1-git-send-email-yangtiezhu@loongson.cn> <1624084160-3342-2-git-send-email-yangtiezhu@loongson.cn> 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 19 Jun 2021 14:29:19 +0800 Tiezhu Yang wrote: > If set CONFIG_FUNCTION_TRACER=y, we can use the following command to > disable ftrace after boot up: > echo 0 > /proc/sys/kernel/ftrace_enabled I'd love to just remove that. It's original purpose was to stop function tracing when the latency tracers were active. That's now done via a tracefs option. The "ftrace_enabled" really has no use anymore. > > ftrace_disabled is much stronger than ftrace_enabled, introduce a new > cmdline argument ftrace_disabled for user to control whether to disable > ftrace when boot up. "ftrace_disabled" is triggered when an anomaly is detected, and for the safety of the system, ftrace shuts down. It was never meant to be a user triggered event. You have no rationale for this change. What's the purpose of this? -- Steve > > Signed-off-by: Tiezhu Yang > --- > kernel/trace/ftrace.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c > index 72ef4dc..a015699 100644 > --- a/kernel/trace/ftrace.c > +++ b/kernel/trace/ftrace.c > @@ -5517,6 +5517,14 @@ static char ftrace_filter_buf[FTRACE_FILTER_SIZE] __initdata; > /* Used by function selftest to not test if filter is set */ > bool ftrace_filter_param __initdata; > > +static int __init set_ftrace_disabled(char *str) > +{ > + pr_info("Set ftrace_disabled to disable ftrace\n"); > + ftrace_disabled = 1; > + return 1; > +} > +__setup("ftrace_disabled", set_ftrace_disabled); > + > static int __init set_ftrace_notrace(char *str) > { > ftrace_filter_param = true;