diff options
| author | Andrii Nakryiko <[email protected]> | 2020-12-03 20:46:26 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2020-12-04 01:38:20 +0000 |
| commit | 9f7fa225894c7fcb014f3699a402fcc4d896cb1c (patch) | |
| tree | edf41331c46aa34ac41b9b1545b112575a112edc /tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h | |
| parent | libbpf: Add kernel module BTF support for CO-RE relocations (diff) | |
| download | kernel-9f7fa225894c7fcb014f3699a402fcc4d896cb1c.tar.gz kernel-9f7fa225894c7fcb014f3699a402fcc4d896cb1c.zip | |
selftests/bpf: Add bpf_testmod kernel module for testing
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 <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Acked-by: Martin KaFai Lau <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h')
| -rw-r--r-- | tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h new file mode 100644 index 000000000000..b81adfedb4f6 --- /dev/null +++ b/tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.h @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Copyright (c) 2020 Facebook */ +#ifndef _BPF_TESTMOD_H +#define _BPF_TESTMOD_H + +#include <linux/types.h> + +struct bpf_testmod_test_read_ctx { + char *buf; + loff_t off; + size_t len; +}; + +#endif /* _BPF_TESTMOD_H */ |
