From patchwork Tue Feb 6 15:09:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 197491 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:168b:b0:106:860b:bbdd with SMTP id ma11csp1607002dyb; Tue, 6 Feb 2024 07:13:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFcfJgWlxH+kR5wwwTYvhLVPqhZT/bfUjtYXuSYt02ZfJaKi3K5LWlbsZbezJrYHOr3OT+f X-Received: by 2002:a17:902:f68e:b0:1d9:63ac:f54a with SMTP id l14-20020a170902f68e00b001d963acf54amr2398315plg.36.1707232399892; Tue, 06 Feb 2024 07:13:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707232399; cv=pass; d=google.com; s=arc-20160816; b=Fl4N8Ywnpsctbs5Z5wjM/YjXW4LC+KvmDzG0goCxANewpZmcmOMNNg8LlrJDcKSpLK XEqWaIoZ3v1ZH1UnsOg7FR0qwEpWEtONyaqUB+S9zMZDzAHd/Uz4xt1gZPsEvZu1KEeQ rSOUqgbR70QY6Rb5gVbzGqJHVLBd3ooNjrB9E6qScVSPcnLOiFPK8yopdKZY5U9dS2mk 5O+UB/AnwRqKXsRtSWmOZwL+8WfHDL+3OKtOQvSBjTko8zW39EQKya/XuSpoHpShsTer SMJ1X+FqYsur5RTDExBUFvL12Jf0+/fMCBfbjuI2dbNXZGKtYSgyfrvj+k3YZSgS1dyD 1H1g== ARC-Message-Signature: i=2; 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=rZyrIN0YHDigS9kpRkpOdAZzAkkfxVufaPnk5YTtw+A=; fh=gvvLH1P1dWPpFk1pXpEhQ8v88Vbnc5XIhLAG6Q4Q7fo=; b=GV8Ww8t5cJczeZPVsbl+TUHNZZySp0rBbQH502YCLBmDYQDdxeX9mQONIN//1ol7CK 3sph7nJHSguR6ni5FqwvpeVej7yfttrkFm//b4SA9AmluU84xGT0JMKxHAChrbDMMJmK shIW4Jj26KhhsyXdfI3eIoRwViHzAbTXTZY6Eo9uywYMlP1hMPtnUD631WrA4yvUge8y Dwxi9HTmPdcj3frWDwRDQoB3KlmUJKQ2eFAsw5fk2LsZEWyRxTJGa/BDD94fTfylA8EQ uvrmRoj5hXYcLKe/FUEJiXSztMdvyESOgBQDF5hZf3J1wcXoyTstN7IP3XN7774IF197 Tjrw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EiuE64g8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-55190-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55190-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCUn8W8CMMK1kftmUozIRCnil/Z+FHO+inT2aM3VaCf0iM8QKh8/jMkKcBFI7yi9vnDfk79zbAU3E+ihmvH8Tg24C+xGPw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t3-20020a170902e84300b001d556872df5si1863675plg.335.2024.02.06.07.13.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 07:13:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55190-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EiuE64g8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-55190-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55190-ouuuleilei=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 7F22B284421 for ; Tue, 6 Feb 2024 15:13:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DBB75136643; Tue, 6 Feb 2024 15:09:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EiuE64g8" 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 37687133299; Tue, 6 Feb 2024 15:09:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707232189; cv=none; b=aI8fAYxuIkfiQCX/UFquFcJx3jB7VPUB634qThwTTuEnfXYd4ZNQOYKElwd4yV2vxk5iAqV3LHLku6iFBNWKohgm9upBqfap+oEIjrE7iYRU9nx83kQeKamyxtwEO4VOWcrTNCupF5vjc5mVheSFqkTrFlbw6vDYXQVueCHs+Xg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707232189; c=relaxed/simple; bh=Lr0pIkw9vuGNLQkbuw0r2byq1uReNXl+ksUhuI+VOdA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=leJKDoFAvc91uF6PRqU0HkDVyVSyf3qk6zdK0NV6jkwtci1HBLruTXVWzPlw8K6KlPAcWKCKYoLLAvfehUxi12pjr1OPbocMoFR9rMDLKFoqCY11Rf4kJG0WKVMMZuzBtg0O6LLsCEZQ/jrJt6nRWq9SQ7GUiJ/YUr3FTAc+TJc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EiuE64g8; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96D83C433F1; Tue, 6 Feb 2024 15:09:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707232189; bh=Lr0pIkw9vuGNLQkbuw0r2byq1uReNXl+ksUhuI+VOdA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EiuE64g88WU790pDeY11J1U7S4TOQd1rwE+YPpEWX8RjqhIzS7v7bRdqNJ7hJsq4T f5b3GV/+QJ0ZpRWkaosolCkzj4Rmqut2mlfRJ9JC/pm7fFBe9f1AK8U06rLfmoa4yN TRWobJRY+tmleWsWpnvf0eWbEocMUmQPBqlWla99Q52STLCwizkN54uvW11uabj4Ve SEDFVp6wZpYEkcsK1cW22Kiq3G1bTgE44lUyyKHmXJH7e2eA/1H3RyUQACV2m3W4AA 0EdS2qyVRzMByBnRWf0OiWJDM3mmBrwgCR+XC12JH8O9ccT1x8TE95D2SoFzXPQsny c3J+FkNseL02Q== 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 v7 12/36] ftrace: Allow ftrace startup flags exist without dynamic ftrace Date: Wed, 7 Feb 2024 00:09:43 +0900 Message-Id: <170723218353.502590.15434076519096691266.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <170723204881.502590.11906735097521170661.stgit@devnote2> References: <170723204881.502590.11906735097521170661.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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790162921152018522 X-GMAIL-MSGID: 1790162921152018522 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 17aa123d134e..b87f9676f5ce 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()