From patchwork Sun Feb 25 15:17:03 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: 206052 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1620653dyb; Sun, 25 Feb 2024 07:18:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWAUEk/71ws8xGKjP9/4Dfkyxkr7innMzn/06wJKrWhON5N4rpYGB8Ktr2lLezrpQbrUEqRys3/eHzE/VNWVwZ7638v+A== X-Google-Smtp-Source: AGHT+IHUXiO2rOLVw8ewYQFXOzWlZNMu+wusKR0HLo4/zwst2p4JnBhNSsyg0s5L0wMwe52J3ZvP X-Received: by 2002:ac2:58f9:0:b0:512:8de5:2170 with SMTP id v25-20020ac258f9000000b005128de52170mr2322015lfo.38.1708874294615; Sun, 25 Feb 2024 07:18:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708874294; cv=pass; d=google.com; s=arc-20160816; b=lu41Fvb3q2O2bSL82hAz5PeIUh5qNmUplR2GgEJsC+rb099QmJhe0Wa4XiK9nfOvrR ms9UJ6U367bHvXsxy/gFsGwfNBeLjtHeMPathQq4fVUqzggk6RLRgQ8shBIgnEu3yMhd o6VI1l3heJINS2B9YtBOcYdBJ1VMUgSzPQFBXARJSQRpGS3VAr0qM+xRmpdNmSItJFLg xuRbCT/NphStw9MAYGp7aVDUfohwIY7dU4DiFRZ7vC4Pl51shRB9YenABkEJ9IFx/2U0 /3aIc5NOVsxNF/zmLyhRUjoKTT1R28QFOFOWHbXqHubOf1r0xsOFqOYDlP5/SWuEX+FA SrSw== 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=SIgps5XdV0XNwjZfT2uAI7g3mrspDldK9Qs8qQAfoa4=; b=PPLm5Jro33eM8Cnm66umXSgwY3c9yjQgI9GbN3N1L4W2sOqM0rwNlYGja4HwsiPCLb pd+/l9Yi7j7PbiFI7FKYbQ3bf/zdJLTKFbLh4MRsYIskVunt8/gpmIqYkNq6b9wdJkzL fuVsiW35zoipbA8spnDe8riZ88XmEvePWPOwxzAFKjO1dmTPggw1k6Yy3By4/od+C4qX v2OtuGFMNj6PDeld9zhbNB6Ixl4RlrCmz9UGLWOle93Sxu0TnxLa2IMsII7atsDN8TPV HlBQonVgM8RUzPnDeoAJam/f6qOkiLzp+1qdxG5lTMs56Prx+ApXD3IZMhm4OaWz/e82 xTiw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cop8ngK0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-80139-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80139-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id nc13-20020a1709071c0d00b00a3e7605b129si1348929ejc.318.2024.02.25.07.18.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Feb 2024 07:18:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80139-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cop8ngK0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-80139-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80139-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3AC0F1F2171C for ; Sun, 25 Feb 2024 15:18:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4CBE3182DD; Sun, 25 Feb 2024 15:17:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cop8ngK0" 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 9C57417993; Sun, 25 Feb 2024 15:17:09 +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=1708874229; cv=none; b=uIKLRbVcxxWpBhPooWkB/GgsGEjgrwwzgTNYW/NoN+6Mpn7qc/6dZzW0+DxWvMhyDDjQUoPkRQoRS0pegpT4DkJvOL9O76PFcKV94OysDvr93laSPzhTatoGxRG3mpOSAq3L3i1uunBz9vq7NS/vr3kdZ4aQVFuBsfFsLRcK1+o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708874229; c=relaxed/simple; bh=Lr0pIkw9vuGNLQkbuw0r2byq1uReNXl+ksUhuI+VOdA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=GmZ/Yl/Yk0AGVYBPLLCNzwhBGjH0uFXQ9CkGePhcYEb5VP+snTkI9LDpQwcupnURlfHd3uq7xalWMwJUEhhdMPuanT3/zSXgN8AKi1/D4uXmYUPOJ/H32MG3FzD92u9ufzQPR5Il/nqmRak6TTb2lJrFaqqVFoTFxzOZ6kJYCI4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cop8ngK0; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC7E7C433C7; Sun, 25 Feb 2024 15:17:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708874229; bh=Lr0pIkw9vuGNLQkbuw0r2byq1uReNXl+ksUhuI+VOdA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cop8ngK00gnehDTo+4e8Q/qjE94ORwqPAXO1z/raTvlQgg4K1WlvNnHCg9HQWBzEc OTSnK7YrpicOvSckbqI8ziTGZgD0vx8yQEb8phYJom9HZj9KZrLZreHb3AE0aB/fbi qXeUhL8mVn3x7jR8BaYbEmVm07tb7r85yUN6ms5ww8A0sTKtFGfjhbcUCa2EyRnGIZ zeiS4z2xd0TL3XCuK43hOcB2s2uqBhzbSj9ZA/REpwpv+Dx5WUJ1m3F0BUYM6WNfx/ qObCIWWZSmng29BMlGPiNDD38H6lMzgCHPVYikHkKSZxrL8lLElFMKdiFskWzpS+u8 9t1aoSLI0+ktQ== 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 v8 11/35] ftrace: Allow ftrace startup flags exist without dynamic ftrace Date: Mon, 26 Feb 2024 00:17:03 +0900 Message-Id: <170887422360.564249.13652839792543275813.stgit@devnote2> X-Mailer: git-send-email 2.34.1 In-Reply-To: <170887410337.564249.6360118840946697039.stgit@devnote2> References: <170887410337.564249.6360118840946697039.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: 1791884572380641216 X-GMAIL-MSGID: 1791884572380641216 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()