Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2094985pxj; Sat, 19 Jun 2021 02:47:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaJtqBDo5s/LWpJxLc+rwZeovMM8FMhmR/w2WBALPi4N9x9MqefIgHcJNY1X4xygER0yf/ X-Received: by 2002:a17:906:128e:: with SMTP id k14mr14963877ejb.485.1624096032941; Sat, 19 Jun 2021 02:47:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624096032; cv=none; d=google.com; s=arc-20160816; b=bgdjoEnW8R6vXyMyhlPRjNrCb+MNGzEsQl+/sNjpIAz5sLVrInsh6tLVDdMqhYCQo0 gewU0yCu610Ziyc9hMcDArvSkPU0pzgYK1gQSKtHMqH2g39pOUpo+f0HVuMZqhEgKWnu 0G+g/hRC7UGO2xhxU7CxlqxZdbSuHrnWrAmy1AHQqfbqv3ZeIwK3ozsSDcioUF+N7Qpb TiVtOAZZ3QKCg1aV8ffGROhJfo601TWC26CbJkNptaGgQaUicN1TWXbkoZOWknHxU2Ul eToHwUe4Td2AXHh/CsF4UiXaBKAwy9iPm6xCYCJuGCE9JxCGQBynEmqQWZPUXjii1pE5 onQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=satje05Sy3h2oy/8eA18kUbYlkCeZShb9T0g8woRyaQ=; b=NzwVmBM/7MEiyD5wPQ6RsZ9epiVhtvf6Nzx2iLX7jlh/K88vlUaLJILgz59mq/XgOJ aQowJ4bPjd0QPR7YDJDJkasMFKHpMg1GUT+rLppXv0G20kyvLnxeOvyyGGy7aUfo5WH/ Qb+YmJAtPbZ+xgqr8D+ViG0GR9egTqNG7CXkKHrIYh9XN7bGXLuZEVqY/NNCdaMIEMJw itu2RNy6h6nLEpXsj+TmN0/Uz6BkgvubRADP4ZJMkVe2LbtgFA2XFSyuwEPiIGD2T1Qm uqk5xEq577/hL+Y2qpNAaD6hV4jWR3fOHG4UA0nPGWcsMt/kOLukQI6u5CstBfY8YqIB DJUQ== 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 c11si1559134edy.282.2021.06.19.02.46.50; Sat, 19 Jun 2021 02:47:12 -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 S233870AbhFSGbi (ORCPT + 99 others); Sat, 19 Jun 2021 02:31:38 -0400 Received: from mail.loongson.cn ([114.242.206.163]:45474 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S233081AbhFSGbh (ORCPT ); Sat, 19 Jun 2021 02:31:37 -0400 Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dx70DBjs1gXRcUAA--.23357S3; Sat, 19 Jun 2021 14:29:22 +0800 (CST) From: Tiezhu Yang To: Steven Rostedt , Ingo Molnar , Jonathan Corbet Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Xuefeng Li Subject: [RFC PATCH 1/2] ftrace: Introduce cmdline argument ftrace_disabled Date: Sat, 19 Jun 2021 14:29:19 +0800 Message-Id: <1624084160-3342-2-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1624084160-3342-1-git-send-email-yangtiezhu@loongson.cn> References: <1624084160-3342-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf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80aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUjLZ2DUUUUU== X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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. 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; -- 2.1.0