From patchwork Fri Dec 8 10:26:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 175737 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp5362872vqy; Fri, 8 Dec 2023 02:27:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IHv4pxntse73Z70EKjl/T8AvOp7BRkFCGbjVPvA2m1hYToPl8A5Z5uCyVw1rtrX1qN+OjGK X-Received: by 2002:a17:902:e746:b0:1d0:6ffe:a09 with SMTP id p6-20020a170902e74600b001d06ffe0a09mr4788273plf.103.1702031234066; Fri, 08 Dec 2023 02:27:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702031234; cv=none; d=google.com; s=arc-20160816; b=k+qzf26CFPch+ncVADNa1wUOINlvzMgrxt3ryks3ciEXssKY9VzVlHlvqpN1FDuXih 7jhp6HQbfdoUoBEukq3qxzfQ5z3FNyqGZGk9evmqZsKbx9hIRJT/gNuOeDIFGBHa0Dl7 v2D8aiRSkgV7jHCMrL0Aj2g+jT0jU9dBY8cXLTFKB0EuPGHwdXRCkS1z1jIzj8KltY/V baQSRg674iFZQd3YZjOV7J2OqVpTP2aB1n20GRR7Yx6YYbCtrN6l1OH+fMAjII3Vkv8T r6Mm9KfaSGHTCJvCRtxxKVr5BZf38sHQM8yC2VNzhG7iNlCtAs+uHpi+gB6EgwGg6m+q CEDQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8FG1EfTvjghHx0E3OCkHobbbNVNqEcUAtmh9UlmGtc4=; fh=SIgps5XdV0XNwjZfT2uAI7g3mrspDldK9Qs8qQAfoa4=; b=mJPXuuaKFGhWqTCted9A8vA8RQNSGe1I6O129nG1Wx6HsIcZ8v2q6kUJaGWnNmjyqG 3NYimwDnwfWBxGxm0VfUoi2Rphx7jPc4XNPt3bQDqkzxHI4PwpiXn9YQUQhDbFRq3Krr eVb2sFL+I3UcCcNIcdUhfgjCFRDQxp4rAwCqyTA9bjkiXbXZyiiWCY3T170IL8Wd2/Jc Gh5iX4qxTbN4b8QJiJo23/BfUW//TGutv8BR8YBft3Fd1eAAOl88UIle7pGK4ZKn+jg2 Dl/H9gl3BkJLiOq0ctyGGek2wKSNRPQgMMxAyF1UPZINnq+iczOoPMCQz1JL9L25936/ 7W/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WGQ5K1W9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id l4-20020a170903244400b001d09278b856si1376159pls.347.2023.12.08.02.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 02:27:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WGQ5K1W9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 8654D80944EC; Fri, 8 Dec 2023 02:27:11 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573473AbjLHK05 (ORCPT + 99 others); Fri, 8 Dec 2023 05:26:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573726AbjLHK0b (ORCPT ); Fri, 8 Dec 2023 05:26:31 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31BF01FE4 for ; Fri, 8 Dec 2023 02:26:23 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D4EAC433C8; Fri, 8 Dec 2023 10:26:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702031183; bh=6ERBwQiaxIIDNTVWPQkxDhl1p/zo1tlsKma+ZLC6cPI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WGQ5K1W971s+MC8xP9/LxQdkaHOiHnfgk/icKi5ZJGXIe9pv0HE2mtuVnmgTTf0LK +Mg5P/tMiJCUNfxZHEFB3rLHRTNZEf0XY1Fg9nur6vtPB0N0kHTU+Ez2xvqL9CGaVa F0AeU2oqMCZKXGaQlaTmHYeHTFjdFvBXFfCWSJG+pgaovzd5cYoVQ8YyBlqeg8L0cI 5U0vE53REDc/LnaWQkH4TgiQEom4WsQBG3GybRytkNUigmV7+TX8kMI3BpYCwYvRtU j2UXOH44qRsk6bTWbv2bzLmL1uWHwrS2mNipDxui3epimDdQcKqSaPXxz5pLKDLh82 ZyK6Es3/iqzDw== 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 v4 10/33] ftrace: Allow ftrace startup flags exist without dynamic ftrace Date: Fri, 8 Dec 2023 19:26:18 +0900 Message-Id: <170203117769.579004.5659514449783521216.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <170203105427.579004.8033550792660734570.stgit@devnote2> References: <170203105427.579004.8033550792660734570.stgit@devnote2> User-Agent: StGit/0.19 MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 08 Dec 2023 02:27:11 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784709102954522464 X-GMAIL-MSGID: 1784709102954522464 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()