From: Nathan Chancellor <nathan@kernel.org> To: Jeff Xie <xiehuan09@gmail.com> Cc: kernel test robot <lkp@intel.com>, Steven Rostedt <rostedt@goodmis.org>, llvm@lists.linux.dev, kbuild-all@lists.01.org, mingo@redhat.com, Masami Hiramatsu <mhiramat@kernel.org>, Tom Zanussi <zanussi@kernel.org>, linux-kernel@vger.kernel.org Subject: Re: [PATCH v11 1/4] trace: Add trace any kernel object Date: Fri, 3 Jun 2022 08:37:30 -0700 [thread overview] Message-ID: <YpoqulzEvwNDHFMH@dev-arch.thelio-3990X> (raw) In-Reply-To: <CAEr6+ED6oJV1BmAQy6T592GX751t9QB==0vWcXUDMw3WL0YWtA@mail.gmail.com> On Fri, Jun 03, 2022 at 09:48:07AM +0800, Jeff Xie wrote: > Hi lkp, > > On Fri, Jun 3, 2022 at 5:12 AM kernel test robot <lkp@intel.com> wrote: > > > > Hi Jeff, > > > > Thank you for the patch! Perhaps something to improve: > > > > [auto build test WARNING on b39181f7c6907dc66ff937b74758671fa6ba430c] > > > > url: https://github.com/intel-lab-lkp/linux/commits/Jeff-Xie/trace-Introduce-objtrace-trigger-to-trace-the-kernel-object/20220603-004723 > > base: b39181f7c6907dc66ff937b74758671fa6ba430c > > config: i386-randconfig-a013 (https://download.01.org/0day-ci/archive/20220603/202206030515.4lqqkb3W-lkp@intel.com/config) > > compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project b364c76683f8ef241025a9556300778c07b590c2) > > 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 > > # https://github.com/intel-lab-lkp/linux/commit/765253f020469f94856aedc5a3fe5444e1e8f4e8 > > git remote add linux-review https://github.com/intel-lab-lkp/linux > > git fetch --no-tags linux-review Jeff-Xie/trace-Introduce-objtrace-trigger-to-trace-the-kernel-object/20220603-004723 > > git checkout 765253f020469f94856aedc5a3fe5444e1e8f4e8 > > # save the config file > > mkdir build_dir && cp config build_dir/.config > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/gpu/drm/qxl/ kernel/trace/ > > > > If you fix the issue, kindly add following tag where applicable > > Reported-by: kernel test robot <lkp@intel.com> > > > > All warnings (new ones prefixed by >>): > > > > >> kernel/trace/trace_object.c:336:61: warning: format specifies type 'long' but the argument has type 'unsigned int' [-Wformat] > > pr_err("the size of the %s should be:%ld\n", field->name, sizeof(void *)); > > ~~~ ^~~~~~~~~~~~~~ > > %u > > I will double check it ,the sizeof(void *) on x86_64 is type ‘long > unsigned int’. Per Documentation/core-api/printk-formats.rst, sizeof returns size_t, which should use the %zu specifier. Cheers, Nathan > > include/linux/printk.h:489:33: note: expanded from macro 'pr_err' > > printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) > > ~~~ ^~~~~~~~~~~ > > include/linux/printk.h:446:60: note: expanded from macro 'printk' > > #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__) > > ~~~ ^~~~~~~~~~~ > > include/linux/printk.h:418:19: note: expanded from macro 'printk_index_wrap' > > _p_func(_fmt, ##__VA_ARGS__); \ > > ~~~~ ^~~~~~~~~~~ > > 1 warning generated. > > > > > > vim +336 kernel/trace/trace_object.c > > > > 297 > > 298 static int > > 299 event_object_trigger_parse(struct event_command *cmd_ops, > > 300 struct trace_event_file *file, > > 301 char *glob, char *cmd, char *param_and_filter) > > 302 { > > 303 struct event_trigger_data *trigger_data; > > 304 struct objtrace_trigger_data *obj_data; > > 305 struct ftrace_event_field *field; > > 306 char *objtrace_cmd, *arg; > > 307 char *param, *filter; > > 308 int ret; > > 309 bool remove; > > 310 > > 311 remove = event_trigger_check_remove(glob); > > 312 > > 313 /* > > 314 * separate the param and the filter: > > 315 * objtrace:add:OBJ[:COUNT] [if filter] > > 316 */ > > 317 ret = event_trigger_separate_filter(param_and_filter, ¶m, &filter, true); > > 318 if (ret) > > 319 return ret; > > 320 > > 321 objtrace_cmd = strsep(¶m, ":"); > > 322 if (!objtrace_cmd || strcmp(objtrace_cmd, OBJTRACE_CMD_ADD)) { > > 323 pr_err("error objtrace command\n"); > > 324 return -EINVAL; > > 325 } > > 326 > > 327 arg = strsep(¶m, ":"); > > 328 if (!arg) > > 329 return -EINVAL; > > 330 > > 331 field = trace_find_event_field(file->event_call, arg); > > 332 if (!field) > > 333 return -EINVAL; > > 334 > > 335 if (field->size != sizeof(void *)) { > > > 336 pr_err("the size of the %s should be:%ld\n", field->name, sizeof(void *)); > > 337 return -EINVAL; > > 338 } > > 339 > > 340 if (remove && !field_exist(file, cmd_ops, field->name)) > > 341 return -ENOENT; > > 342 > > 343 obj_data = kzalloc(sizeof(*obj_data), GFP_KERNEL); > > 344 if (!obj_data) > > 345 return -ENOMEM; > > 346 > > 347 obj_data->field = field; > > 348 obj_data->tr = file->tr; > > 349 snprintf(obj_data->objtrace_cmd, OBJTRACE_CMD_LEN, objtrace_cmd); > > 350 > > 351 trigger_data = event_trigger_alloc(cmd_ops, cmd, param, obj_data); > > 352 if (!trigger_data) { > > 353 kfree(obj_data); > > 354 return -ENOMEM; > > 355 } > > 356 if (remove) { > > 357 event_trigger_unregister(cmd_ops, file, glob+1, trigger_data); > > 358 kfree(obj_data); > > 359 kfree(trigger_data); > > 360 return 0; > > 361 } > > 362 > > 363 ret = event_trigger_parse_num(param, trigger_data); > > 364 if (ret) > > 365 goto out_free; > > 366 > > 367 ret = event_trigger_set_filter(cmd_ops, file, filter, trigger_data); > > 368 if (ret < 0) > > 369 goto out_free; > > 370 > > 371 ret = event_trigger_register(cmd_ops, file, glob, trigger_data); > > 372 if (ret) > > 373 goto out_free; > > 374 > > 375 return ret; > > 376 > > 377 out_free: > > 378 event_trigger_reset_filter(cmd_ops, trigger_data); > > 379 kfree(obj_data); > > 380 kfree(trigger_data); > > 381 return ret; > > 382 } > > 383 > > > > -- > > 0-DAY CI Kernel Test Service > > https://01.org/lkp > > Thanks, > JeffXie >
WARNING: multiple messages have this Message-ID (diff)
From: Nathan Chancellor <nathan@kernel.org> To: kbuild-all@lists.01.org Subject: Re: [PATCH v11 1/4] trace: Add trace any kernel object Date: Fri, 03 Jun 2022 08:37:30 -0700 [thread overview] Message-ID: <YpoqulzEvwNDHFMH@dev-arch.thelio-3990X> (raw) In-Reply-To: <CAEr6+ED6oJV1BmAQy6T592GX751t9QB==0vWcXUDMw3WL0YWtA@mail.gmail.com> [-- Attachment #1: Type: text/plain, Size: 6905 bytes --] On Fri, Jun 03, 2022 at 09:48:07AM +0800, Jeff Xie wrote: > Hi lkp, > > On Fri, Jun 3, 2022 at 5:12 AM kernel test robot <lkp@intel.com> wrote: > > > > Hi Jeff, > > > > Thank you for the patch! Perhaps something to improve: > > > > [auto build test WARNING on b39181f7c6907dc66ff937b74758671fa6ba430c] > > > > url: https://github.com/intel-lab-lkp/linux/commits/Jeff-Xie/trace-Introduce-objtrace-trigger-to-trace-the-kernel-object/20220603-004723 > > base: b39181f7c6907dc66ff937b74758671fa6ba430c > > config: i386-randconfig-a013 (https://download.01.org/0day-ci/archive/20220603/202206030515.4lqqkb3W-lkp(a)intel.com/config) > > compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project b364c76683f8ef241025a9556300778c07b590c2) > > 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 > > # https://github.com/intel-lab-lkp/linux/commit/765253f020469f94856aedc5a3fe5444e1e8f4e8 > > git remote add linux-review https://github.com/intel-lab-lkp/linux > > git fetch --no-tags linux-review Jeff-Xie/trace-Introduce-objtrace-trigger-to-trace-the-kernel-object/20220603-004723 > > git checkout 765253f020469f94856aedc5a3fe5444e1e8f4e8 > > # save the config file > > mkdir build_dir && cp config build_dir/.config > > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/gpu/drm/qxl/ kernel/trace/ > > > > If you fix the issue, kindly add following tag where applicable > > Reported-by: kernel test robot <lkp@intel.com> > > > > All warnings (new ones prefixed by >>): > > > > >> kernel/trace/trace_object.c:336:61: warning: format specifies type 'long' but the argument has type 'unsigned int' [-Wformat] > > pr_err("the size of the %s should be:%ld\n", field->name, sizeof(void *)); > > ~~~ ^~~~~~~~~~~~~~ > > %u > > I will double check it ,the sizeof(void *) on x86_64 is type ‘long > unsigned int’. Per Documentation/core-api/printk-formats.rst, sizeof returns size_t, which should use the %zu specifier. Cheers, Nathan > > include/linux/printk.h:489:33: note: expanded from macro 'pr_err' > > printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) > > ~~~ ^~~~~~~~~~~ > > include/linux/printk.h:446:60: note: expanded from macro 'printk' > > #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__) > > ~~~ ^~~~~~~~~~~ > > include/linux/printk.h:418:19: note: expanded from macro 'printk_index_wrap' > > _p_func(_fmt, ##__VA_ARGS__); \ > > ~~~~ ^~~~~~~~~~~ > > 1 warning generated. > > > > > > vim +336 kernel/trace/trace_object.c > > > > 297 > > 298 static int > > 299 event_object_trigger_parse(struct event_command *cmd_ops, > > 300 struct trace_event_file *file, > > 301 char *glob, char *cmd, char *param_and_filter) > > 302 { > > 303 struct event_trigger_data *trigger_data; > > 304 struct objtrace_trigger_data *obj_data; > > 305 struct ftrace_event_field *field; > > 306 char *objtrace_cmd, *arg; > > 307 char *param, *filter; > > 308 int ret; > > 309 bool remove; > > 310 > > 311 remove = event_trigger_check_remove(glob); > > 312 > > 313 /* > > 314 * separate the param and the filter: > > 315 * objtrace:add:OBJ[:COUNT] [if filter] > > 316 */ > > 317 ret = event_trigger_separate_filter(param_and_filter, ¶m, &filter, true); > > 318 if (ret) > > 319 return ret; > > 320 > > 321 objtrace_cmd = strsep(¶m, ":"); > > 322 if (!objtrace_cmd || strcmp(objtrace_cmd, OBJTRACE_CMD_ADD)) { > > 323 pr_err("error objtrace command\n"); > > 324 return -EINVAL; > > 325 } > > 326 > > 327 arg = strsep(¶m, ":"); > > 328 if (!arg) > > 329 return -EINVAL; > > 330 > > 331 field = trace_find_event_field(file->event_call, arg); > > 332 if (!field) > > 333 return -EINVAL; > > 334 > > 335 if (field->size != sizeof(void *)) { > > > 336 pr_err("the size of the %s should be:%ld\n", field->name, sizeof(void *)); > > 337 return -EINVAL; > > 338 } > > 339 > > 340 if (remove && !field_exist(file, cmd_ops, field->name)) > > 341 return -ENOENT; > > 342 > > 343 obj_data = kzalloc(sizeof(*obj_data), GFP_KERNEL); > > 344 if (!obj_data) > > 345 return -ENOMEM; > > 346 > > 347 obj_data->field = field; > > 348 obj_data->tr = file->tr; > > 349 snprintf(obj_data->objtrace_cmd, OBJTRACE_CMD_LEN, objtrace_cmd); > > 350 > > 351 trigger_data = event_trigger_alloc(cmd_ops, cmd, param, obj_data); > > 352 if (!trigger_data) { > > 353 kfree(obj_data); > > 354 return -ENOMEM; > > 355 } > > 356 if (remove) { > > 357 event_trigger_unregister(cmd_ops, file, glob+1, trigger_data); > > 358 kfree(obj_data); > > 359 kfree(trigger_data); > > 360 return 0; > > 361 } > > 362 > > 363 ret = event_trigger_parse_num(param, trigger_data); > > 364 if (ret) > > 365 goto out_free; > > 366 > > 367 ret = event_trigger_set_filter(cmd_ops, file, filter, trigger_data); > > 368 if (ret < 0) > > 369 goto out_free; > > 370 > > 371 ret = event_trigger_register(cmd_ops, file, glob, trigger_data); > > 372 if (ret) > > 373 goto out_free; > > 374 > > 375 return ret; > > 376 > > 377 out_free: > > 378 event_trigger_reset_filter(cmd_ops, trigger_data); > > 379 kfree(obj_data); > > 380 kfree(trigger_data); > > 381 return ret; > > 382 } > > 383 > > > > -- > > 0-DAY CI Kernel Test Service > > https://01.org/lkp > > Thanks, > JeffXie >
next prev parent reply other threads:[~2022-06-03 15:37 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-06-02 16:45 [PATCH v11 0/4] trace: Introduce objtrace trigger to trace the kernel object Jeff Xie 2022-06-02 16:45 ` [PATCH v11 1/4] trace: Add trace any " Jeff Xie 2022-06-02 21:12 ` kernel test robot 2022-06-03 1:48 ` Jeff Xie 2022-06-03 1:48 ` Jeff Xie 2022-06-03 15:37 ` Nathan Chancellor [this message] 2022-06-03 15:37 ` Nathan Chancellor 2022-06-04 2:19 ` Jeff Xie 2022-06-04 2:19 ` Jeff Xie 2022-06-02 22:05 ` kernel test robot 2022-06-02 16:45 ` [PATCH v11 2/4] trace/objtrace: Get the value of the object Jeff Xie 2022-06-02 16:45 ` [PATCH v11 3/4] trace/objtrace: Add testcases for objtrace Jeff Xie 2022-06-02 16:45 ` [PATCH v11 4/4] trace/objtrace: Add documentation " Jeff Xie
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=YpoqulzEvwNDHFMH@dev-arch.thelio-3990X \ --to=nathan@kernel.org \ --cc=kbuild-all@lists.01.org \ --cc=linux-kernel@vger.kernel.org \ --cc=lkp@intel.com \ --cc=llvm@lists.linux.dev \ --cc=mhiramat@kernel.org \ --cc=mingo@redhat.com \ --cc=rostedt@goodmis.org \ --cc=xiehuan09@gmail.com \ --cc=zanussi@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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.