]> www.infradead.org Git - users/willy/xarray.git/commitdiff
selftests/bpf: rename bpf_iter_task.c to bpf_iter_tasks.c
authorChuyi Zhou <zhouchuyi@bytedance.com>
Wed, 18 Oct 2023 06:17:45 +0000 (14:17 +0800)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 20 Oct 2023 00:02:47 +0000 (17:02 -0700)
The newly-added struct bpf_iter_task has a name collision with a selftest
for the seq_file task iter's bpf skel, so the selftests/bpf/progs file is
renamed in order to avoid the collision.

Signed-off-by: Chuyi Zhou <zhouchuyi@bytedance.com>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20231018061746.111364-8-zhouchuyi@bytedance.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/bpf_iter.c
tools/testing/selftests/bpf/progs/bpf_iter_tasks.c [moved from tools/testing/selftests/bpf/progs/bpf_iter_task.c with 100% similarity]

index 41aba139b20b85f6bdca394f266773fc20e83fcc..e3498f607b49d794afcdef21c8d1c4d15318aa7b 100644 (file)
@@ -7,7 +7,7 @@
 #include "bpf_iter_ipv6_route.skel.h"
 #include "bpf_iter_netlink.skel.h"
 #include "bpf_iter_bpf_map.skel.h"
-#include "bpf_iter_task.skel.h"
+#include "bpf_iter_tasks.skel.h"
 #include "bpf_iter_task_stack.skel.h"
 #include "bpf_iter_task_file.skel.h"
 #include "bpf_iter_task_vmas.skel.h"
@@ -215,12 +215,12 @@ static void *do_nothing_wait(void *arg)
 static void test_task_common_nocheck(struct bpf_iter_attach_opts *opts,
                                     int *num_unknown, int *num_known)
 {
-       struct bpf_iter_task *skel;
+       struct bpf_iter_tasks *skel;
        pthread_t thread_id;
        void *ret;
 
-       skel = bpf_iter_task__open_and_load();
-       if (!ASSERT_OK_PTR(skel, "bpf_iter_task__open_and_load"))
+       skel = bpf_iter_tasks__open_and_load();
+       if (!ASSERT_OK_PTR(skel, "bpf_iter_tasks__open_and_load"))
                return;
 
        ASSERT_OK(pthread_mutex_lock(&do_nothing_mutex), "pthread_mutex_lock");
@@ -239,7 +239,7 @@ static void test_task_common_nocheck(struct bpf_iter_attach_opts *opts,
        ASSERT_FALSE(pthread_join(thread_id, &ret) || ret != NULL,
                     "pthread_join");
 
-       bpf_iter_task__destroy(skel);
+       bpf_iter_tasks__destroy(skel);
 }
 
 static void test_task_common(struct bpf_iter_attach_opts *opts, int num_unknown, int num_known)
@@ -307,10 +307,10 @@ static void test_task_pidfd(void)
 
 static void test_task_sleepable(void)
 {
-       struct bpf_iter_task *skel;
+       struct bpf_iter_tasks *skel;
 
-       skel = bpf_iter_task__open_and_load();
-       if (!ASSERT_OK_PTR(skel, "bpf_iter_task__open_and_load"))
+       skel = bpf_iter_tasks__open_and_load();
+       if (!ASSERT_OK_PTR(skel, "bpf_iter_tasks__open_and_load"))
                return;
 
        do_dummy_read(skel->progs.dump_task_sleepable);
@@ -320,7 +320,7 @@ static void test_task_sleepable(void)
        ASSERT_GT(skel->bss->num_success_copy_from_user_task, 0,
                  "num_success_copy_from_user_task");
 
-       bpf_iter_task__destroy(skel);
+       bpf_iter_tasks__destroy(skel);
 }
 
 static void test_task_stack(void)