public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	"Joel Fernandes (Google)" <joel@joelfernandes.org>
Subject: kernel/trace/fgraph.c:253: warning: Function parameter or member 'task' not described in 'ftrace_graph_ret_addr'
Date: Wed, 20 Dec 2023 10:43:19 +0800	[thread overview]
Message-ID: <202312201054.4wPWNTRR-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   55cb5f43689d7a9ea5bf35ef050f12334f197347
commit: 76b42b63ed0d004961097d3a3cd979129d4afd26 function_graph: Move ftrace_graph_ret_addr() to fgraph.c
date:   5 years ago
config: x86_64-buildonly-randconfig-005-20230918 (https://download.01.org/0day-ci/archive/20231220/202312201054.4wPWNTRR-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231220/202312201054.4wPWNTRR-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/202312201054.4wPWNTRR-lkp@intel.com/

All warnings (new ones prefixed by >>):

   kernel/trace/fgraph.c:209:15: warning: no previous prototype for 'ftrace_return_to_handler' [-Wmissing-prototypes]
     209 | unsigned long ftrace_return_to_handler(unsigned long frame_pointer)
         |               ^~~~~~~~~~~~~~~~~~~~~~~~
   kernel/trace/fgraph.c:303:6: warning: no previous prototype for 'ftrace_graph_sleep_time_control' [-Wmissing-prototypes]
     303 | void ftrace_graph_sleep_time_control(bool enable)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/trace/fgraph.c:308:5: warning: no previous prototype for 'ftrace_graph_entry_stub' [-Wmissing-prototypes]
     308 | int ftrace_graph_entry_stub(struct ftrace_graph_ent *trace)
         |     ^~~~~~~~~~~~~~~~~~~~~~~
   kernel/trace/fgraph.c:315:25: warning: cast between incompatible function types from 'void (*)(long unsigned int,  long unsigned int,  struct ftrace_ops *, struct pt_regs *)' to 'void (*)(struct ftrace_graph_ret *)' [-Wcast-function-type]
     315 |                         (trace_func_graph_ret_t)ftrace_stub;
         |                         ^
   kernel/trace/fgraph.c: In function 'unregister_ftrace_graph':
   kernel/trace/fgraph.c:595:31: warning: cast between incompatible function types from 'void (*)(long unsigned int,  long unsigned int,  struct ftrace_ops *, struct pt_regs *)' to 'void (*)(struct ftrace_graph_ret *)' [-Wcast-function-type]
     595 |         ftrace_graph_return = (trace_func_graph_ret_t)ftrace_stub;
         |                               ^
>> kernel/trace/fgraph.c:253: warning: Function parameter or member 'task' not described in 'ftrace_graph_ret_addr'
>> kernel/trace/fgraph.c:253: warning: Function parameter or member 'idx' not described in 'ftrace_graph_ret_addr'
>> kernel/trace/fgraph.c:253: warning: Function parameter or member 'ret' not described in 'ftrace_graph_ret_addr'
>> kernel/trace/fgraph.c:253: warning: Function parameter or member 'retp' not described in 'ftrace_graph_ret_addr'


vim +253 kernel/trace/fgraph.c

   234	
   235	/**
   236	 * ftrace_graph_ret_addr - convert a potentially modified stack return address
   237	 *			   to its original value
   238	 *
   239	 * This function can be called by stack unwinding code to convert a found stack
   240	 * return address ('ret') to its original value, in case the function graph
   241	 * tracer has modified it to be 'return_to_handler'.  If the address hasn't
   242	 * been modified, the unchanged value of 'ret' is returned.
   243	 *
   244	 * 'idx' is a state variable which should be initialized by the caller to zero
   245	 * before the first call.
   246	 *
   247	 * 'retp' is a pointer to the return address on the stack.  It's ignored if
   248	 * the arch doesn't have HAVE_FUNCTION_GRAPH_RET_ADDR_PTR defined.
   249	 */
   250	#ifdef HAVE_FUNCTION_GRAPH_RET_ADDR_PTR
   251	unsigned long ftrace_graph_ret_addr(struct task_struct *task, int *idx,
   252					    unsigned long ret, unsigned long *retp)
 > 253	{
   254		int index = task->curr_ret_stack;
   255		int i;
   256	
   257		if (ret != (unsigned long)return_to_handler)
   258			return ret;
   259	
   260		if (index < 0)
   261			return ret;
   262	
   263		for (i = 0; i <= index; i++)
   264			if (task->ret_stack[i].retp == retp)
   265				return task->ret_stack[i].ret;
   266	
   267		return ret;
   268	}
   269	#else /* !HAVE_FUNCTION_GRAPH_RET_ADDR_PTR */
   270	unsigned long ftrace_graph_ret_addr(struct task_struct *task, int *idx,
   271					    unsigned long ret, unsigned long *retp)
   272	{
   273		int task_idx;
   274	
   275		if (ret != (unsigned long)return_to_handler)
   276			return ret;
   277	
   278		task_idx = task->curr_ret_stack;
   279	
   280		if (!task->ret_stack || task_idx < *idx)
   281			return ret;
   282	
   283		task_idx -= *idx;
   284		(*idx)++;
   285	
   286		return task->ret_stack[task_idx].ret;
   287	}
   288	#endif /* HAVE_FUNCTION_GRAPH_RET_ADDR_PTR */
   289	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2023-12-20  2:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202312201054.4wPWNTRR-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=joel@joelfernandes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=rostedt@goodmis.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