mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 14:53:58 -04:00
selftests/bpf: Add set_attach_target() API selftest for module target
Add test for bpf_program__set_attach_target() API, validating it can find kernel module fentry target. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20201211215825.3646154-3-andrii@kernel.org
This commit is contained in:
committed by
Daniel Borkmann
parent
fe62de310e
commit
2e33f831fc
@@ -38,6 +38,17 @@ int BPF_PROG(handle_fentry,
|
||||
return 0;
|
||||
}
|
||||
|
||||
__u32 fentry_manual_read_sz = 0;
|
||||
|
||||
SEC("fentry/placeholder")
|
||||
int BPF_PROG(handle_fentry_manual,
|
||||
struct file *file, struct kobject *kobj,
|
||||
struct bin_attribute *bin_attr, char *buf, loff_t off, size_t len)
|
||||
{
|
||||
fentry_manual_read_sz = len;
|
||||
return 0;
|
||||
}
|
||||
|
||||
__u32 fexit_read_sz = 0;
|
||||
int fexit_ret = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user