OSDN Git Service

bpf: Add test ops for BPF_PROG_TYPE_TRACING
authorKP Singh <kpsingh@google.com>
Wed, 4 Mar 2020 19:18:52 +0000 (20:18 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 4 Mar 2020 21:41:06 +0000 (13:41 -0800)
commitda00d2f117a08fbca262db5ea422c80a568b112b
tree81519be4eb8e8c8b69ca88d834f79aae9f925db8
parentaca228cd3387447d99d3ebaee3ebcc2b015a3e46
bpf: Add test ops for BPF_PROG_TYPE_TRACING

The current fexit and fentry tests rely on a different program to
exercise the functions they attach to. Instead of doing this, implement
the test operations for tracing which will also be used for
BPF_MODIFY_RETURN in a subsequent patch.

Also, clean up the fexit test to use the generated skeleton.

Signed-off-by: KP Singh <kpsingh@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20200304191853.1529-7-kpsingh@chromium.org
include/linux/bpf.h
kernel/trace/bpf_trace.c
net/bpf/test_run.c
tools/testing/selftests/bpf/prog_tests/fentry_fexit.c
tools/testing/selftests/bpf/prog_tests/fentry_test.c
tools/testing/selftests/bpf/prog_tests/fexit_test.c