diff options
| author | Alexei Starovoitov <[email protected]> | 2019-11-14 18:57:09 +0000 |
|---|---|---|
| committer | Daniel Borkmann <[email protected]> | 2019-11-15 22:43:15 +0000 |
| commit | 11d1e2eefffe86339b3b0b773bd31ef3b88faf7d (patch) | |
| tree | c0879851d7812ff06cc4213f08f9b8176f54028c /tools/lib/bpf/bpf_helpers.h | |
| parent | bpf: Add kernel test functions for fentry testing (diff) | |
| download | kernel-11d1e2eefffe86339b3b0b773bd31ef3b88faf7d.tar.gz kernel-11d1e2eefffe86339b3b0b773bd31ef3b88faf7d.zip | |
selftests/bpf: Add test for BPF trampoline
Add sanity test for BPF trampoline that checks kernel functions
with up to 6 arguments of different sizes.
Signed-off-by: Alexei Starovoitov <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Acked-by: Song Liu <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/bpf_helpers.h')
| -rw-r--r-- | tools/lib/bpf/bpf_helpers.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/lib/bpf/bpf_helpers.h b/tools/lib/bpf/bpf_helpers.h index 0c7d28292898..c63ab1add126 100644 --- a/tools/lib/bpf/bpf_helpers.h +++ b/tools/lib/bpf/bpf_helpers.h @@ -44,4 +44,17 @@ enum libbpf_pin_type { LIBBPF_PIN_BY_NAME, }; +/* The following types should be used by BPF_PROG_TYPE_TRACING program to + * access kernel function arguments. BPF trampoline and raw tracepoints + * typecast arguments to 'unsigned long long'. + */ +typedef int __attribute__((aligned(8))) ks32; +typedef char __attribute__((aligned(8))) ks8; +typedef short __attribute__((aligned(8))) ks16; +typedef long long __attribute__((aligned(8))) ks64; +typedef unsigned int __attribute__((aligned(8))) ku32; +typedef unsigned char __attribute__((aligned(8))) ku8; +typedef unsigned short __attribute__((aligned(8))) ku16; +typedef unsigned long long __attribute__((aligned(8))) ku64; + #endif |
