History

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.

KP Singh committed 6 years ago

Commit da00d2f1 parent aca228c6 files · +67 −76Browse files

Showing the changes to include/linux (1 of 6 files). Show all

Unified · Split

include/linux/bpf.h+10−0
@@ -1156,6 +1156,9 @@ int bpf_prog_test_run_xdp(struct bpf_prog *prog, const union bpf_attr *kattr, · 1155 unmodified lines
11561156 union bpf_attr __user *uattr);
11571157 int bpf_prog_test_run_skb(struct bpf_prog *prog, const union bpf_attr *kattr,
11581158 union bpf_attr __user *uattr);
1159+int bpf_prog_test_run_tracing(struct bpf_prog *prog,
1160+ const union bpf_attr *kattr,
1161+ union bpf_attr __user *uattr);
11591162 int bpf_prog_test_run_flow_dissector(struct bpf_prog *prog,
11601163 const union bpf_attr *kattr,
11611164 union bpf_attr __user *uattr);
@@ -1313,6 +1316,13 @@ static inline int bpf_prog_test_run_skb(struct bpf_prog *prog, · 151 unmodified lines
13131316 return -ENOTSUPP;
13141317 }
13151318
1319+static inline int bpf_prog_test_run_tracing(struct bpf_prog *prog,
1320+ const union bpf_attr *kattr,
1321+ union bpf_attr __user *uattr)
1322+{
1323+ return -ENOTSUPP;
1324+}
1325+
13161326 static inline int bpf_prog_test_run_flow_dissector(struct bpf_prog *prog,
13171327 const union bpf_attr *kattr,
13181328 union bpf_attr __user *uattr)