mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sven Schnelle <svens@linux.ibm.com>
To: Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>
Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org
Subject: [PATCH 2/7] x86/tracing: pass ftrace_regs to function_graph_enter()
Date: Wed,  4 Sep 2024 08:58:56 +0200	[thread overview]
Message-ID: <20240904065908.1009086-3-svens@linux.ibm.com> (raw)
In-Reply-To: <20240904065908.1009086-1-svens@linux.ibm.com>

Will be used later for printing function argument in the
function graph tracer.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
---
 arch/x86/include/asm/ftrace.h | 2 +-
 arch/x86/kernel/ftrace.c      | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h
index 0152a81d9b4a..9843d0c08e61 100644
--- a/arch/x86/include/asm/ftrace.h
+++ b/arch/x86/include/asm/ftrace.h
@@ -105,7 +105,7 @@ struct dyn_arch_ftrace {
 #ifndef __ASSEMBLY__
 
 void prepare_ftrace_return(unsigned long ip, unsigned long *parent,
-			   unsigned long frame_pointer);
+			   unsigned long frame_pointer, struct ftrace_regs *regs);
 
 #if defined(CONFIG_FUNCTION_TRACER) && defined(CONFIG_DYNAMIC_FTRACE)
 extern void set_ftrace_ops_ro(void);
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index b325f7e7e39a..a016b82de5e2 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -610,7 +610,7 @@ int ftrace_disable_ftrace_graph_caller(void)
  * in current thread info.
  */
 void prepare_ftrace_return(unsigned long ip, unsigned long *parent,
-			   unsigned long frame_pointer)
+			   unsigned long frame_pointer, struct ftrace_regs *fregs)
 {
 	unsigned long return_hooker = (unsigned long)&return_to_handler;
 	int bit;
@@ -637,7 +637,7 @@ void prepare_ftrace_return(unsigned long ip, unsigned long *parent,
 	if (bit < 0)
 		return;
 
-	if (!function_graph_enter(*parent, ip, frame_pointer, parent, NULL))
+	if (!function_graph_enter(*parent, ip, frame_pointer, parent, fregs))
 		*parent = return_hooker;
 
 	ftrace_test_recursion_unlock(bit);
@@ -650,7 +650,7 @@ void ftrace_graph_func(unsigned long ip, unsigned long parent_ip,
 	struct pt_regs *regs = &fregs->regs;
 	unsigned long *stack = (unsigned long *)kernel_stack_pointer(regs);
 
-	prepare_ftrace_return(ip, (unsigned long *)stack, 0);
+	prepare_ftrace_return(ip, (unsigned long *)stack, 0, fregs);
 }
 #endif
 
-- 
2.43.0


  parent reply	other threads:[~2024-09-04  6:59 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-04  6:58 [PATCH 0/7] add function arguments to ftrace Sven Schnelle
2024-09-04  6:58 ` [PATCH 1/7] tracing: add ftrace_regs to function_graph_enter() Sven Schnelle
2024-09-04  6:58 ` Sven Schnelle [this message]
2024-09-05  8:58   ` [PATCH 2/7] x86/tracing: pass " kernel test robot
2024-09-04  6:58 ` [PATCH 3/7] s390/tracing: " Sven Schnelle
2024-09-04  6:58 ` [PATCH 4/7] Add print_function_args() Sven Schnelle
2024-09-08 15:17   ` Masami Hiramatsu
2024-09-09  3:13   ` Donglin Peng
2024-09-04  6:58 ` [PATCH 5/7] tracing: add config option for print arguments in ftrace Sven Schnelle
2024-09-06  3:36   ` Zheng Yejian
2024-09-08 13:30     ` Masami Hiramatsu
2024-09-09  8:16       ` Sven Schnelle
2024-09-09 13:56         ` Masami Hiramatsu
2024-09-04  6:59 ` [PATCH 6/7] tracing: add support for function argument to graph tracer Sven Schnelle
2024-09-05  8:05   ` kernel test robot
2024-09-05  8:36   ` kernel test robot
2024-10-04 22:40   ` Steven Rostedt
2024-10-07  6:37     ` Sven Schnelle
2024-09-04  6:59 ` [PATCH 7/7] tracing: add arguments to function tracer Sven Schnelle
2024-09-06  3:49   ` Zheng Yejian
2024-10-04 22:43     ` Steven Rostedt
2024-09-05 15:16 ` [PATCH 0/7] add function arguments to ftrace Steven Rostedt
2024-09-06  6:18   ` Sven Schnelle
2024-09-06 14:07     ` Steven Rostedt
2024-09-08 13:28       ` Masami Hiramatsu
2024-09-09  7:52         ` Sven Schnelle
2024-09-13  6:03           ` Sven Schnelle
2024-09-20  8:17             ` Masami Hiramatsu

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=20240904065908.1009086-3-svens@linux.ibm.com \
    --to=svens@linux.ibm.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --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

Powered by JetHome