Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2196408rdd; Fri, 12 Jan 2024 02:16:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGsJjxmM6xOhm7Pg2/ITH7NNeUyxEgNM6q9tlgb7VvWccayjLg3Uq6B99aOjXuoyVbV/gUr X-Received: by 2002:a17:903:487:b0:1d4:bce0:875d with SMTP id jj7-20020a170903048700b001d4bce0875dmr707411plb.128.1705054561203; Fri, 12 Jan 2024 02:16:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705054561; cv=none; d=google.com; s=arc-20160816; b=0YSuE0iZRAW8GTOvIuGXPZ+aX+wsNByH+lcEyOLfpPMCXTOI3dLYiOPcTtWVJ/ycnx tLO2R1/5g+zBgoTXs19UJ+6vC9nccXFo6Gexnc7FMrVschpb5NsWNo+TeQs3Tl6TJNwX VHNwjDHt+0N0ktDuhMOy5BEmb2vPZINtCYc1WqneCdCBrUE+akx4VRwaXxLrEM8+D4CF 0cxIHF0Q/CsA3cSVO/k21NdidYR5QkmFWvvhutwYTSqCq9y7aGdM8nI3Sw3xDyxzr7E4 t6vAvFxRH9cf283n8KUTz9rCMwuv9bjNf9OHkoykRPNa2w6StiFetKpXR7g8lC5o63Tg S3XA== 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=e19aMjyBcj8YvUj06W0kkVs70sAQ8Rm0yENW21CdRuk=; fh=SIgps5XdV0XNwjZfT2uAI7g3mrspDldK9Qs8qQAfoa4=; b=o5Sr46EDqr0J2wP5fkSHCcZukEqVzTs/yBTRFFK/B+5YKsCmZIxc7iQ40QSsSg/ycC SiuaHyWmNtrt0zoLTL+hD9QZ5aA5fMIsr0UNKNuKJPx5kvg8SIZvqNUbqoIo5POWwBl1 iGcZu4Fdx1WW1EAhhOSqGnad1VPJd+yi/rV/Zi8Gcib0xxVu9YmfZL+eSa7NCoNA6qz0 IfDyp6MDfBmnxnNWrC1ctsaPUHr7d8IwULvc72Zp8Df3cyd9bnjbq+cVNE1cow2GA5ww 6krMsyNc0PMCtWr9rUR+gwk9RKYVUY/vJkFISOiodECli9V6V6INlQDiygywPW0jBEbM Rrhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TywDYLX7; spf=pass (google.com: domain of linux-kernel+bounces-24559-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24559-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w19-20020a170902d11300b001d4401c42ffsi2737402plw.101.2024.01.12.02.16.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 02:16:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24559-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TywDYLX7; spf=pass (google.com: domain of linux-kernel+bounces-24559-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24559-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 82D52289574 for ; Fri, 12 Jan 2024 10:15:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3C74460BBF; Fri, 12 Jan 2024 10:13:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TywDYLX7" 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 6735760BBB; Fri, 12 Jan 2024 10:13:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3CB87C433F1; Fri, 12 Jan 2024 10:13:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705054400; bh=tceqhLe4cJhIgfqnJRj1OF3FBNK4igZzNJJ28B0Dd+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TywDYLX7N/QOqXQe/m78liBkfVdgieGCigbUxXSPTMT4C7R73bCnwycvrhos29fPZ unr1rWBYcN3Zc2Ega07ocRFoxy0CwCcF9DXq5L9XGzrZ+QekDiqaQ7M6ZxPjfaLP5W eNr8ZQc/AAA0Qy/RdZihJpHL42f54YBtWCc7lCcUCqrYfVuidOCvjOrg9ozCynl6qn hr2kHu5ArvYhi4j1PZCkmNNHI8lHqfbDMa8TbLyCFwQtSWKwjETKyexmfwEjoGdp5p cK8Z+abiy9JcdyV8FXbLU2wcilKxSkuHmsuXQQ2g61Y4DxXJNieyBN5cNePaQufrSn NDC34ZMC4XW0Q== 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 v6 12/36] ftrace: Allow ftrace startup flags exist without dynamic ftrace Date: Fri, 12 Jan 2024 19:13:13 +0900 Message-Id: <170505439363.459169.10485331447276132041.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <170505424954.459169.10630626365737237288.stgit@devnote2> References: <170505424954.459169.10630626365737237288.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 4df3f44043b8..c385ded1875f 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()