[v5,03/12] tracing: Add a comment about the requirements of the ftrace_regs

Message ID 169556258347.146934.12248055282843332442.stgit@devnote2
State New
Headers
Series tracing: fprobe: rethook: Use ftrace_regs instead of pt_regs |

Commit Message

Masami Hiramatsu (Google) Sept. 24, 2023, 1:36 p.m. UTC
  From: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Add a comment about the requirements of the ftrace_regs if it is
implemented on the arch-dependent code with
CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS.

Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
---
 include/linux/ftrace.h |    8 ++++++++
 1 file changed, 8 insertions(+)
  

Patch

diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index e8921871ef9a..5da70f238645 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -118,6 +118,14 @@  extern int ftrace_enabled;
 
 #ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS
 
+/*
+ * The ftrace_regs will be just a wrapper of the pt_regs if
+ * CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS is not set. If it is set on an
+ * architecture, it has to define the ftrace_regs data structure.
+ * The ftrace_regs is expected to save the registers for the function
+ * arguments, the registers for stack dump (e.g. stack pointer and the
+ * frame pointer) and the instruction pointer for reference.
+ */
 struct ftrace_regs {
 	struct pt_regs		regs;
 };