tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 992b5fc139d3aa14b25613b06adee4bb9c110b28 commit: 00d0f1b149a5201c072e868915c76f909c11c38f [3208/21577] bpf: support raw tracepoints in modules :::::: branch date: 7 hours ago :::::: commit date: 4 years, 1 month ago config: x86_64-randconfig-123-20240125 (attached as .config) compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18) reproduce (this is a W=1 build): (attached as 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/202401262122.kgKexAjZ-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
kernel/trace/bpf_trace.c:1273:5: sparse: sparse: symbol 'bpf_event_notify' was not declared. Should it be static? kernel/trace/bpf_trace.c:1312:12: sparse: sparse: symbol 'bpf_event_init' was not declared. Should it be static?
kernel/trace/bpf_trace.c:173:14: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const volatile [noderef] __user *ptr @@ got void *unsafe_ptr @@ kernel/trace/bpf_trace.c:173:14: sparse: expected void const volatile [noderef] __user *ptr kernel/trace/bpf_trace.c:173:14: sparse: got void *unsafe_ptr kernel/trace/bpf_trace.c:1273:5: warning: no previous prototype for function 'bpf_event_notify' [-Wmissing-prototypes] 1273 | int bpf_event_notify(struct notifier_block *nb, unsigned long op, void *module) | ^ kernel/trace/bpf_trace.c:1273:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1273 | int bpf_event_notify(struct notifier_block *nb, unsigned long op, void *module) | ^ | static kernel/trace/bpf_trace.c:1312:12: warning: no previous prototype for function 'bpf_event_init' [-Wmissing-prototypes] 1312 | int __init bpf_event_init(void) | ^ kernel/trace/bpf_trace.c:1312:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1312 | int __init bpf_event_init(void) | ^ | static 2 warnings generated.
vim +/bpf_event_notify +1273 kernel/trace/bpf_trace.c
00d0f1b149a520 Matt Mullins 2019-02-19 1271 00d0f1b149a520 Matt Mullins 2019-02-19 1272 #ifdef CONFIG_MODULES 00d0f1b149a520 Matt Mullins 2019-02-19 @1273 int bpf_event_notify(struct notifier_block *nb, unsigned long op, void *module) 00d0f1b149a520 Matt Mullins 2019-02-19 1274 { 00d0f1b149a520 Matt Mullins 2019-02-19 1275 struct bpf_trace_module *btm, *tmp; 00d0f1b149a520 Matt Mullins 2019-02-19 1276 struct module *mod = module; 00d0f1b149a520 Matt Mullins 2019-02-19 1277 00d0f1b149a520 Matt Mullins 2019-02-19 1278 if (mod->num_bpf_raw_events == 0 || 00d0f1b149a520 Matt Mullins 2019-02-19 1279 (op != MODULE_STATE_COMING && op != MODULE_STATE_GOING)) 00d0f1b149a520 Matt Mullins 2019-02-19 1280 return 0; 00d0f1b149a520 Matt Mullins 2019-02-19 1281 00d0f1b149a520 Matt Mullins 2019-02-19 1282 mutex_lock(&bpf_module_mutex); 00d0f1b149a520 Matt Mullins 2019-02-19 1283 00d0f1b149a520 Matt Mullins 2019-02-19 1284 switch (op) { 00d0f1b149a520 Matt Mullins 2019-02-19 1285 case MODULE_STATE_COMING: 00d0f1b149a520 Matt Mullins 2019-02-19 1286 btm = kzalloc(sizeof(*btm), GFP_KERNEL); 00d0f1b149a520 Matt Mullins 2019-02-19 1287 if (btm) { 00d0f1b149a520 Matt Mullins 2019-02-19 1288 btm->module = module; 00d0f1b149a520 Matt Mullins 2019-02-19 1289 list_add(&btm->list, &bpf_trace_modules); 00d0f1b149a520 Matt Mullins 2019-02-19 1290 } 00d0f1b149a520 Matt Mullins 2019-02-19 1291 break; 00d0f1b149a520 Matt Mullins 2019-02-19 1292 case MODULE_STATE_GOING: 00d0f1b149a520 Matt Mullins 2019-02-19 1293 list_for_each_entry_safe(btm, tmp, &bpf_trace_modules, list) { 00d0f1b149a520 Matt Mullins 2019-02-19 1294 if (btm->module == module) { 00d0f1b149a520 Matt Mullins 2019-02-19 1295 list_del(&btm->list); 00d0f1b149a520 Matt Mullins 2019-02-19 1296 kfree(btm); 00d0f1b149a520 Matt Mullins 2019-02-19 1297 break; 00d0f1b149a520 Matt Mullins 2019-02-19 1298 } 00d0f1b149a520 Matt Mullins 2019-02-19 1299 } 00d0f1b149a520 Matt Mullins 2019-02-19 1300 break; 00d0f1b149a520 Matt Mullins 2019-02-19 1301 } 00d0f1b149a520 Matt Mullins 2019-02-19 1302 00d0f1b149a520 Matt Mullins 2019-02-19 1303 mutex_unlock(&bpf_module_mutex); 00d0f1b149a520 Matt Mullins 2019-02-19 1304 00d0f1b149a520 Matt Mullins 2019-02-19 1305 return 0; 00d0f1b149a520 Matt Mullins 2019-02-19 1306 } 00d0f1b149a520 Matt Mullins 2019-02-19 1307 00d0f1b149a520 Matt Mullins 2019-02-19 1308 static struct notifier_block bpf_module_nb = { 00d0f1b149a520 Matt Mullins 2019-02-19 1309 .notifier_call = bpf_event_notify, 00d0f1b149a520 Matt Mullins 2019-02-19 1310 }; 00d0f1b149a520 Matt Mullins 2019-02-19 1311 00d0f1b149a520 Matt Mullins 2019-02-19 @1312 int __init bpf_event_init(void) 00d0f1b149a520 Matt Mullins 2019-02-19 1313 { 00d0f1b149a520 Matt Mullins 2019-02-19 1314 register_module_notifier(&bpf_module_nb); 00d0f1b149a520 Matt Mullins 2019-02-19 1315 return 0; 00d0f1b149a520 Matt Mullins 2019-02-19 1316 } 00d0f1b149a520 Matt Mullins 2019-02-19 1317