Re: possible deadlock in trie_delete_elem

kernel test robot
2024-06-06T20:35:10Z

Hi syzbot,

kernel test robot noticed the following build errors:

[auto build test ERROR on bpf-next/master]
[also build test ERROR on bpf/master linus/master v6.10-rc2 next-20240606]
[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/syzbot/possible-deadlock-in-trie_delete_elem/20240606-230435
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link: https://lore.kernel.org/r/000000000000277099061a394d13%40google.com
patch subject: possible deadlock in trie_delete_elem
config: sh-defconfig (https://download.01.org/0day-ci/archive/20240607/202406070409.D0Nkzcbj-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240607/202406070409.D0Nkzcbj-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/202406070409.D0Nkzcbj-lkp@intel.com/

All errors (new ones prefixed by >>):

In file included from include/asm-generic/percpu.h:7,
from ./arch/sh/include/generated/asm/percpu.h:1,
from include/linux/irqflags.h:19,
from include/asm-generic/cmpxchg-local.h:6,
from arch/sh/include/asm/cmpxchg.h:74,
from arch/sh/include/asm/atomic.h:19,
from include/linux/atomic.h:7,
from include/asm-generic/bitops/lock.h:5,
from arch/sh/include/asm/bitops.h:63,
from include/linux/bitops.h:63,
from include/linux/log2.h:12,
from include/asm-generic/div64.h:55,
from ./arch/sh/include/generated/asm/div64.h:1,
from include/linux/math.h:6,
from include/linux/math64.h:6,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/module.h:13,
from kernel/tracepoint.c:5:
kernel/tracepoint.c: In function 'debug_print_probes':
>> kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/linux/percpu-defs.h:318:16: note: in definition of macro '__pcpu_size_call_return'
318 | typeof(variable) pscr_ret__; \
| ^~~~~~~~
kernel/tracepoint.c:178:30: note: in expansion of macro 'this_cpu_read'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~~~~~~~~~~~~
>> kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/linux/percpu-defs.h:219:54: note: in definition of macro '__verify_pcpu_ptr'
219 | const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \
| ^~~
include/linux/percpu-defs.h:489:41: note: in expansion of macro '__pcpu_size_call_return'
489 | #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp)
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/tracepoint.c:178:30: note: in expansion of macro 'this_cpu_read'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~~~~~~~~~~~~
>> kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/linux/percpu-defs.h:320:23: note: in definition of macro '__pcpu_size_call_return'
320 | switch(sizeof(variable)) { \
| ^~~~~~~~
kernel/tracepoint.c:178:30: note: in expansion of macro 'this_cpu_read'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~~~~~~~~~~~~
>> kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/asm-generic/percpu.h:144:16: note: in definition of macro 'this_cpu_generic_read'
144 | typeof(pcp) __ret; \
| ^~~
include/linux/percpu-defs.h:321:30: note: in expansion of macro 'this_cpu_read_1'
321 | case 1: pscr_ret__ = stem##1(variable); break; \
| ^~~~
include/linux/percpu-defs.h:489:41: note: in expansion of macro '__pcpu_size_call_return'
489 | #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp)
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/tracepoint.c:178:30: note: in expansion of macro 'this_cpu_read'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~~~~~~~~~~~~
In file included from <command-line>:
>> kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/linux/compiler_types.h:454:17: note: in definition of macro '__native_word'
454 | (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || \
| ^
include/asm-generic/percpu.h:375:41: note: in expansion of macro 'this_cpu_generic_read'
375 | #define this_cpu_read_1(pcp) this_cpu_generic_read(pcp)
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:321:30: note: in expansion of macro 'this_cpu_read_1'
321 | case 1: pscr_ret__ = stem##1(variable); break; \
| ^~~~
include/linux/percpu-defs.h:489:41: note: in expansion of macro '__pcpu_size_call_return'
489 | #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp)
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/tracepoint.c:178:30: note: in expansion of macro 'this_cpu_read'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~~~~~~~~~~~~
>> kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/linux/compiler_types.h:454:46: note: in definition of macro '__native_word'
454 | (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || \
| ^
include/asm-generic/percpu.h:375:41: note: in expansion of macro 'this_cpu_generic_read'
375 | #define this_cpu_read_1(pcp) this_cpu_generic_read(pcp)
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:321:30: note: in expansion of macro 'this_cpu_read_1'
321 | case 1: pscr_ret__ = stem##1(variable); break; \
| ^~~~
include/linux/percpu-defs.h:489:41: note: in expansion of macro '__pcpu_size_call_return'
489 | #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp)
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/tracepoint.c:178:30: note: in expansion of macro 'this_cpu_read'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~~~~~~~~~~~~
>> kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/linux/compiler_types.h:455:17: note: in definition of macro '__native_word'
455 | sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long))
| ^
include/asm-generic/percpu.h:375:41: note: in expansion of macro 'this_cpu_generic_read'
375 | #define this_cpu_read_1(pcp) this_cpu_generic_read(pcp)
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:321:30: note: in expansion of macro 'this_cpu_read_1'
321 | case 1: pscr_ret__ = stem##1(variable); break; \
| ^~~~
include/linux/percpu-defs.h:489:41: note: in expansion of macro '__pcpu_size_call_return'
489 | #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp)
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/tracepoint.c:178:30: note: in expansion of macro 'this_cpu_read'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~~~~~~~~~~~~
>> kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/linux/compiler_types.h:455:45: note: in definition of macro '__native_word'
455 | sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long))
| ^
include/asm-generic/percpu.h:375:41: note: in expansion of macro 'this_cpu_generic_read'
375 | #define this_cpu_read_1(pcp) this_cpu_generic_read(pcp)
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:321:30: note: in expansion of macro 'this_cpu_read_1'
321 | case 1: pscr_ret__ = stem##1(variable); break; \
| ^~~~
include/linux/percpu-defs.h:489:41: note: in expansion of macro '__pcpu_size_call_return'
489 | #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp)
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/tracepoint.c:178:30: note: in expansion of macro 'this_cpu_read'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~~~~~~~~~~~~
>> kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/asm-generic/percpu.h:125:16: note: in definition of macro '__this_cpu_generic_read_nopreempt'
125 | typeof(pcp) ___ret; \
| ^~~
include/asm-generic/percpu.h:375:41: note: in expansion of macro 'this_cpu_generic_read'
375 | #define this_cpu_read_1(pcp) this_cpu_generic_read(pcp)
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:321:30: note: in expansion of macro 'this_cpu_read_1'
321 | case 1: pscr_ret__ = stem##1(variable); break; \
| ^~~~
include/linux/percpu-defs.h:489:41: note: in expansion of macro '__pcpu_size_call_return'
489 | #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp)
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/tracepoint.c:178:30: note: in expansion of macro 'this_cpu_read'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~~~~~~~~~~~~
>> kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/linux/compiler_types.h:467:23: note: in definition of macro '__compiletime_assert'
467 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:487:9: note: in expansion of macro '_compiletime_assert'
487 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:18: note: in expansion of macro 'READ_ONCE'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~
include/linux/percpu-defs.h:241:9: note: in expansion of macro '__verify_pcpu_ptr'
241 | __verify_pcpu_ptr(ptr); \
| ^~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:29: note: in expansion of macro 'raw_cpu_ptr'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~~~
include/asm-generic/percpu.h:146:25: note: in expansion of macro '__this_cpu_generic_read_nopreempt'
146 | __ret = __this_cpu_generic_read_nopreempt(pcp); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:375:41: note: in expansion of macro 'this_cpu_generic_read'
375 | #define this_cpu_read_1(pcp) this_cpu_generic_read(pcp)
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:321:30: note: in expansion of macro 'this_cpu_read_1'
321 | case 1: pscr_ret__ = stem##1(variable); break; \
| ^~~~
include/linux/percpu-defs.h:489:41: note: in expansion of macro '__pcpu_size_call_return'
489 | #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp)
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/tracepoint.c:178:30: note: in expansion of macro 'this_cpu_read'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~~~~~~~~~~~~
>> kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/linux/compiler_types.h:467:23: note: in definition of macro '__compiletime_assert'
467 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:487:9: note: in expansion of macro '_compiletime_assert'
487 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:18: note: in expansion of macro 'READ_ONCE'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~
include/linux/percpu-defs.h:231:9: note: in expansion of macro 'RELOC_HIDE'
231 | RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset))
| ^~~~~~~~~~
include/asm-generic/percpu.h:44:31: note: in expansion of macro 'SHIFT_PERCPU_PTR'
44 | #define arch_raw_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, __my_cpu_offset)
| ^~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:242:9: note: in expansion of macro 'arch_raw_cpu_ptr'
242 | arch_raw_cpu_ptr(ptr); \
| ^~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:29: note: in expansion of macro 'raw_cpu_ptr'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~~~
include/asm-generic/percpu.h:146:25: note: in expansion of macro '__this_cpu_generic_read_nopreempt'
146 | __ret = __this_cpu_generic_read_nopreempt(pcp); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:375:41: note: in expansion of macro 'this_cpu_generic_read'
375 | #define this_cpu_read_1(pcp) this_cpu_generic_read(pcp)
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:321:30: note: in expansion of macro 'this_cpu_read_1'
321 | case 1: pscr_ret__ = stem##1(variable); break; \
| ^~~~
include/linux/percpu-defs.h:489:41: note: in expansion of macro '__pcpu_size_call_return'
489 | #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp)
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/tracepoint.c:178:30: note: in expansion of macro 'this_cpu_read'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~~~~~~~~~~~~
>> kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/linux/compiler_types.h:467:23: note: in definition of macro '__compiletime_assert'
467 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:487:9: note: in expansion of macro '_compiletime_assert'
487 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:18: note: in expansion of macro 'READ_ONCE'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~
include/linux/percpu-defs.h:231:9: note: in expansion of macro 'RELOC_HIDE'
231 | RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset))
| ^~~~~~~~~~
include/asm-generic/percpu.h:44:31: note: in expansion of macro 'SHIFT_PERCPU_PTR'
44 | #define arch_raw_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, __my_cpu_offset)
| ^~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:242:9: note: in expansion of macro 'arch_raw_cpu_ptr'
242 | arch_raw_cpu_ptr(ptr); \
| ^~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:29: note: in expansion of macro 'raw_cpu_ptr'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~~~
include/asm-generic/percpu.h:146:25: note: in expansion of macro '__this_cpu_generic_read_nopreempt'
146 | __ret = __this_cpu_generic_read_nopreempt(pcp); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:375:41: note: in expansion of macro 'this_cpu_generic_read'
375 | #define this_cpu_read_1(pcp) this_cpu_generic_read(pcp)
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:321:30: note: in expansion of macro 'this_cpu_read_1'
321 | case 1: pscr_ret__ = stem##1(variable); break; \
| ^~~~
include/linux/percpu-defs.h:489:41: note: in expansion of macro '__pcpu_size_call_return'
489 | #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp)
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/tracepoint.c:178:30: note: in expansion of macro 'this_cpu_read'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~~~~~~~~~~~~
>> kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/linux/compiler_types.h:467:23: note: in definition of macro '__compiletime_assert'
467 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:487:9: note: in expansion of macro '_compiletime_assert'
487 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:18: note: in expansion of macro 'READ_ONCE'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~
include/linux/percpu-defs.h:231:9: note: in expansion of macro 'RELOC_HIDE'
231 | RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset))
| ^~~~~~~~~~
include/asm-generic/percpu.h:44:31: note: in expansion of macro 'SHIFT_PERCPU_PTR'
44 | #define arch_raw_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, __my_cpu_offset)
| ^~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:242:9: note: in expansion of macro 'arch_raw_cpu_ptr'
242 | arch_raw_cpu_ptr(ptr); \
| ^~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:29: note: in expansion of macro 'raw_cpu_ptr'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~~~
include/asm-generic/percpu.h:146:25: note: in expansion of macro '__this_cpu_generic_read_nopreempt'
146 | __ret = __this_cpu_generic_read_nopreempt(pcp); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:375:41: note: in expansion of macro 'this_cpu_generic_read'
375 | #define this_cpu_read_1(pcp) this_cpu_generic_read(pcp)
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:321:30: note: in expansion of macro 'this_cpu_read_1'
321 | case 1: pscr_ret__ = stem##1(variable); break; \
| ^~~~
include/linux/percpu-defs.h:489:41: note: in expansion of macro '__pcpu_size_call_return'
489 | #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp)
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/tracepoint.c:178:30: note: in expansion of macro 'this_cpu_read'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~~~~~~~~~~~~
>> kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/linux/compiler_types.h:467:23: note: in definition of macro '__compiletime_assert'
467 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:487:9: note: in expansion of macro '_compiletime_assert'
487 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:18: note: in expansion of macro 'READ_ONCE'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~
include/linux/percpu-defs.h:231:9: note: in expansion of macro 'RELOC_HIDE'
231 | RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset))
| ^~~~~~~~~~
include/asm-generic/percpu.h:44:31: note: in expansion of macro 'SHIFT_PERCPU_PTR'
44 | #define arch_raw_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, __my_cpu_offset)
| ^~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:242:9: note: in expansion of macro 'arch_raw_cpu_ptr'
242 | arch_raw_cpu_ptr(ptr); \
| ^~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:29: note: in expansion of macro 'raw_cpu_ptr'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~~~
include/asm-generic/percpu.h:146:25: note: in expansion of macro '__this_cpu_generic_read_nopreempt'
146 | __ret = __this_cpu_generic_read_nopreempt(pcp); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:375:41: note: in expansion of macro 'this_cpu_generic_read'
375 | #define this_cpu_read_1(pcp) this_cpu_generic_read(pcp)
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:321:30: note: in expansion of macro 'this_cpu_read_1'
321 | case 1: pscr_ret__ = stem##1(variable); break; \
| ^~~~
include/linux/percpu-defs.h:489:41: note: in expansion of macro '__pcpu_size_call_return'
489 | #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp)
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/tracepoint.c:178:30: note: in expansion of macro 'this_cpu_read'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~~~~~~~~~~~~
>> kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/linux/compiler_types.h:467:23: note: in definition of macro '__compiletime_assert'
467 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:487:9: note: in expansion of macro '_compiletime_assert'
487 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:18: note: in expansion of macro 'READ_ONCE'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~
include/linux/percpu-defs.h:241:9: note: in expansion of macro '__verify_pcpu_ptr'
241 | __verify_pcpu_ptr(ptr); \
| ^~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:29: note: in expansion of macro 'raw_cpu_ptr'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~~~
include/asm-generic/percpu.h:146:25: note: in expansion of macro '__this_cpu_generic_read_nopreempt'
146 | __ret = __this_cpu_generic_read_nopreempt(pcp); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:375:41: note: in expansion of macro 'this_cpu_generic_read'
375 | #define this_cpu_read_1(pcp) this_cpu_generic_read(pcp)
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:321:30: note: in expansion of macro 'this_cpu_read_1'
321 | case 1: pscr_ret__ = stem##1(variable); break; \
| ^~~~
include/linux/percpu-defs.h:489:41: note: in expansion of macro '__pcpu_size_call_return'
489 | #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp)
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/tracepoint.c:178:30: note: in expansion of macro 'this_cpu_read'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~~~~~~~~~~~~
>> kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/linux/compiler_types.h:467:23: note: in definition of macro '__compiletime_assert'
467 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:487:9: note: in expansion of macro '_compiletime_assert'
487 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:18: note: in expansion of macro 'READ_ONCE'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~
include/linux/percpu-defs.h:231:9: note: in expansion of macro 'RELOC_HIDE'
231 | RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset))
| ^~~~~~~~~~
include/asm-generic/percpu.h:44:31: note: in expansion of macro 'SHIFT_PERCPU_PTR'
44 | #define arch_raw_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, __my_cpu_offset)
| ^~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:242:9: note: in expansion of macro 'arch_raw_cpu_ptr'
242 | arch_raw_cpu_ptr(ptr); \
| ^~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:29: note: in expansion of macro 'raw_cpu_ptr'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~~~
include/asm-generic/percpu.h:146:25: note: in expansion of macro '__this_cpu_generic_read_nopreempt'
146 | __ret = __this_cpu_generic_read_nopreempt(pcp); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:375:41: note: in expansion of macro 'this_cpu_generic_read'
375 | #define this_cpu_read_1(pcp) this_cpu_generic_read(pcp)
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:321:30: note: in expansion of macro 'this_cpu_read_1'
321 | case 1: pscr_ret__ = stem##1(variable); break; \
| ^~~~
include/linux/percpu-defs.h:489:41: note: in expansion of macro '__pcpu_size_call_return'
489 | #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp)
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/tracepoint.c:178:30: note: in expansion of macro 'this_cpu_read'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~~~~~~~~~~~~
>> kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/linux/compiler_types.h:467:23: note: in definition of macro '__compiletime_assert'
467 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:487:9: note: in expansion of macro '_compiletime_assert'
487 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:18: note: in expansion of macro 'READ_ONCE'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~
include/linux/percpu-defs.h:231:9: note: in expansion of macro 'RELOC_HIDE'
231 | RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset))
| ^~~~~~~~~~
include/asm-generic/percpu.h:44:31: note: in expansion of macro 'SHIFT_PERCPU_PTR'
44 | #define arch_raw_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, __my_cpu_offset)
| ^~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:242:9: note: in expansion of macro 'arch_raw_cpu_ptr'
242 | arch_raw_cpu_ptr(ptr); \
| ^~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:29: note: in expansion of macro 'raw_cpu_ptr'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~~~
include/asm-generic/percpu.h:146:25: note: in expansion of macro '__this_cpu_generic_read_nopreempt'
146 | __ret = __this_cpu_generic_read_nopreempt(pcp); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:375:41: note: in expansion of macro 'this_cpu_generic_read'
375 | #define this_cpu_read_1(pcp) this_cpu_generic_read(pcp)
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:321:30: note: in expansion of macro 'this_cpu_read_1'
321 | case 1: pscr_ret__ = stem##1(variable); break; \
| ^~~~
include/linux/percpu-defs.h:489:41: note: in expansion of macro '__pcpu_size_call_return'
489 | #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp)
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/tracepoint.c:178:30: note: in expansion of macro 'this_cpu_read'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~~~~~~~~~~~~
>> kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/linux/compiler_types.h:467:23: note: in definition of macro '__compiletime_assert'
467 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:487:9: note: in expansion of macro '_compiletime_assert'
487 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:18: note: in expansion of macro 'READ_ONCE'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~
include/linux/percpu-defs.h:231:9: note: in expansion of macro 'RELOC_HIDE'
231 | RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset))
| ^~~~~~~~~~
include/asm-generic/percpu.h:44:31: note: in expansion of macro 'SHIFT_PERCPU_PTR'
44 | #define arch_raw_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, __my_cpu_offset)
| ^~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:242:9: note: in expansion of macro 'arch_raw_cpu_ptr'
242 | arch_raw_cpu_ptr(ptr); \
| ^~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:29: note: in expansion of macro 'raw_cpu_ptr'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~~~
include/asm-generic/percpu.h:146:25: note: in expansion of macro '__this_cpu_generic_read_nopreempt'
146 | __ret = __this_cpu_generic_read_nopreempt(pcp); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:375:41: note: in expansion of macro 'this_cpu_generic_read'
375 | #define this_cpu_read_1(pcp) this_cpu_generic_read(pcp)
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:321:30: note: in expansion of macro 'this_cpu_read_1'
321 | case 1: pscr_ret__ = stem##1(variable); break; \
| ^~~~
include/linux/percpu-defs.h:489:41: note: in expansion of macro '__pcpu_size_call_return'
489 | #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp)
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/tracepoint.c:178:30: note: in expansion of macro 'this_cpu_read'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~~~~~~~~~~~~
>> kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/linux/compiler_types.h:467:23: note: in definition of macro '__compiletime_assert'
467 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:487:9: note: in expansion of macro '_compiletime_assert'
487 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:18: note: in expansion of macro 'READ_ONCE'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~
include/linux/percpu-defs.h:231:9: note: in expansion of macro 'RELOC_HIDE'
231 | RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset))
| ^~~~~~~~~~
include/asm-generic/percpu.h:44:31: note: in expansion of macro 'SHIFT_PERCPU_PTR'
44 | #define arch_raw_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, __my_cpu_offset)
| ^~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:242:9: note: in expansion of macro 'arch_raw_cpu_ptr'
242 | arch_raw_cpu_ptr(ptr); \
| ^~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:29: note: in expansion of macro 'raw_cpu_ptr'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~~~
include/asm-generic/percpu.h:146:25: note: in expansion of macro '__this_cpu_generic_read_nopreempt'
146 | __ret = __this_cpu_generic_read_nopreempt(pcp); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:375:41: note: in expansion of macro 'this_cpu_generic_read'
375 | #define this_cpu_read_1(pcp) this_cpu_generic_read(pcp)
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:321:30: note: in expansion of macro 'this_cpu_read_1'
321 | case 1: pscr_ret__ = stem##1(variable); break; \
| ^~~~
include/linux/percpu-defs.h:489:41: note: in expansion of macro '__pcpu_size_call_return'
489 | #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp)
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/tracepoint.c:178:30: note: in expansion of macro 'this_cpu_read'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~~~~~~~~~~~~
>> kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/linux/compiler_types.h:467:23: note: in definition of macro '__compiletime_assert'
467 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:487:9: note: in expansion of macro '_compiletime_assert'
487 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:18: note: in expansion of macro 'READ_ONCE'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~
include/linux/percpu-defs.h:241:9: note: in expansion of macro '__verify_pcpu_ptr'
241 | __verify_pcpu_ptr(ptr); \
| ^~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:29: note: in expansion of macro 'raw_cpu_ptr'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~~~
include/asm-generic/percpu.h:146:25: note: in expansion of macro '__this_cpu_generic_read_nopreempt'
146 | __ret = __this_cpu_generic_read_nopreempt(pcp); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:375:41: note: in expansion of macro 'this_cpu_generic_read'
375 | #define this_cpu_read_1(pcp) this_cpu_generic_read(pcp)
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:321:30: note: in expansion of macro 'this_cpu_read_1'
321 | case 1: pscr_ret__ = stem##1(variable); break; \
| ^~~~
include/linux/percpu-defs.h:489:41: note: in expansion of macro '__pcpu_size_call_return'
489 | #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp)
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/tracepoint.c:178:30: note: in expansion of macro 'this_cpu_read'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~~~~~~~~~~~~
kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/linux/compiler_types.h:467:23: note: in definition of macro '__compiletime_assert'
467 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:487:9: note: in expansion of macro '_compiletime_assert'
487 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:28: note: in expansion of macro '__native_word'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \
| ^~~~~~~~~~~~~
include/asm-generic/rwonce.h:49:9: note: in expansion of macro 'compiletime_assert_rwonce_type'
49 | compiletime_assert_rwonce_type(x); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:18: note: in expansion of macro 'READ_ONCE'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~
include/linux/percpu-defs.h:231:9: note: in expansion of macro 'RELOC_HIDE'
231 | RELOC_HIDE((typeof(*(__p)) __kernel __force *)(__p), (__offset))
| ^~~~~~~~~~
include/asm-generic/percpu.h:44:31: note: in expansion of macro 'SHIFT_PERCPU_PTR'
44 | #define arch_raw_cpu_ptr(ptr) SHIFT_PERCPU_PTR(ptr, __my_cpu_offset)
| ^~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:242:9: note: in expansion of macro 'arch_raw_cpu_ptr'
242 | arch_raw_cpu_ptr(ptr); \
| ^~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:127:29: note: in expansion of macro 'raw_cpu_ptr'
127 | ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
| ^~~~~~~~~~~
include/asm-generic/percpu.h:146:25: note: in expansion of macro '__this_cpu_generic_read_nopreempt'
146 | __ret = __this_cpu_generic_read_nopreempt(pcp); \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/percpu.h:375:41: note: in expansion of macro 'this_cpu_generic_read'
375 | #define this_cpu_read_1(pcp) this_cpu_generic_read(pcp)
| ^~~~~~~~~~~~~~~~~~~~~
include/linux/percpu-defs.h:321:30: note: in expansion of macro 'this_cpu_read_1'
321 | case 1: pscr_ret__ = stem##1(variable); break; \
| ^~~~
include/linux/percpu-defs.h:489:41: note: in expansion of macro '__pcpu_size_call_return'
489 | #define this_cpu_read(pcp) __pcpu_size_call_return(this_cpu_read_, pcp)
| ^~~~~~~~~~~~~~~~~~~~~~~
kernel/tracepoint.c:178:30: note: in expansion of macro 'this_cpu_read'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~~~~~~~~~~~~
kernel/tracepoint.c:178:50: error: invalid use of undefined type 'struct bpf_raw_tp_link'
178 | int active = this_cpu_read(*(link->link.prog->active));
| ^~
include/linux/compiler_types.h:467:23: note: in definition of macro '__compiletime_assert'
467 | if (!(condition)) \
| ^~~~~~~~~
include/linux/compiler_types.h:487:9: note: in expansion of macro '_compiletime_assert'
487 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
include/asm-generic/rwonce.h:36:9: note: in expansion of macro 'compiletime_assert'
36 | compiletime_assert(__native_word(t) || sizeof(t) == sizeof(long long), \

vim +178 kernel/tracepoint.c

> 5 #include <linux/module.h>
6 #include <linux/mutex.h>
7 #include <linux/types.h>
8 #include <linux/jhash.h>
9 #include <linux/list.h>
10 #include <linux/rcupdate.h>
11 #include <linux/tracepoint.h>
12 #include <linux/err.h>
13 #include <linux/slab.h>
14 #include <linux/sched/signal.h>
15 #include <linux/sched/task.h>
16 #include <linux/static_key.h>
17
18 enum tp_func_state {
19 TP_FUNC_0,
20 TP_FUNC_1,
21 TP_FUNC_2,
22 TP_FUNC_N,
23 };
24
25 extern tracepoint_ptr_t __start___tracepoints_ptrs[];
26 extern tracepoint_ptr_t __stop___tracepoints_ptrs[];
27
28 DEFINE_SRCU(tracepoint_srcu);
29 EXPORT_SYMBOL_GPL(tracepoint_srcu);
30
31 enum tp_transition_sync {
32 TP_TRANSITION_SYNC_1_0_1,
33 TP_TRANSITION_SYNC_N_2_1,
34
35 _NR_TP_TRANSITION_SYNC,
36 };
37
38 struct tp_transition_snapshot {
39 unsigned long rcu;
40 unsigned long srcu;
41 bool ongoing;
42 };
43
44 /* Protected by tracepoints_mutex */
45 static struct tp_transition_snapshot tp_transition_snapshot[_NR_TP_TRANSITION_SYNC];
46
47 static void tp_rcu_get_state(enum tp_transition_sync sync)
48 {
49 struct tp_transition_snapshot *snapshot = &tp_transition_snapshot[sync];
50
51 /* Keep the latest get_state snapshot. */
52 snapshot->rcu = get_state_synchronize_rcu();
53 snapshot->srcu = start_poll_synchronize_srcu(&tracepoint_srcu);
54 snapshot->ongoing = true;
55 }
56
57 static void tp_rcu_cond_sync(enum tp_transition_sync sync)
58 {
59 struct tp_transition_snapshot *snapshot = &tp_transition_snapshot[sync];
60
61 if (!snapshot->ongoing)
62 return;
63 cond_synchronize_rcu(snapshot->rcu);
64 if (!poll_state_synchronize_srcu(&tracepoint_srcu, snapshot->srcu))
65 synchronize_srcu(&tracepoint_srcu);
66 snapshot->ongoing = false;
67 }
68
69 /* Set to 1 to enable tracepoint debug output */
70 static const int tracepoint_debug;
71
72 #ifdef CONFIG_MODULES
73 /*
74 * Tracepoint module list mutex protects the local module list.
75 */
76 static DEFINE_MUTEX(tracepoint_module_list_mutex);
77
78 /* Local list of struct tp_module */
79 static LIST_HEAD(tracepoint_module_list);
80 #endif /* CONFIG_MODULES */
81
82 /*
83 * tracepoints_mutex protects the builtin and module tracepoints.
84 * tracepoints_mutex nests inside tracepoint_module_list_mutex.
85 */
86 static DEFINE_MUTEX(tracepoints_mutex);
87
88 static struct rcu_head *early_probes;
89 static bool ok_to_free_tracepoints;
90
91 /*
92 * Note about RCU :
93 * It is used to delay the free of multiple probes array until a quiescent
94 * state is reached.
95 */
96 struct tp_probes {
97 struct rcu_head rcu;
98 struct tracepoint_func probes[];
99 };
100
101 /* Called in removal of a func but failed to allocate a new tp_funcs */
102 static void tp_stub_func(void)
103 {
104 return;
105 }
106
107 static inline void *allocate_probes(int count)
108 {
109 struct tp_probes *p = kmalloc(struct_size(p, probes, count),
110 GFP_KERNEL);
111 return p == NULL ? NULL : p->probes;
112 }
113
114 static void srcu_free_old_probes(struct rcu_head *head)
115 {
116 kfree(container_of(head, struct tp_probes, rcu));
117 }
118
119 static void rcu_free_old_probes(struct rcu_head *head)
120 {
121 call_srcu(&tracepoint_srcu, head, srcu_free_old_probes);
122 }
123
124 static __init int release_early_probes(void)
125 {
126 struct rcu_head *tmp;
127
128 ok_to_free_tracepoints = true;
129
130 while (early_probes) {
131 tmp = early_probes;
132 early_probes = tmp->next;
133 call_rcu(tmp, rcu_free_old_probes);
134 }
135
136 return 0;
137 }
138
139 /* SRCU is initialized at core_initcall */
140 postcore_initcall(release_early_probes);
141
142 static inline void release_probes(struct tracepoint_func *old)
143 {
144 if (old) {
145 struct tp_probes *tp_probes = container_of(old,
146 struct tp_probes, probes[0]);
147
148 /*
149 * We can't free probes if SRCU is not initialized yet.
150 * Postpone the freeing till after SRCU is initialized.
151 */
152 if (unlikely(!ok_to_free_tracepoints)) {
153 tp_probes->rcu.next = early_probes;
154 early_probes = &tp_probes->rcu;
155 return;
156 }
157
158 /*
159 * Tracepoint probes are protected by both sched RCU and SRCU,
160 * by calling the SRCU callback in the sched RCU callback we
161 * cover both cases. So let us chain the SRCU and sched RCU
162 * callbacks to wait for both grace periods.
163 */
164 call_rcu(&tp_probes->rcu, rcu_free_old_probes);
165 }
166 }
167
168 static void debug_print_probes(struct tracepoint_func *funcs)
169 {
170 int i;
171 struct bpf_raw_tp_link *link;
172
173 if (!tracepoint_debug || !funcs)
174 return;
175
176 for (i = 0; funcs[i].func; i++) {
177 link = funcs[i].data;
> 178 int active = this_cpu_read(*(link->link.prog->active));
179 printk("Probe %d : %p / %p: %s/%d / %i\n", i,
180 funcs[i].func,
181 link,
182 link->link.prog->aux->name,
183 active,
184 funcs[i].prio);
185 }
186 }
187

--
0-DAY CI Kernel Test Service