mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
selftests/bpf: Rename bpf_iter_task_vma.c to bpf_iter_task_vmas.c
Further patches in this series will add a struct bpf_iter_task_vma, which will result in a name collision with the selftest prog renamed in this patch. Rename the selftest to avoid the collision. Signed-off-by: Dave Marchevsky <davemarchevsky@fb.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Acked-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20231013204426.1074286-3-davemarchevsky@fb.com
This commit is contained in:
parent
f10ca5da5b
commit
45b38941c8
2 changed files with 13 additions and 13 deletions
|
@ -10,7 +10,7 @@
|
||||||
#include "bpf_iter_task.skel.h"
|
#include "bpf_iter_task.skel.h"
|
||||||
#include "bpf_iter_task_stack.skel.h"
|
#include "bpf_iter_task_stack.skel.h"
|
||||||
#include "bpf_iter_task_file.skel.h"
|
#include "bpf_iter_task_file.skel.h"
|
||||||
#include "bpf_iter_task_vma.skel.h"
|
#include "bpf_iter_task_vmas.skel.h"
|
||||||
#include "bpf_iter_task_btf.skel.h"
|
#include "bpf_iter_task_btf.skel.h"
|
||||||
#include "bpf_iter_tcp4.skel.h"
|
#include "bpf_iter_tcp4.skel.h"
|
||||||
#include "bpf_iter_tcp6.skel.h"
|
#include "bpf_iter_tcp6.skel.h"
|
||||||
|
@ -1399,19 +1399,19 @@ static void str_strip_first_line(char *str)
|
||||||
static void test_task_vma_common(struct bpf_iter_attach_opts *opts)
|
static void test_task_vma_common(struct bpf_iter_attach_opts *opts)
|
||||||
{
|
{
|
||||||
int err, iter_fd = -1, proc_maps_fd = -1;
|
int err, iter_fd = -1, proc_maps_fd = -1;
|
||||||
struct bpf_iter_task_vma *skel;
|
struct bpf_iter_task_vmas *skel;
|
||||||
int len, read_size = 4;
|
int len, read_size = 4;
|
||||||
char maps_path[64];
|
char maps_path[64];
|
||||||
|
|
||||||
skel = bpf_iter_task_vma__open();
|
skel = bpf_iter_task_vmas__open();
|
||||||
if (!ASSERT_OK_PTR(skel, "bpf_iter_task_vma__open"))
|
if (!ASSERT_OK_PTR(skel, "bpf_iter_task_vmas__open"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
skel->bss->pid = getpid();
|
skel->bss->pid = getpid();
|
||||||
skel->bss->one_task = opts ? 1 : 0;
|
skel->bss->one_task = opts ? 1 : 0;
|
||||||
|
|
||||||
err = bpf_iter_task_vma__load(skel);
|
err = bpf_iter_task_vmas__load(skel);
|
||||||
if (!ASSERT_OK(err, "bpf_iter_task_vma__load"))
|
if (!ASSERT_OK(err, "bpf_iter_task_vmas__load"))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
skel->links.proc_maps = bpf_program__attach_iter(
|
skel->links.proc_maps = bpf_program__attach_iter(
|
||||||
|
@ -1462,25 +1462,25 @@ static void test_task_vma_common(struct bpf_iter_attach_opts *opts)
|
||||||
out:
|
out:
|
||||||
close(proc_maps_fd);
|
close(proc_maps_fd);
|
||||||
close(iter_fd);
|
close(iter_fd);
|
||||||
bpf_iter_task_vma__destroy(skel);
|
bpf_iter_task_vmas__destroy(skel);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_task_vma_dead_task(void)
|
static void test_task_vma_dead_task(void)
|
||||||
{
|
{
|
||||||
struct bpf_iter_task_vma *skel;
|
struct bpf_iter_task_vmas *skel;
|
||||||
int wstatus, child_pid = -1;
|
int wstatus, child_pid = -1;
|
||||||
time_t start_tm, cur_tm;
|
time_t start_tm, cur_tm;
|
||||||
int err, iter_fd = -1;
|
int err, iter_fd = -1;
|
||||||
int wait_sec = 3;
|
int wait_sec = 3;
|
||||||
|
|
||||||
skel = bpf_iter_task_vma__open();
|
skel = bpf_iter_task_vmas__open();
|
||||||
if (!ASSERT_OK_PTR(skel, "bpf_iter_task_vma__open"))
|
if (!ASSERT_OK_PTR(skel, "bpf_iter_task_vmas__open"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
skel->bss->pid = getpid();
|
skel->bss->pid = getpid();
|
||||||
|
|
||||||
err = bpf_iter_task_vma__load(skel);
|
err = bpf_iter_task_vmas__load(skel);
|
||||||
if (!ASSERT_OK(err, "bpf_iter_task_vma__load"))
|
if (!ASSERT_OK(err, "bpf_iter_task_vmas__load"))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
skel->links.proc_maps = bpf_program__attach_iter(
|
skel->links.proc_maps = bpf_program__attach_iter(
|
||||||
|
@ -1533,7 +1533,7 @@ static void test_task_vma_dead_task(void)
|
||||||
out:
|
out:
|
||||||
waitpid(child_pid, &wstatus, 0);
|
waitpid(child_pid, &wstatus, 0);
|
||||||
close(iter_fd);
|
close(iter_fd);
|
||||||
bpf_iter_task_vma__destroy(skel);
|
bpf_iter_task_vmas__destroy(skel);
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_bpf_sockmap_map_iter_fd(void)
|
void test_bpf_sockmap_map_iter_fd(void)
|
||||||
|
|
Loading…
Add table
Reference in a new issue