aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests/cgroup_iter.c
diff options
context:
space:
mode:
authorHao Luo <[email protected]>2022-08-25 22:39:36 +0000
committerMartin KaFai Lau <[email protected]>2022-08-25 23:26:37 +0000
commitd4ffb6f39f1a1b260966b43a4ffdb64779c650dd (patch)
tree38ff9a649acc46e6e2b04b6a38b973b217e98b35 /tools/testing/selftests/bpf/prog_tests/cgroup_iter.c
parentbpf/scripts: Assert helper enum value is aligned with comment order (diff)
downloadkernel-d4ffb6f39f1a1b260966b43a4ffdb64779c650dd.tar.gz
kernel-d4ffb6f39f1a1b260966b43a4ffdb64779c650dd.zip
bpf: Add CGROUP prefix to cgroup_iter_order
bpf_cgroup_iter_order is globally visible but the entries do not have CGROUP prefix. As requested by Andrii, put a CGROUP in the names in bpf_cgroup_iter_order. This patch fixes two previous commits: one introduced the API and the other uses the API in bpf selftest (that is, the selftest cgroup_hierarchical_stats). I tested this patch via the following command: test_progs -t cgroup,iter,btf_dump Fixes: d4ccaf58a847 ("bpf: Introduce cgroup iter") Fixes: 88886309d2e8 ("selftests/bpf: add a selftest for cgroup hierarchical stats collection") Suggested-by: Andrii Nakryiko <[email protected]> Acked-by: Andrii Nakryiko <[email protected]> Signed-off-by: Hao Luo <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin KaFai Lau <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/cgroup_iter.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/cgroup_iter.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/cgroup_iter.c b/tools/testing/selftests/bpf/prog_tests/cgroup_iter.c
index 38958c37b9ce..c4a2adb38da1 100644
--- a/tools/testing/selftests/bpf/prog_tests/cgroup_iter.c
+++ b/tools/testing/selftests/bpf/prog_tests/cgroup_iter.c
@@ -134,7 +134,7 @@ static void test_walk_preorder(struct cgroup_iter *skel)
cg_id[PARENT], cg_id[CHILD1], cg_id[CHILD2]);
read_from_cgroup_iter(skel->progs.cgroup_id_printer, cg_fd[PARENT],
- BPF_ITER_DESCENDANTS_PRE, "preorder");
+ BPF_CGROUP_ITER_DESCENDANTS_PRE, "preorder");
}
/* Postorder walk prints child and parent in order. */
@@ -145,7 +145,7 @@ static void test_walk_postorder(struct cgroup_iter *skel)
cg_id[CHILD1], cg_id[CHILD2], cg_id[PARENT]);
read_from_cgroup_iter(skel->progs.cgroup_id_printer, cg_fd[PARENT],
- BPF_ITER_DESCENDANTS_POST, "postorder");
+ BPF_CGROUP_ITER_DESCENDANTS_POST, "postorder");
}
/* Walking parents prints parent and then root. */
@@ -159,7 +159,7 @@ static void test_walk_ancestors_up(struct cgroup_iter *skel)
cg_id[PARENT], cg_id[ROOT]);
read_from_cgroup_iter(skel->progs.cgroup_id_printer, cg_fd[PARENT],
- BPF_ITER_ANCESTORS_UP, "ancestors_up");
+ BPF_CGROUP_ITER_ANCESTORS_UP, "ancestors_up");
skel->bss->terminal_cgroup = 0;
}
@@ -174,7 +174,7 @@ static void test_early_termination(struct cgroup_iter *skel)
PROLOGUE "%8llu\n" EPILOGUE, cg_id[PARENT]);
read_from_cgroup_iter(skel->progs.cgroup_id_printer, cg_fd[PARENT],
- BPF_ITER_DESCENDANTS_PRE, "early_termination");
+ BPF_CGROUP_ITER_DESCENDANTS_PRE, "early_termination");
skel->bss->terminate_early = 0;
}
@@ -186,7 +186,7 @@ static void test_walk_self_only(struct cgroup_iter *skel)
PROLOGUE "%8llu\n" EPILOGUE, cg_id[PARENT]);
read_from_cgroup_iter(skel->progs.cgroup_id_printer, cg_fd[PARENT],
- BPF_ITER_SELF_ONLY, "self_only");
+ BPF_CGROUP_ITER_SELF_ONLY, "self_only");
}
void test_cgroup_iter(void)