kernel/trace/trace_osnoise.c:101:1: sparse: sparse: symbol '__pcpu_scope_per_cpu_osnoise_var' was not declared. Should it be static?

From: kernel test robot
Date: Tue Apr 26 2022 - 13:56:43 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: d615b5416f8a1afeb82d13b238f8152c572d59c0
commit: bce29ac9ce0bb0b0b146b687ab978378c21e9078 trace: Add osnoise tracer
date: 10 months ago
config: parisc-randconfig-s031-20220425 (https://download.01.org/0day-ci/archive/20220427/202204270146.IRxXM4hU-lkp@xxxxxxxxx/config)
compiler: hppa-linux-gcc (GCC) 11.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bce29ac9ce0bb0b0b146b687ab978378c21e9078
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout bce29ac9ce0bb0b0b146b687ab978378c21e9078
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=parisc SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)
>> kernel/trace/trace_osnoise.c:101:1: sparse: sparse: symbol '__pcpu_scope_per_cpu_osnoise_var' was not declared. Should it be static?
kernel/trace/trace_osnoise.c:160:14: sparse: sparse: symbol 'interface_lock' was not declared. Should it be static?
kernel/trace/trace_osnoise.c:438:6: sparse: sparse: symbol 'osnoise_trace_irq_entry' was not declared. Should it be static?
kernel/trace/trace_osnoise.c:461:6: sparse: sparse: symbol 'osnoise_trace_irq_exit' was not declared. Should it be static?
kernel/trace/trace_osnoise.c:520:5: sparse: sparse: symbol 'hook_irq_events' was not declared. Should it be static?
kernel/trace/trace_osnoise.c:552:6: sparse: sparse: symbol 'unhook_irq_events' was not declared. Should it be static?
kernel/trace/trace_osnoise.c:569:6: sparse: sparse: symbol 'trace_softirq_entry_callback' was not declared. Should it be static?
kernel/trace/trace_osnoise.c:592:6: sparse: sparse: symbol 'trace_softirq_exit_callback' was not declared. Should it be static?
kernel/trace/trace_osnoise.c:706:1: sparse: sparse: symbol 'trace_sched_switch_callback' was not declared. Should it be static?
kernel/trace/trace_osnoise.c:724:5: sparse: sparse: symbol 'hook_thread_events' was not declared. Should it be static?
kernel/trace/trace_osnoise.c:741:6: sparse: sparse: symbol 'unhook_thread_events' was not declared. Should it be static?
kernel/trace/trace_osnoise.c:753:6: sparse: sparse: symbol 'save_osn_sample_stats' was not declared. Should it be static?
kernel/trace/trace_osnoise.c:768:6: sparse: sparse: symbol 'diff_osn_sample_stats' was not declared. Should it be static?
kernel/trace/trace_osnoise.c:966:17: sparse: sparse: incompatible types in comparison expression (different signedness):
kernel/trace/trace_osnoise.c:966:17: sparse: signed long long *
kernel/trace/trace_osnoise.c:966:17: sparse: unsigned long long [usertype] *

vim +/__pcpu_scope_per_cpu_osnoise_var +101 kernel/trace/trace_osnoise.c

85
86 /*
87 * osnoise_register_instance - register a new trace instance
88 *
89 * Register a trace_array *tr in the list of instances running
90 * osnoise/timerlat tracers.
91 */
92 static int osnoise_register_instance(struct trace_array *tr)
93 {
94 struct osnoise_instance *inst;
95
96 /*
97 * register/unregister serialization is provided by trace's
98 * trace_types_lock.
99 */
100 lockdep_assert_held(&trace_types_lock);
> 101
102 inst = kmalloc(sizeof(*inst), GFP_KERNEL);
103 if (!inst)
104 return -ENOMEM;
105
106 INIT_LIST_HEAD_RCU(&inst->list);
107 inst->tr = tr;
108 list_add_tail_rcu(&inst->list, &osnoise_instances);
109
110 return 0;
111 }
112

--
0-DAY CI Kernel Test Service
https://01.org/lkp