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.
Showing the changes to include/linux (1 of 6 files). Show all
Unified · Split
| @@ -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); |
| 1157 | int bpf_prog_test_run_skb(struct bpf_prog *prog, const union bpf_attr *kattr, | 1157 | int 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); |
| 1159 | int bpf_prog_test_run_tracing(struct bpf_prog *prog, | ||
| 1160 | const union bpf_attr *kattr, | ||
| 1161 | union bpf_attr __user *uattr); | ||
| 1159 | int bpf_prog_test_run_flow_dissector(struct bpf_prog *prog, | 1162 | int 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 | ||
| 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 | |||
| 1316 | static inline int bpf_prog_test_run_flow_dissector(struct bpf_prog *prog, | 1326 | static 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) |