diff mbox series

[bpf,v2,2/2] selftests/bpf: enforce returning 0 for fentry/fexit programs

Message ID 20200514053207.1298479-1-yhs@fb.com
State Accepted
Delegated to: BPF Maintainers
Headers show
Series bpf: enforce returning 0 for fentry/fexit programs | expand

Commit Message

Yonghong Song May 14, 2020, 5:32 a.m. UTC
There are a few fentry/fexit programs returning non-0.
The tests with these programs will break with the previous
patch which enfoced return-0 rules. Fix them properly.

Fixes: ac065870d928 ("selftests/bpf: Add BPF_PROG, BPF_KPROBE, and BPF_KRETPROBE macros")
Signed-off-by: Yonghong Song <yhs@fb.com>
---
 tools/testing/selftests/bpf/progs/test_overhead.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Andrii Nakryiko May 14, 2020, 6:14 a.m. UTC | #1
On Wed, May 13, 2020 at 10:33 PM Yonghong Song <yhs@fb.com> wrote:
>
> There are a few fentry/fexit programs returning non-0.
> The tests with these programs will break with the previous
> patch which enfoced return-0 rules. Fix them properly.
>
> Fixes: ac065870d928 ("selftests/bpf: Add BPF_PROG, BPF_KPROBE, and BPF_KRETPROBE macros")
> Signed-off-by: Yonghong Song <yhs@fb.com>
> ---

Acked-by: Andrii Nakryiko <andriin@fb.com>

[...]
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/progs/test_overhead.c b/tools/testing/selftests/bpf/progs/test_overhead.c
index 56a50b25cd33..abb7344b531f 100644
--- a/tools/testing/selftests/bpf/progs/test_overhead.c
+++ b/tools/testing/selftests/bpf/progs/test_overhead.c
@@ -30,13 +30,13 @@  int prog3(struct bpf_raw_tracepoint_args *ctx)
 SEC("fentry/__set_task_comm")
 int BPF_PROG(prog4, struct task_struct *tsk, const char *buf, bool exec)
 {
-	return !tsk;
+	return 0;
 }
 
 SEC("fexit/__set_task_comm")
 int BPF_PROG(prog5, struct task_struct *tsk, const char *buf, bool exec)
 {
-	return !tsk;
+	return 0;
 }
 
 char _license[] SEC("license") = "GPL";