Re: [PATCH] trace_branch: use per-cpu counters for correct/incorrect stats
From: kernel test robot
Date: Thu Aug 06 2026 - 15:44:44 EST
Hi Martin,
kernel test robot noticed the following build warnings:
[auto build test WARNING on trace/for-next]
[also build test WARNING on linus/master v7.2-rc6 next-20260806]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Martin-Weiss/trace_branch-use-per-cpu-counters-for-correct-incorrect-stats/20260806-093445
base: https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace for-next
patch link: https://lore.kernel.org/r/20260629095838.601926-1-Martin.weiss2410%40gmail.com
patch subject: [PATCH] trace_branch: use per-cpu counters for correct/incorrect stats
config: um-randconfig-r123-20260806 (https://download.01.org/0day-ci/archive/20260807/202608070304.QNhu3z0S-lkp@xxxxxxxxx/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260807/202608070304.QNhu3z0S-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202608070304.QNhu3z0S-lkp@xxxxxxxxx/
sparse warnings: (new ones prefixed by >>)
>> kernel/trace/trace_branch.c:218:17: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got unsigned long * @@
kernel/trace/trace_branch.c:218:17: sparse: expected void const [noderef] __percpu *__vpp_verify
kernel/trace/trace_branch.c:218:17: sparse: got unsigned long *
>> kernel/trace/trace_branch.c:218:17: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got unsigned long * @@
kernel/trace/trace_branch.c:218:17: sparse: expected void const [noderef] __percpu *__vpp_verify
kernel/trace/trace_branch.c:218:17: sparse: got unsigned long *
>> kernel/trace/trace_branch.c:218:17: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got unsigned long * @@
kernel/trace/trace_branch.c:218:17: sparse: expected void const [noderef] __percpu *__vpp_verify
kernel/trace/trace_branch.c:218:17: sparse: got unsigned long *
>> kernel/trace/trace_branch.c:218:17: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got unsigned long * @@
kernel/trace/trace_branch.c:218:17: sparse: expected void const [noderef] __percpu *__vpp_verify
kernel/trace/trace_branch.c:218:17: sparse: got unsigned long *
>> kernel/trace/trace_branch.c:218:17: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got unsigned long * @@
kernel/trace/trace_branch.c:218:17: sparse: expected void const [noderef] __percpu *__vpp_verify
kernel/trace/trace_branch.c:218:17: sparse: got unsigned long *
kernel/trace/trace_branch.c:220:17: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got unsigned long * @@
kernel/trace/trace_branch.c:220:17: sparse: expected void const [noderef] __percpu *__vpp_verify
kernel/trace/trace_branch.c:220:17: sparse: got unsigned long *
kernel/trace/trace_branch.c:220:17: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got unsigned long * @@
kernel/trace/trace_branch.c:220:17: sparse: expected void const [noderef] __percpu *__vpp_verify
kernel/trace/trace_branch.c:220:17: sparse: got unsigned long *
kernel/trace/trace_branch.c:220:17: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got unsigned long * @@
kernel/trace/trace_branch.c:220:17: sparse: expected void const [noderef] __percpu *__vpp_verify
kernel/trace/trace_branch.c:220:17: sparse: got unsigned long *
kernel/trace/trace_branch.c:220:17: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got unsigned long * @@
kernel/trace/trace_branch.c:220:17: sparse: expected void const [noderef] __percpu *__vpp_verify
kernel/trace/trace_branch.c:220:17: sparse: got unsigned long *
kernel/trace/trace_branch.c:220:17: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got unsigned long * @@
kernel/trace/trace_branch.c:220:17: sparse: expected void const [noderef] __percpu *__vpp_verify
kernel/trace/trace_branch.c:220:17: sparse: got unsigned long *
vim +218 kernel/trace/trace_branch.c
197
198 void ftrace_likely_update(struct ftrace_likely_data *f, int val,
199 int expect, int is_constant)
200 {
201 unsigned long flags = user_access_save();
202
203 /* A constant is always correct */
204 if (is_constant) {
205 f->constant++;
206 val = expect;
207 }
208 /*
209 * I would love to have a trace point here instead, but the
210 * trace point code is so inundated with unlikely and likely
211 * conditions that the recursive nightmare that exists is too
212 * much to try to get working. At least for now.
213 */
214 trace_likely_condition(f, val, expect);
215
216 /* use per-cpu counters to avoid contention */
217 if (val == expect)
> 218 this_cpu_inc(f->data.correct);
219 else
220 this_cpu_inc(f->data.incorrect);
221
222 user_access_restore(flags);
223 }
224 EXPORT_SYMBOL(ftrace_likely_update);
225
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki