Skip to content

Commit

Permalink
selftests/bpf: Use BPF_PROG2 for some fentry programs without struct …
Browse files Browse the repository at this point in the history
…arguments

Use BPF_PROG2 instead of BPF_PROG for programs in progs/timer.c
to test BPF_PROG2 for cases without struct arguments.

Signed-off-by: Yonghong Song <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
  • Loading branch information
yonghong-song authored and Alexei Starovoitov committed Sep 7, 2022
1 parent 1642a39 commit a7c2ca3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/bpf/progs/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static int timer_cb1(void *map, int *key, struct bpf_timer *timer)
}

SEC("fentry/bpf_fentry_test1")
int BPF_PROG(test1, int a)
int BPF_PROG2(test1, int, a)
{
struct bpf_timer *arr_timer, *lru_timer;
struct elem init = {};
Expand Down Expand Up @@ -236,7 +236,7 @@ int bpf_timer_test(void)
}

SEC("fentry/bpf_fentry_test2")
int BPF_PROG(test2, int a, int b)
int BPF_PROG2(test2, int, a, int, b)
{
struct hmap_elem init = {}, *val;
int key = HTAB, key_malloc = HTAB_MALLOC;
Expand Down

0 comments on commit a7c2ca3

Please sign in to comment.