diff options
| author | Eduard Zingerman <eddyz87@gmail.com> | 2024-03-06 12:45:27 +0200 |
|---|---|---|
| committer | Andrii Nakryiko <andrii@kernel.org> | 2024-03-06 15:18:16 -0800 |
| commit | 733e5e875444fc5afc9b72714f0ecaca629ccf8a (patch) | |
| tree | 2024cbc2e714c16921db1db347d02f151bcd2ca4 /tools/testing/selftests/bpf/progs/struct_ops_autocreate.c | |
| parent | 6ebaa3fb88bbe4c33a0e01ce27007e1dd4fd133c (diff) | |
selftests/bpf: Test case for SEC("?.struct_ops")
Check that "?.struct_ops" and "?.struct_ops.link" section names define
struct_ops maps with autocreate == false after open.
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20240306104529.6453-14-eddyz87@gmail.com
Diffstat (limited to 'tools/testing/selftests/bpf/progs/struct_ops_autocreate.c')
| -rw-r--r-- | tools/testing/selftests/bpf/progs/struct_ops_autocreate.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/progs/struct_ops_autocreate.c b/tools/testing/selftests/bpf/progs/struct_ops_autocreate.c index 9a951ee6f55c..ba10c3896213 100644 --- a/tools/testing/selftests/bpf/progs/struct_ops_autocreate.c +++ b/tools/testing/selftests/bpf/progs/struct_ops_autocreate.c @@ -40,3 +40,13 @@ struct bpf_testmod_ops___v2 testmod_2 = { .test_1 = (void *)test_1, .does_not_exist = (void *)test_2 }; + +SEC("?.struct_ops") +struct bpf_testmod_ops___v1 optional_map = { + .test_1 = (void *)test_1, +}; + +SEC("?.struct_ops.link") +struct bpf_testmod_ops___v1 optional_map2 = { + .test_1 = (void *)test_1, +}; |