diff mbox series

[2/7] x86/tracing: pass ftrace_regs to function_graph_enter()

Message ID 20240904065908.1009086-3-svens@linux.ibm.com (mailing list archive)
State New
Delegated to: Masami Hiramatsu
Headers show
Series add function arguments to ftrace | expand

Commit Message

Sven Schnelle Sept. 4, 2024, 6:58 a.m. UTC
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(-)

Comments

kernel test robot Sept. 5, 2024, 8:58 a.m. UTC | #1
Hi Sven,

kernel test robot noticed the following build warnings:

[auto build test WARNING on s390/features]
[also build test WARNING on tip/x86/core linus/master v6.11-rc6 next-20240904]
[cannot apply to rostedt-trace/for-next rostedt-trace/for-next-urgent]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Sven-Schnelle/tracing-add-ftrace_regs-to-function_graph_enter/20240904-150232
base:   https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git features
patch link:    https://lore.kernel.org/r/20240904065908.1009086-3-svens%40linux.ibm.com
patch subject: [PATCH 2/7] x86/tracing: pass ftrace_regs to function_graph_enter()
config: x86_64-defconfig (https://download.01.org/0day-ci/archive/20240905/202409051620.5YBbYREt-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240905/202409051620.5YBbYREt-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409051620.5YBbYREt-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from include/linux/ftrace.h:23,
                    from include/linux/kprobes.h:28,
                    from arch/x86/kernel/process_64.c:35:
>> arch/x86/include/asm/ftrace.h:108:64: warning: 'struct ftrace_regs' declared inside parameter list will not be visible outside of this definition or declaration
     108 |                            unsigned long frame_pointer, struct ftrace_regs *regs);
         |                                                                ^~~~~~~~~~~


vim +108 arch/x86/include/asm/ftrace.h

   106	
   107	void prepare_ftrace_return(unsigned long ip, unsigned long *parent,
 > 108				   unsigned long frame_pointer, struct ftrace_regs *regs);
   109
diff mbox series

Patch

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