* [trace:probes/core 21/21] kernel/trace/trace_probe.c:361:14: warning: variable 'is_ptr' set but not used
@ 2026-07-13 21:59 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-07-13 21:59 UTC (permalink / raw)
To: Masami Hiramatsu; +Cc: oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace probes/core
head: 744d07442f343166a6eaee73361b039fa9ec5b7f
commit: 744d07442f343166a6eaee73361b039fa9ec5b7f [21/21] tracing/probes: Eliminate recursion in parse_probe_arg()
config: i386-randconfig-141-20260714 (https://download.01.org/0day-ci/archive/20260714/202607140501.lOrT6KpG-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
smatch: v0.5.0-9185-gbcc58b9c
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260714/202607140501.lOrT6KpG-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/202607140501.lOrT6KpG-lkp@intel.com/
All warnings (new ones prefixed by >>):
kernel/trace/trace_probe.c: In function 'parse_this_cpu':
>> kernel/trace/trace_probe.c:361:14: warning: variable 'is_ptr' set but not used [-Wunused-but-set-variable]
361 | bool is_ptr = false;
| ^~~~~~
vim +/is_ptr +361 kernel/trace/trace_probe.c
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 353)
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 354) static int
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 355) parse_probe_arg(char *arg, const struct fetch_type *type,
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 356) struct fetch_insn **pcode, struct fetch_insn *end,
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 357) struct traceprobe_parse_context *ctx);
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 358)
744d07442f3431 Masami Hiramatsu 2026-07-13 359 static int parse_this_cpu(char *arg, struct traceprobe_parse_context *ctx)
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 360) {
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 @361) bool is_ptr = false;
744d07442f3431 Masami Hiramatsu 2026-07-13 362 bool is_read = false;
744d07442f3431 Masami Hiramatsu 2026-07-13 363 char *tmp;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 364)
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 365) /*
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 366) * This is only for kernel probes, excluding eprobe, because per-cpu
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 367) * pointer should not be recorded by events.
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 368) */
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 369) if (!(ctx->flags & TPARG_FL_KERNEL) ||
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 370) (ctx->flags & TPARG_FL_TEVENT)) {
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 371) trace_probe_log_err(ctx->offset, NOSUP_PERCPU);
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 372) return -EINVAL;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 373) }
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 374) if (str_has_prefix(arg, THIS_CPU_PTR_PREFIX)) {
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 375) arg += THIS_CPU_PTR_LEN;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 376) ctx->offset += THIS_CPU_PTR_LEN;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 377) is_ptr = true;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 378) } else if (str_has_prefix(arg, THIS_CPU_READ_PREFIX)) {
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 379) arg += THIS_CPU_READ_LEN;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 380) ctx->offset += THIS_CPU_READ_LEN;
744d07442f3431 Masami Hiramatsu 2026-07-13 381 is_read = true;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 382) } else
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 383) return -EINVAL;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 384)
744d07442f3431 Masami Hiramatsu 2026-07-13 385 tmp = strrchr(arg, ')');
744d07442f3431 Masami Hiramatsu 2026-07-13 386 if (!tmp) {
744d07442f3431 Masami Hiramatsu 2026-07-13 387 trace_probe_log_err(ctx->offset + strlen(arg),
744d07442f3431 Masami Hiramatsu 2026-07-13 388 DEREF_OPEN_BRACE);
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 389) return -EINVAL;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 390) }
744d07442f3431 Masami Hiramatsu 2026-07-13 391 *tmp = '\0';
744d07442f3431 Masami Hiramatsu 2026-07-13 392
744d07442f3431 Masami Hiramatsu 2026-07-13 393 ctx->stack[ctx->depth].type = STATE_DEREF;
744d07442f3431 Masami Hiramatsu 2026-07-13 394 ctx->stack[ctx->depth].deref.deref = FETCH_OP_CPU_PTR;
744d07442f3431 Masami Hiramatsu 2026-07-13 395 ctx->stack[ctx->depth].deref.offset = 0;
744d07442f3431 Masami Hiramatsu 2026-07-13 396 ctx->stack[ctx->depth].deref.cur_offs = ctx->offset;
744d07442f3431 Masami Hiramatsu 2026-07-13 397 ctx->stack[ctx->depth].deref.inner_arg = arg;
744d07442f3431 Masami Hiramatsu 2026-07-13 398 ctx->stack[ctx->depth].deref.is_cpu_read = is_read;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 399) return 0;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 400) }
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 401)
:::::: The code at line 361 was first introduced by commit
:::::: 2c84fb76749e66bfd95259930c8ed7bc29633aca tracing/probes: Add this_cpu_read() and this_cpu_ptr() dereference method to fetcharg
:::::: TO: Masami Hiramatsu (Google) <mhiramat@kernel.org>
:::::: CC: Masami Hiramatsu (Google) <mhiramat@kernel.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
* [trace:probes/core 21/21] kernel/trace/trace_probe.c:361:14: warning: variable 'is_ptr' set but not used
@ 2026-07-13 22:32 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-07-13 22:32 UTC (permalink / raw)
To: Masami Hiramatsu; +Cc: oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace probes/core
head: 744d07442f343166a6eaee73361b039fa9ec5b7f
commit: 744d07442f343166a6eaee73361b039fa9ec5b7f [21/21] tracing/probes: Eliminate recursion in parse_probe_arg()
config: x86_64-rhel-9.4-ltp (https://download.01.org/0day-ci/archive/20260714/202607140039.FAsx49CS-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260714/202607140039.FAsx49CS-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/202607140039.FAsx49CS-lkp@intel.com/
All warnings (new ones prefixed by >>):
kernel/trace/trace_probe.c: In function 'parse_this_cpu':
>> kernel/trace/trace_probe.c:361:14: warning: variable 'is_ptr' set but not used [-Wunused-but-set-variable]
361 | bool is_ptr = false;
| ^~~~~~
vim +/is_ptr +361 kernel/trace/trace_probe.c
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 353)
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 354) static int
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 355) parse_probe_arg(char *arg, const struct fetch_type *type,
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 356) struct fetch_insn **pcode, struct fetch_insn *end,
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 357) struct traceprobe_parse_context *ctx);
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 358)
744d07442f3431 Masami Hiramatsu 2026-07-13 359 static int parse_this_cpu(char *arg, struct traceprobe_parse_context *ctx)
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 360) {
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 @361) bool is_ptr = false;
744d07442f3431 Masami Hiramatsu 2026-07-13 362 bool is_read = false;
744d07442f3431 Masami Hiramatsu 2026-07-13 363 char *tmp;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 364)
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 365) /*
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 366) * This is only for kernel probes, excluding eprobe, because per-cpu
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 367) * pointer should not be recorded by events.
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 368) */
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 369) if (!(ctx->flags & TPARG_FL_KERNEL) ||
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 370) (ctx->flags & TPARG_FL_TEVENT)) {
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 371) trace_probe_log_err(ctx->offset, NOSUP_PERCPU);
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 372) return -EINVAL;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 373) }
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 374) if (str_has_prefix(arg, THIS_CPU_PTR_PREFIX)) {
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 375) arg += THIS_CPU_PTR_LEN;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 376) ctx->offset += THIS_CPU_PTR_LEN;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 377) is_ptr = true;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 378) } else if (str_has_prefix(arg, THIS_CPU_READ_PREFIX)) {
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 379) arg += THIS_CPU_READ_LEN;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 380) ctx->offset += THIS_CPU_READ_LEN;
744d07442f3431 Masami Hiramatsu 2026-07-13 381 is_read = true;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 382) } else
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 383) return -EINVAL;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 384)
744d07442f3431 Masami Hiramatsu 2026-07-13 385 tmp = strrchr(arg, ')');
744d07442f3431 Masami Hiramatsu 2026-07-13 386 if (!tmp) {
744d07442f3431 Masami Hiramatsu 2026-07-13 387 trace_probe_log_err(ctx->offset + strlen(arg),
744d07442f3431 Masami Hiramatsu 2026-07-13 388 DEREF_OPEN_BRACE);
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 389) return -EINVAL;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 390) }
744d07442f3431 Masami Hiramatsu 2026-07-13 391 *tmp = '\0';
744d07442f3431 Masami Hiramatsu 2026-07-13 392
744d07442f3431 Masami Hiramatsu 2026-07-13 393 ctx->stack[ctx->depth].type = STATE_DEREF;
744d07442f3431 Masami Hiramatsu 2026-07-13 394 ctx->stack[ctx->depth].deref.deref = FETCH_OP_CPU_PTR;
744d07442f3431 Masami Hiramatsu 2026-07-13 395 ctx->stack[ctx->depth].deref.offset = 0;
744d07442f3431 Masami Hiramatsu 2026-07-13 396 ctx->stack[ctx->depth].deref.cur_offs = ctx->offset;
744d07442f3431 Masami Hiramatsu 2026-07-13 397 ctx->stack[ctx->depth].deref.inner_arg = arg;
744d07442f3431 Masami Hiramatsu 2026-07-13 398 ctx->stack[ctx->depth].deref.is_cpu_read = is_read;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 399) return 0;
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 400) }
2c84fb76749e66 Masami Hiramatsu (Google 2026-07-02 401)
:::::: The code at line 361 was first introduced by commit
:::::: 2c84fb76749e66bfd95259930c8ed7bc29633aca tracing/probes: Add this_cpu_read() and this_cpu_ptr() dereference method to fetcharg
:::::: TO: Masami Hiramatsu (Google) <mhiramat@kernel.org>
:::::: CC: Masami Hiramatsu (Google) <mhiramat@kernel.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-13 22:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-13 22:32 [trace:probes/core 21/21] kernel/trace/trace_probe.c:361:14: warning: variable 'is_ptr' set but not used kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2026-07-13 21:59 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.