Add bpf_testmod module, which is conceptually out-of-tree module and provides ways for selftests/bpf to test various kernel module-related functionality: raw tracepoint, fentry/fexit/fmod_ret, etc. This module will be auto-loaded by test_progs test runner and expected by some of selftests to be present and loaded. Pahole currently isn't able to generate BTF for static functions in kernel modules, so make sure traced function is global. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Martin KaFai Lau <kafai@fb.com> Link: https://lore.kernel.org/bpf/20201203204634.1325171-7-andrii@kernel.org
		
			
				
	
	
		
			21 lines
		
	
	
		
			364 B
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			364 B
		
	
	
	
		
			Makefile
		
	
	
	
	
	
| BPF_TESTMOD_DIR := $(realpath $(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
 | |
| KDIR ?= $(abspath $(BPF_TESTMOD_DIR)/../../../../..)
 | |
| 
 | |
| ifeq ($(V),1)
 | |
| Q =
 | |
| else
 | |
| Q = @
 | |
| endif
 | |
| 
 | |
| MODULES = bpf_testmod.ko
 | |
| 
 | |
| obj-m += bpf_testmod.o
 | |
| CFLAGS_bpf_testmod.o = -I$(src)
 | |
| 
 | |
| all:
 | |
| 	+$(Q)make -C $(KDIR) M=$(BPF_TESTMOD_DIR) modules
 | |
| 
 | |
| clean:
 | |
| 	+$(Q)make -C $(KDIR) M=$(BPF_TESTMOD_DIR) clean
 | |
| 
 |