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
1156 union bpf_attr __user *uattr);1156 union bpf_attr __user *uattr);
1157int bpf_prog_test_run_skb(struct bpf_prog *prog, const union bpf_attr *kattr,1157int bpf_prog_test_run_skb(struct bpf_prog *prog, const union bpf_attr *kattr,
1158 union bpf_attr __user *uattr);1158 union bpf_attr __user *uattr);
1159int bpf_prog_test_run_tracing(struct bpf_prog *prog,
1160 const union bpf_attr *kattr,
1161 union bpf_attr __user *uattr);
1159int bpf_prog_test_run_flow_dissector(struct bpf_prog *prog,1162int bpf_prog_test_run_flow_dissector(struct bpf_prog *prog,
1160 const union bpf_attr *kattr,1163 const union bpf_attr *kattr,
1161 union bpf_attr __user *uattr);1164 union bpf_attr __user *uattr);
@@ -1313,6 +1316,13 @@ static inline int bpf_prog_test_run_skb(struct bpf_prog *prog, · 151 unmodified lines
1313 return -ENOTSUPP;1316 return -ENOTSUPP;
1314}1317}
1315 1318
1319static 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
1316static inline int bpf_prog_test_run_flow_dissector(struct bpf_prog *prog,1326static inline int bpf_prog_test_run_flow_dissector(struct bpf_prog *prog,
1317 const union bpf_attr *kattr,1327 const union bpf_attr *kattr,
1318 union bpf_attr __user *uattr)1328 union bpf_attr __user *uattr)