Received: by 2002:a05:7412:a9a3:b0:f9:327e:43ab with SMTP id o35csp90181rdh; Mon, 18 Dec 2023 05:21:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IGChfyBp3FCbf1fnQJwzJdb38XaZmRLjSLKslEHDo9FsM0orzEUSZdUNDTgRC3gGpBssT4c X-Received: by 2002:a17:902:b489:b0:1d0:cdaf:6c8b with SMTP id y9-20020a170902b48900b001d0cdaf6c8bmr7676709plr.38.1702905698735; Mon, 18 Dec 2023 05:21:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702905698; cv=none; d=google.com; s=arc-20160816; b=zUKwA1TyAOfua0mhBCNzoT9lSQbk1hrb8pwx/q2H+Ka8JoT5+JDAFXLkGIkZyjqtOj ogwT6PQUzSrP43jxdD0bA71iEzVGXKRuRpOoOOTFxZpT7x6H57aOmwNljgO8VC7bMLut MpJA9KI62Msq+Snyjxc/791NH5aJ3BxKohdP1yb3AwPPOPOl98Ri1RYsgbrRJrvoxHy+ tYddUVykJVFug0oW5NBowNMAIuCNLLY6PkjfIjC/hI9gxBhuxCgv9dtzOQIzbPEypA5h HOtL2CdKMr8USy4lvQAM0wx7l4B3mguLpdtc0E+USUk7Yv2srp/Ck514ZlvE9fw55w7e FKbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=8FG1EfTvjghHx0E3OCkHobbbNVNqEcUAtmh9UlmGtc4=; fh=SIgps5XdV0XNwjZfT2uAI7g3mrspDldK9Qs8qQAfoa4=; b=xZgPmoZOkPwk/VcnWfnLeA4CdpIR8amMq6k9s4dmvJy+qDZpjrpX94QzozEwgh8Rda RMasqMHH1a5OUycwXEbaMuyhZz9H+eCpkXSnEEjWoR9Bo/99tzkVIMt2kTgf2elaxQf5 b09dfyFdk6PXQ2SbwpdrMa5ONHj9ZL9SboYDRVQHydGPbeJPeU+VnZuE4AltNqioWwOI mXicIRO6ah7ImdE57a1h/hpA+iBurtOQcU35iPgC7CozO3X9WlsPzuPTGrcF4PIZgUgQ PW7HseKk9JL66zyMpIA+FxSHJ9UNmNFqhJqPkBaTjCE+2jH2ToWbuJQxDtOPtwt0qdQX fpGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Yp+m8YiN; spf=pass (google.com: domain of linux-kernel+bounces-3714-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3714-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id b17-20020a170902ed1100b001d35084e9fdsi3904643pld.406.2023.12.18.05.21.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 05:21:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3714-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Yp+m8YiN; spf=pass (google.com: domain of linux-kernel+bounces-3714-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3714-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 1558FB232C2 for ; Mon, 18 Dec 2023 13:18:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6267E5D733; Mon, 18 Dec 2023 13:13:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Yp+m8YiN" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88DFC129EEA; Mon, 18 Dec 2023 13:13:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 401B8C433C9; Mon, 18 Dec 2023 13:13:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702905220; bh=6ERBwQiaxIIDNTVWPQkxDhl1p/zo1tlsKma+ZLC6cPI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yp+m8YiN4jqZmTCwN+s6tL40x6/4MhDzmftp0QScJ+ZmFEHNSEWYch7AeJyW/Wol6 JKz77GRk4rfBswF7gDNzIbMbizUVEADZa1H+BrwOXYj5Xjn4w/IrIBcwu4Vdy641nd v78ZnyRESnIE12dYKgB03SCht6RYBe/LJksqhYicMg1edbRjx4OEwa5W6ZtYFysSFj OYqMm+ZcrK5RI/9eXp5XR07nEiLF9bWLlTtBTyJJ8DrWEmg5vSw90ul2FAr8mfjc9q 2ZyIj1Bvlh8CyqxK9wq0HI7auqkBaUkKEDxonL5pSvtAE/x+pefAWP9qX/W4SvGq5a je8z3glSjjdPA== From: "Masami Hiramatsu (Google)" To: Alexei Starovoitov , Steven Rostedt , Florent Revest Cc: linux-trace-kernel@vger.kernel.org, LKML , Martin KaFai Lau , bpf , Sven Schnelle , Alexei Starovoitov , Jiri Olsa , Arnaldo Carvalho de Melo , Daniel Borkmann , Alan Maguire , Mark Rutland , Peter Zijlstra , Thomas Gleixner , Guo Ren Subject: [PATCH v5 10/34] ftrace: Allow ftrace startup flags exist without dynamic ftrace Date: Mon, 18 Dec 2023 22:13:33 +0900 Message-Id: <170290521312.220107.11377564145378408570.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <170290509018.220107.1347127510564358608.stgit@devnote2> References: <170290509018.220107.1347127510564358608.stgit@devnote2> User-Agent: StGit/0.19 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: 8bit From: Steven Rostedt (VMware) Some of the flags for ftrace_startup() may be exposed even when CONFIG_DYNAMIC_FTRACE is not configured in. This is fine as the difference between dynamic ftrace and static ftrace is done within the internals of ftrace itself. No need to have use cases fail to compile because dynamic ftrace is disabled. This change is needed to move some of the logic of what is passed to ftrace_startup() out of the parameters of ftrace_startup(). Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Masami Hiramatsu (Google) --- include/linux/ftrace.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 0955baccbb87..7b08169aa51d 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -538,6 +538,15 @@ static inline void stack_tracer_disable(void) { } static inline void stack_tracer_enable(void) { } #endif +enum { + FTRACE_UPDATE_CALLS = (1 << 0), + FTRACE_DISABLE_CALLS = (1 << 1), + FTRACE_UPDATE_TRACE_FUNC = (1 << 2), + FTRACE_START_FUNC_RET = (1 << 3), + FTRACE_STOP_FUNC_RET = (1 << 4), + FTRACE_MAY_SLEEP = (1 << 5), +}; + #ifdef CONFIG_DYNAMIC_FTRACE void ftrace_arch_code_modify_prepare(void); @@ -632,15 +641,6 @@ void ftrace_set_global_notrace(unsigned char *buf, int len, int reset); void ftrace_free_filter(struct ftrace_ops *ops); void ftrace_ops_set_global_filter(struct ftrace_ops *ops); -enum { - FTRACE_UPDATE_CALLS = (1 << 0), - FTRACE_DISABLE_CALLS = (1 << 1), - FTRACE_UPDATE_TRACE_FUNC = (1 << 2), - FTRACE_START_FUNC_RET = (1 << 3), - FTRACE_STOP_FUNC_RET = (1 << 4), - FTRACE_MAY_SLEEP = (1 << 5), -}; - /* * The FTRACE_UPDATE_* enum is used to pass information back * from the ftrace_update_record() and ftrace_test_record()