All of lore.kernel.org
 help / color / mirror / Atom feed
* [jolsa-perf:bpf/batch 3/19] kernel/trace/fgraph.c:338:12: error: use of undeclared identifier 'ftrace_graph_func'; did you mean 'ftrace_graph_stop'?
@ 2021-06-05 14:17 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-06-05 14:17 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 7403 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git bpf/batch
head:   a97ee897c79e933a2db6534c261debb0b74128cc
commit: eab4c0b2dead035b7b92bb88e94be65d15379ff0 [3/19] x86/ftrace: Make function graph use ftrace directly
config: mips-randconfig-r012-20210605 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 8ec9aa236e325fd4629cfeefac2919302e14d61a)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install mips cross compiling tool for clang build
        # apt-get install binutils-mips-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git/commit/?id=eab4c0b2dead035b7b92bb88e94be65d15379ff0
        git remote add jolsa-perf https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
        git fetch --no-tags jolsa-perf bpf/batch
        git checkout eab4c0b2dead035b7b92bb88e94be65d15379ff0
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   kernel/trace/fgraph.c:234:15: warning: no previous prototype for function 'ftrace_return_to_handler' [-Wmissing-prototypes]
   unsigned long ftrace_return_to_handler(unsigned long frame_pointer)
                 ^
   kernel/trace/fgraph.c:234:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   unsigned long ftrace_return_to_handler(unsigned long frame_pointer)
   ^
   static 
>> kernel/trace/fgraph.c:338:12: error: use of undeclared identifier 'ftrace_graph_func'; did you mean 'ftrace_graph_stop'?
           .func                   = ftrace_graph_func,
                                     ^~~~~~~~~~~~~~~~~
                                     ftrace_graph_stop
   kernel/trace/fgraph.c:52:6: note: 'ftrace_graph_stop' declared here
   void ftrace_graph_stop(void)
        ^
>> kernel/trace/fgraph.c:341:8: error: expected '}'
                                      FTRACE_OPS_GRAPH_STUB,
                                      ^
   kernel/trace/fgraph.c:337:38: note: to match this '{'
   static struct ftrace_ops graph_ops = {
                                        ^
   kernel/trace/fgraph.c:349:6: warning: no previous prototype for function 'ftrace_graph_sleep_time_control' [-Wmissing-prototypes]
   void ftrace_graph_sleep_time_control(bool enable)
        ^
   kernel/trace/fgraph.c:349:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void ftrace_graph_sleep_time_control(bool enable)
   ^
   static 
   2 warnings and 2 errors generated.


vim +338 kernel/trace/fgraph.c

   229	
   230	/*
   231	 * Send the trace to the ring-buffer.
   232	 * @return the original return address.
   233	 */
 > 234	unsigned long ftrace_return_to_handler(unsigned long frame_pointer)
   235	{
   236		struct ftrace_graph_ret trace;
   237		unsigned long ret;
   238	
   239		ftrace_pop_return_trace(&trace, &ret, frame_pointer);
   240		trace.rettime = trace_clock_local();
   241		ftrace_graph_return(&trace);
   242		/*
   243		 * The ftrace_graph_return() may still access the current
   244		 * ret_stack structure, we need to make sure the update of
   245		 * curr_ret_stack is after that.
   246		 */
   247		barrier();
   248		current->curr_ret_stack--;
   249	
   250		if (unlikely(!ret)) {
   251			ftrace_graph_stop();
   252			WARN_ON(1);
   253			/* Might as well panic. What else to do? */
   254			ret = (unsigned long)panic;
   255		}
   256	
   257		return ret;
   258	}
   259	
   260	/**
   261	 * ftrace_graph_get_ret_stack - return the entry of the shadow stack
   262	 * @task: The task to read the shadow stack from
   263	 * @idx: Index down the shadow stack
   264	 *
   265	 * Return the ret_struct on the shadow stack of the @task at the
   266	 * call graph at @idx starting with zero. If @idx is zero, it
   267	 * will return the last saved ret_stack entry. If it is greater than
   268	 * zero, it will return the corresponding ret_stack for the depth
   269	 * of saved return addresses.
   270	 */
   271	struct ftrace_ret_stack *
   272	ftrace_graph_get_ret_stack(struct task_struct *task, int idx)
   273	{
   274		idx = task->curr_ret_stack - idx;
   275	
   276		if (idx >= 0 && idx <= task->curr_ret_stack)
   277			return &task->ret_stack[idx];
   278	
   279		return NULL;
   280	}
   281	
   282	/**
   283	 * ftrace_graph_ret_addr - convert a potentially modified stack return address
   284	 *			   to its original value
   285	 *
   286	 * This function can be called by stack unwinding code to convert a found stack
   287	 * return address ('ret') to its original value, in case the function graph
   288	 * tracer has modified it to be 'return_to_handler'.  If the address hasn't
   289	 * been modified, the unchanged value of 'ret' is returned.
   290	 *
   291	 * 'idx' is a state variable which should be initialized by the caller to zero
   292	 * before the first call.
   293	 *
   294	 * 'retp' is a pointer to the return address on the stack.  It's ignored if
   295	 * the arch doesn't have HAVE_FUNCTION_GRAPH_RET_ADDR_PTR defined.
   296	 */
   297	#ifdef HAVE_FUNCTION_GRAPH_RET_ADDR_PTR
   298	unsigned long ftrace_graph_ret_addr(struct task_struct *task, int *idx,
   299					    unsigned long ret, unsigned long *retp)
   300	{
   301		int index = task->curr_ret_stack;
   302		int i;
   303	
   304		if (ret != (unsigned long)dereference_kernel_function_descriptor(return_to_handler))
   305			return ret;
   306	
   307		if (index < 0)
   308			return ret;
   309	
   310		for (i = 0; i <= index; i++)
   311			if (task->ret_stack[i].retp == retp)
   312				return task->ret_stack[i].ret;
   313	
   314		return ret;
   315	}
   316	#else /* !HAVE_FUNCTION_GRAPH_RET_ADDR_PTR */
   317	unsigned long ftrace_graph_ret_addr(struct task_struct *task, int *idx,
   318					    unsigned long ret, unsigned long *retp)
   319	{
   320		int task_idx;
   321	
   322		if (ret != (unsigned long)dereference_kernel_function_descriptor(return_to_handler))
   323			return ret;
   324	
   325		task_idx = task->curr_ret_stack;
   326	
   327		if (!task->ret_stack || task_idx < *idx)
   328			return ret;
   329	
   330		task_idx -= *idx;
   331		(*idx)++;
   332	
   333		return task->ret_stack[task_idx].ret;
   334	}
   335	#endif /* HAVE_FUNCTION_GRAPH_RET_ADDR_PTR */
   336	
   337	static struct ftrace_ops graph_ops = {
 > 338		.func			= ftrace_graph_func,
   339		.flags			= FTRACE_OPS_FL_INITIALIZED |
   340					   FTRACE_OPS_FL_PID
 > 341					   FTRACE_OPS_GRAPH_STUB,
   342	#ifdef FTRACE_GRAPH_TRAMP_ADDR
   343		.trampoline		= FTRACE_GRAPH_TRAMP_ADDR,
   344		/* trampoline_size is only needed for dynamically allocated tramps */
   345	#endif
   346		ASSIGN_OPS_HASH(graph_ops, &global_ops.local_hash)
   347	};
   348	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 25664 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-05 14:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-05 14:17 [jolsa-perf:bpf/batch 3/19] kernel/trace/fgraph.c:338:12: error: use of undeclared identifier 'ftrace_graph_func'; did you mean 'ftrace_graph_stop'? kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.