mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* kernel/trace/trace_kprobe.c:952: warning: Excess function parameter 'args' description in '__kprobe_event_gen_cmd_start'
@ 2023-10-18 20:33 kernel test robot
  2023-10-19 13:22 ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2023-10-18 20:33 UTC (permalink / raw)
  To: Tom Zanussi; +Cc: oe-kbuild-all, linux-kernel, Steven Rostedt (VMware)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   dd72f9c7e512da377074d47d990564959b772643
commit: 2a588dd1d5d649a183a2ff6fa1b80e870cf821d8 tracing: Add kprobe event command generation functions
date:   3 years, 9 months ago
config: x86_64-randconfig-x012-20230629 (https://download.01.org/0day-ci/archive/20231019/202310190437.paI6LYJF-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/20231019/202310190437.paI6LYJF-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/202310190437.paI6LYJF-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> kernel/trace/trace_kprobe.c:952: warning: Excess function parameter 'args' description in '__kprobe_event_gen_cmd_start'
>> kernel/trace/trace_kprobe.c:1017: warning: Excess function parameter 'args' description in '__kprobe_event_add_fields'


vim +952 kernel/trace/trace_kprobe.c

   929	
   930	/**
   931	 * __kprobe_event_gen_cmd_start - Generate a kprobe event command from arg list
   932	 * @cmd: A pointer to the dynevent_cmd struct representing the new event
   933	 * @name: The name of the kprobe event
   934	 * @loc: The location of the kprobe event
   935	 * @kretprobe: Is this a return probe?
   936	 * @args: Variable number of arg (pairs), one pair for each field
   937	 *
   938	 * NOTE: Users normally won't want to call this function directly, but
   939	 * rather use the kprobe_event_gen_cmd_start() wrapper, which automatically
   940	 * adds a NULL to the end of the arg list.  If this function is used
   941	 * directly, make sure the last arg in the variable arg list is NULL.
   942	 *
   943	 * Generate a kprobe event command to be executed by
   944	 * kprobe_event_gen_cmd_end().  This function can be used to generate the
   945	 * complete command or only the first part of it; in the latter case,
   946	 * kprobe_event_add_fields() can be used to add more fields following this.
   947	 *
   948	 * Return: 0 if successful, error otherwise.
   949	 */
   950	int __kprobe_event_gen_cmd_start(struct dynevent_cmd *cmd, bool kretprobe,
   951					 const char *name, const char *loc, ...)
 > 952	{
   953		char buf[MAX_EVENT_NAME_LEN];
   954		struct dynevent_arg arg;
   955		va_list args;
   956		int ret;
   957	
   958		if (cmd->type != DYNEVENT_TYPE_KPROBE)
   959			return -EINVAL;
   960	
   961		if (kretprobe)
   962			snprintf(buf, MAX_EVENT_NAME_LEN, "r:kprobes/%s", name);
   963		else
   964			snprintf(buf, MAX_EVENT_NAME_LEN, "p:kprobes/%s", name);
   965	
   966		ret = dynevent_str_add(cmd, buf);
   967		if (ret)
   968			return ret;
   969	
   970		dynevent_arg_init(&arg, NULL, 0);
   971		arg.str = loc;
   972		ret = dynevent_arg_add(cmd, &arg);
   973		if (ret)
   974			return ret;
   975	
   976		va_start(args, loc);
   977		for (;;) {
   978			const char *field;
   979	
   980			field = va_arg(args, const char *);
   981			if (!field)
   982				break;
   983	
   984			if (++cmd->n_fields > MAX_TRACE_ARGS) {
   985				ret = -EINVAL;
   986				break;
   987			}
   988	
   989			arg.str = field;
   990			ret = dynevent_arg_add(cmd, &arg);
   991			if (ret)
   992				break;
   993		}
   994		va_end(args);
   995	
   996		return ret;
   997	}
   998	EXPORT_SYMBOL_GPL(__kprobe_event_gen_cmd_start);
   999	
  1000	/**
  1001	 * __kprobe_event_add_fields - Add probe fields to a kprobe command from arg list
  1002	 * @cmd: A pointer to the dynevent_cmd struct representing the new event
  1003	 * @args: Variable number of arg (pairs), one pair for each field
  1004	 *
  1005	 * NOTE: Users normally won't want to call this function directly, but
  1006	 * rather use the kprobe_event_add_fields() wrapper, which
  1007	 * automatically adds a NULL to the end of the arg list.  If this
  1008	 * function is used directly, make sure the last arg in the variable
  1009	 * arg list is NULL.
  1010	 *
  1011	 * Add probe fields to an existing kprobe command using a variable
  1012	 * list of args.  Fields are added in the same order they're listed.
  1013	 *
  1014	 * Return: 0 if successful, error otherwise.
  1015	 */
  1016	int __kprobe_event_add_fields(struct dynevent_cmd *cmd, ...)
> 1017	{
  1018		struct dynevent_arg arg;
  1019		va_list args;
  1020		int ret;
  1021	
  1022		if (cmd->type != DYNEVENT_TYPE_KPROBE)
  1023			return -EINVAL;
  1024	
  1025		dynevent_arg_init(&arg, NULL, 0);
  1026	
  1027		va_start(args, cmd);
  1028		for (;;) {
  1029			const char *field;
  1030	
  1031			field = va_arg(args, const char *);
  1032			if (!field)
  1033				break;
  1034	
  1035			if (++cmd->n_fields > MAX_TRACE_ARGS) {
  1036				ret = -EINVAL;
  1037				break;
  1038			}
  1039	
  1040			arg.str = field;
  1041			ret = dynevent_arg_add(cmd, &arg);
  1042			if (ret)
  1043				break;
  1044		}
  1045		va_end(args);
  1046	
  1047		return ret;
  1048	}
  1049	EXPORT_SYMBOL_GPL(__kprobe_event_add_fields);
  1050	

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: kernel/trace/trace_kprobe.c:952: warning: Excess function parameter 'args' description in '__kprobe_event_gen_cmd_start'
  2023-10-18 20:33 kernel/trace/trace_kprobe.c:952: warning: Excess function parameter 'args' description in '__kprobe_event_gen_cmd_start' kernel test robot
@ 2023-10-19 13:22 ` Steven Rostedt
  2023-10-27  5:19   ` Yujie Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2023-10-19 13:22 UTC (permalink / raw)
  To: kernel test robot; +Cc: Tom Zanussi, oe-kbuild-all, linux-kernel

On Thu, 19 Oct 2023 04:33:41 +0800
kernel test robot <lkp@intel.com> wrote:

> All warnings (new ones prefixed by >>):
> 
> >> kernel/trace/trace_kprobe.c:952: warning: Excess function parameter 'args' description in '__kprobe_event_gen_cmd_start'
> >> kernel/trace/trace_kprobe.c:1017: warning: Excess function parameter 'args' description in '__kprobe_event_add_fields'  
> 
> 
> vim +952 kernel/trace/trace_kprobe.c
> 
>    929	
>    930	/**
>    931	 * __kprobe_event_gen_cmd_start - Generate a kprobe event command from arg list
>    932	 * @cmd: A pointer to the dynevent_cmd struct representing the new event
>    933	 * @name: The name of the kprobe event
>    934	 * @loc: The location of the kprobe event
>    935	 * @kretprobe: Is this a return probe?
>    936	 * @args: Variable number of arg (pairs), one pair for each field
>    937	 *
>    938	 * NOTE: Users normally won't want to call this function directly, but
>    939	 * rather use the kprobe_event_gen_cmd_start() wrapper, which automatically
>    940	 * adds a NULL to the end of the arg list.  If this function is used
>    941	 * directly, make sure the last arg in the variable arg list is NULL.
>    942	 *
>    943	 * Generate a kprobe event command to be executed by
>    944	 * kprobe_event_gen_cmd_end().  This function can be used to generate the
>    945	 * complete command or only the first part of it; in the latter case,
>    946	 * kprobe_event_add_fields() can be used to add more fields following this.
>    947	 *
>    948	 * Return: 0 if successful, error otherwise.
>    949	 */
>    950	int __kprobe_event_gen_cmd_start(struct dynevent_cmd *cmd, bool kretprobe,
>    951					 const char *name, const char *loc, ...)
>  > 952	{  

So what is the proper kerneldoc way to express variable length arguments?

-- Steve

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: kernel/trace/trace_kprobe.c:952: warning: Excess function parameter 'args' description in '__kprobe_event_gen_cmd_start'
  2023-10-19 13:22 ` Steven Rostedt
@ 2023-10-27  5:19   ` Yujie Liu
  2023-10-28 21:09     ` Steven Rostedt
  0 siblings, 1 reply; 4+ messages in thread
From: Yujie Liu @ 2023-10-27  5:19 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: kernel test robot, Tom Zanussi, oe-kbuild-all, linux-kernel

On Thu, Oct 19, 2023 at 09:22:07AM -0400, Steven Rostedt wrote:
> On Thu, 19 Oct 2023 04:33:41 +0800
> kernel test robot <lkp@intel.com> wrote:
> 
> > All warnings (new ones prefixed by >>):
> > 
> > >> kernel/trace/trace_kprobe.c:952: warning: Excess function parameter 'args' description in '__kprobe_event_gen_cmd_start'
> > >> kernel/trace/trace_kprobe.c:1017: warning: Excess function parameter 'args' description in '__kprobe_event_add_fields'  
> > 
> > 
> > vim +952 kernel/trace/trace_kprobe.c
> > 
> >    929	
> >    930	/**
> >    931	 * __kprobe_event_gen_cmd_start - Generate a kprobe event command from arg list
> >    932	 * @cmd: A pointer to the dynevent_cmd struct representing the new event
> >    933	 * @name: The name of the kprobe event
> >    934	 * @loc: The location of the kprobe event
> >    935	 * @kretprobe: Is this a return probe?
> >    936	 * @args: Variable number of arg (pairs), one pair for each field
> >    937	 *
> >    938	 * NOTE: Users normally won't want to call this function directly, but
> >    939	 * rather use the kprobe_event_gen_cmd_start() wrapper, which automatically
> >    940	 * adds a NULL to the end of the arg list.  If this function is used
> >    941	 * directly, make sure the last arg in the variable arg list is NULL.
> >    942	 *
> >    943	 * Generate a kprobe event command to be executed by
> >    944	 * kprobe_event_gen_cmd_end().  This function can be used to generate the
> >    945	 * complete command or only the first part of it; in the latter case,
> >    946	 * kprobe_event_add_fields() can be used to add more fields following this.
> >    947	 *
> >    948	 * Return: 0 if successful, error otherwise.
> >    949	 */
> >    950	int __kprobe_event_gen_cmd_start(struct dynevent_cmd *cmd, bool kretprobe,
> >    951					 const char *name, const char *loc, ...)
> >  > 952	{  
> 
> So what is the proper kerneldoc way to express variable length arguments?

Hi Steven, the fix patch is sent at [1] to fix this kernel-doc warning.

[1] https://lore.kernel.org/all/20231027041315.2613166-1-yujie.liu@intel.com/

Best Regards,
Yujie

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: kernel/trace/trace_kprobe.c:952: warning: Excess function parameter 'args' description in '__kprobe_event_gen_cmd_start'
  2023-10-27  5:19   ` Yujie Liu
@ 2023-10-28 21:09     ` Steven Rostedt
  0 siblings, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2023-10-28 21:09 UTC (permalink / raw)
  To: Yujie Liu; +Cc: kernel test robot, Tom Zanussi, oe-kbuild-all, linux-kernel

On Fri, 27 Oct 2023 13:19:21 +0800
Yujie Liu <yujie.liu@intel.com> wrote:
> 
> Hi Steven, the fix patch is sent at [1] to fix this kernel-doc warning.
> 
> [1] https://lore.kernel.org/all/20231027041315.2613166-1-yujie.liu@intel.com/
> 

Masami is now co-maintainer of the tracing subsystem and handles the
probes side of things. Looks like he's picking it up.

Thanks,

-- Steve


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-28 21:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-18 20:33 kernel/trace/trace_kprobe.c:952: warning: Excess function parameter 'args' description in '__kprobe_event_gen_cmd_start' kernel test robot
2023-10-19 13:22 ` Steven Rostedt
2023-10-27  5:19   ` Yujie Liu
2023-10-28 21:09     ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®