From: Chengming Zhou <zhouchengming@bytedance.com>
To: rostedt@goodmis.org, mark.rutland@arm.com, mingo@redhat.com,
tglx@linutronix.de, catalin.marinas@arm.com, will@kernel.org,
dave.hansen@linux.intel.com, broonie@kernel.org
Cc: x86@kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, songmuchun@bytedance.com,
qirui.001@bytedance.com,
Chengming Zhou <zhouchengming@bytedance.com>
Subject: [PATCH v3 1/3] ftrace: cleanup ftrace_graph_caller enable and disable
Date: Thu, 24 Feb 2022 17:32:49 +0800 [thread overview]
Message-ID: <20220224093251.49971-1-zhouchengming@bytedance.com> (raw)
The ftrace_enable_ftrace_graph_caller() and
ftrace_disable_ftrace_graph_caller() are used to do special
hooks for graph tracer, which are not needed on some ARCHs
that use graph_ops:func function to install return_hooker.
So introduce the weak version in Ftrace core code to prepare
for cleanup.
Signed-off-by: Chengming Zhou <zhouchengming@bytedance.com>
---
kernel/trace/ftrace.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index f9feb197b2da..60ae009e6684 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2704,6 +2704,26 @@ int __weak ftrace_arch_code_modify_post_process(void)
return 0;
}
+#ifdef CONFIG_FUNCTION_GRAPH_TRACER
+/*
+ * archs can override this function if they must do something
+ * to enable hook for graph tracer.
+ */
+int __weak ftrace_enable_ftrace_graph_caller(void)
+{
+ return 0;
+}
+
+/*
+ * archs can override this function if they must do something
+ * to disable hook for graph tracer.
+ */
+int __weak ftrace_disable_ftrace_graph_caller(void)
+{
+ return 0;
+}
+#endif
+
void ftrace_modify_all_code(int command)
{
int update = command & FTRACE_UPDATE_TRACE_FUNC;
--
2.20.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2022-02-24 9:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-24 9:32 Chengming Zhou [this message]
2022-02-24 9:32 ` [PATCH v3 2/3] x86/ftrace: cleanup graph tracer Chengming Zhou
2022-02-24 9:32 ` [PATCH v3 3/3] arm64/ftrace: Make function graph use ftrace directly Chengming Zhou
2022-03-22 12:48 ` Chengming Zhou
2022-03-22 13:41 ` Steven Rostedt
2022-03-22 14:14 ` [External] " Chengming Zhou
2022-03-22 14:49 ` Steven Rostedt
2022-04-07 2:26 ` Chengming Zhou
2022-04-07 8:58 ` Mark Brown
2022-04-07 12:39 ` Chengming Zhou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220224093251.49971-1-zhouchengming@bytedance.com \
--to=zhouchengming@bytedance.com \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=dave.hansen@linux.intel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=qirui.001@bytedance.com \
--cc=rostedt@goodmis.org \
--cc=songmuchun@bytedance.com \
--cc=tglx@linutronix.de \
--cc=will@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox