Lines Matching refs:skel

34 	struct bpf_iter_test_kern3 *skel;  in test_btf_id_or_null()  local
36 skel = bpf_iter_test_kern3__open_and_load(); in test_btf_id_or_null()
37 if (CHECK(skel, "bpf_iter_test_kern3__open_and_load", in test_btf_id_or_null()
39 bpf_iter_test_kern3__destroy(skel); in test_btf_id_or_null()
87 struct bpf_iter_ipv6_route *skel; in test_ipv6_route() local
89 skel = bpf_iter_ipv6_route__open_and_load(); in test_ipv6_route()
90 if (CHECK(!skel, "bpf_iter_ipv6_route__open_and_load", in test_ipv6_route()
94 do_dummy_read(skel->progs.dump_ipv6_route); in test_ipv6_route()
96 bpf_iter_ipv6_route__destroy(skel); in test_ipv6_route()
101 struct bpf_iter_netlink *skel; in test_netlink() local
103 skel = bpf_iter_netlink__open_and_load(); in test_netlink()
104 if (CHECK(!skel, "bpf_iter_netlink__open_and_load", in test_netlink()
108 do_dummy_read(skel->progs.dump_netlink); in test_netlink()
110 bpf_iter_netlink__destroy(skel); in test_netlink()
115 struct bpf_iter_bpf_map *skel; in test_bpf_map() local
117 skel = bpf_iter_bpf_map__open_and_load(); in test_bpf_map()
118 if (CHECK(!skel, "bpf_iter_bpf_map__open_and_load", in test_bpf_map()
122 do_dummy_read(skel->progs.dump_bpf_map); in test_bpf_map()
124 bpf_iter_bpf_map__destroy(skel); in test_bpf_map()
129 struct bpf_iter_task *skel; in test_task() local
131 skel = bpf_iter_task__open_and_load(); in test_task()
132 if (CHECK(!skel, "bpf_iter_task__open_and_load", in test_task()
136 do_dummy_read(skel->progs.dump_task); in test_task()
138 bpf_iter_task__destroy(skel); in test_task()
143 struct bpf_iter_task_stack *skel; in test_task_stack() local
145 skel = bpf_iter_task_stack__open_and_load(); in test_task_stack()
146 if (CHECK(!skel, "bpf_iter_task_stack__open_and_load", in test_task_stack()
150 do_dummy_read(skel->progs.dump_task_stack); in test_task_stack()
151 do_dummy_read(skel->progs.get_task_user_stacks); in test_task_stack()
153 bpf_iter_task_stack__destroy(skel); in test_task_stack()
163 struct bpf_iter_task_file *skel; in test_task_file() local
167 skel = bpf_iter_task_file__open_and_load(); in test_task_file()
168 if (CHECK(!skel, "bpf_iter_task_file__open_and_load", in test_task_file()
172 skel->bss->tgid = getpid(); in test_task_file()
178 do_dummy_read(skel->progs.dump_task_file); in test_task_file()
184 CHECK(skel->bss->count != 0, "check_count", in test_task_file()
185 "invalid non pthread file visit count %d\n", skel->bss->count); in test_task_file()
188 bpf_iter_task_file__destroy(skel); in test_task_file()
195 static int do_btf_read(struct bpf_iter_task_btf *skel) in do_btf_read() argument
197 struct bpf_program *prog = skel->progs.dump_task_struct; in do_btf_read()
198 struct bpf_iter_task_btf__bss *bss = skel->bss; in do_btf_read()
236 struct bpf_iter_task_btf *skel; in test_task_btf() local
239 skel = bpf_iter_task_btf__open_and_load(); in test_task_btf()
240 if (CHECK(!skel, "bpf_iter_task_btf__open_and_load", in test_task_btf()
244 bss = skel->bss; in test_task_btf()
246 ret = do_btf_read(skel); in test_task_btf()
258 bpf_iter_task_btf__destroy(skel); in test_task_btf()
263 struct bpf_iter_tcp4 *skel; in test_tcp4() local
265 skel = bpf_iter_tcp4__open_and_load(); in test_tcp4()
266 if (CHECK(!skel, "bpf_iter_tcp4__open_and_load", in test_tcp4()
270 do_dummy_read(skel->progs.dump_tcp4); in test_tcp4()
272 bpf_iter_tcp4__destroy(skel); in test_tcp4()
277 struct bpf_iter_tcp6 *skel; in test_tcp6() local
279 skel = bpf_iter_tcp6__open_and_load(); in test_tcp6()
280 if (CHECK(!skel, "bpf_iter_tcp6__open_and_load", in test_tcp6()
284 do_dummy_read(skel->progs.dump_tcp6); in test_tcp6()
286 bpf_iter_tcp6__destroy(skel); in test_tcp6()
291 struct bpf_iter_udp4 *skel; in test_udp4() local
293 skel = bpf_iter_udp4__open_and_load(); in test_udp4()
294 if (CHECK(!skel, "bpf_iter_udp4__open_and_load", in test_udp4()
298 do_dummy_read(skel->progs.dump_udp4); in test_udp4()
300 bpf_iter_udp4__destroy(skel); in test_udp4()
305 struct bpf_iter_udp6 *skel; in test_udp6() local
307 skel = bpf_iter_udp6__open_and_load(); in test_udp6()
308 if (CHECK(!skel, "bpf_iter_udp6__open_and_load", in test_udp6()
312 do_dummy_read(skel->progs.dump_udp6); in test_udp6()
314 bpf_iter_udp6__destroy(skel); in test_udp6()
319 struct bpf_iter_unix *skel; in test_unix() local
321 skel = bpf_iter_unix__open_and_load(); in test_unix()
322 if (!ASSERT_OK_PTR(skel, "bpf_iter_unix__open_and_load")) in test_unix()
325 do_dummy_read(skel->progs.dump_unix); in test_unix()
327 bpf_iter_unix__destroy(skel); in test_unix()
358 struct bpf_iter_test_kern1 *skel; in test_anon_iter() local
362 skel = bpf_iter_test_kern1__open_and_load(); in test_anon_iter()
363 if (CHECK(!skel, "bpf_iter_test_kern1__open_and_load", in test_anon_iter()
367 err = bpf_iter_test_kern1__attach(skel); in test_anon_iter()
373 link = skel->links.dump_task; in test_anon_iter()
382 bpf_iter_test_kern1__destroy(skel); in test_anon_iter()
457 struct bpf_iter_test_kern4 *skel; in test_overflow() local
462 skel = bpf_iter_test_kern4__open(); in test_overflow()
463 if (CHECK(!skel, "bpf_iter_test_kern4__open", in test_overflow()
489 skel->rodata->print_len = (iter_size + 8) / 8; in test_overflow()
492 skel->rodata->print_len = (iter_size - 8) / 8; in test_overflow()
495 skel->rodata->print_len = 1; in test_overflow()
498 skel->rodata->ret1 = ret1; in test_overflow()
500 if (CHECK(bpf_iter_test_kern4__load(skel), in test_overflow()
510 skel->bss->map1_id = map_info.id; in test_overflow()
516 skel->bss->map2_id = map_info.id; in test_overflow()
518 link = bpf_program__attach_iter(skel->progs.dump_bpf_map, NULL); in test_overflow()
564 if (CHECK(skel->bss->map1_accessed != 1, "map1_accessed", in test_overflow()
565 "expected 1 actual %d\n", skel->bss->map1_accessed)) in test_overflow()
568 if (CHECK(skel->bss->map2_accessed != 2, "map2_accessed", in test_overflow()
569 "expected 2 actual %d\n", skel->bss->map2_accessed)) in test_overflow()
572 CHECK(skel->bss->map2_seqnum1 != skel->bss->map2_seqnum2, in test_overflow()
574 skel->bss->map2_seqnum1, skel->bss->map2_seqnum2); in test_overflow()
587 bpf_iter_test_kern4__destroy(skel); in test_overflow()
594 struct bpf_iter_bpf_hash_map *skel; in test_bpf_hash_map() local
606 skel = bpf_iter_bpf_hash_map__open(); in test_bpf_hash_map()
607 if (CHECK(!skel, "bpf_iter_bpf_hash_map__open", in test_bpf_hash_map()
611 skel->bss->in_test_mode = true; in test_bpf_hash_map()
613 err = bpf_iter_bpf_hash_map__load(skel); in test_bpf_hash_map()
614 if (CHECK(!skel, "bpf_iter_bpf_hash_map__load", in test_bpf_hash_map()
620 linfo.map.map_fd = bpf_map__fd(skel->maps.hashmap2); in test_bpf_hash_map()
623 link = bpf_program__attach_iter(skel->progs.dump_bpf_hash_map, &opts); in test_bpf_hash_map()
627 linfo.map.map_fd = bpf_map__fd(skel->maps.hashmap3); in test_bpf_hash_map()
628 link = bpf_program__attach_iter(skel->progs.dump_bpf_hash_map, &opts); in test_bpf_hash_map()
633 map_fd = bpf_map__fd(skel->maps.hashmap1); in test_bpf_hash_map()
634 for (i = 0; i < bpf_map__max_entries(skel->maps.hashmap1); i++) { in test_bpf_hash_map()
649 link = bpf_program__attach_iter(skel->progs.dump_bpf_hash_map, &opts); in test_bpf_hash_map()
664 if (CHECK(skel->bss->key_sum_a != expected_key_a, in test_bpf_hash_map()
666 skel->bss->key_sum_a, expected_key_a)) in test_bpf_hash_map()
668 if (CHECK(skel->bss->key_sum_b != expected_key_b, in test_bpf_hash_map()
670 skel->bss->key_sum_b, expected_key_b)) in test_bpf_hash_map()
672 if (CHECK(skel->bss->val_sum != expected_val, in test_bpf_hash_map()
674 skel->bss->val_sum, expected_val)) in test_bpf_hash_map()
682 bpf_iter_bpf_hash_map__destroy(skel); in test_bpf_hash_map()
689 struct bpf_iter_bpf_percpu_hash_map *skel; in test_bpf_percpu_hash_map() local
704 skel = bpf_iter_bpf_percpu_hash_map__open(); in test_bpf_percpu_hash_map()
705 if (CHECK(!skel, "bpf_iter_bpf_percpu_hash_map__open", in test_bpf_percpu_hash_map()
709 skel->rodata->num_cpus = bpf_num_possible_cpus(); in test_bpf_percpu_hash_map()
711 err = bpf_iter_bpf_percpu_hash_map__load(skel); in test_bpf_percpu_hash_map()
712 if (CHECK(!skel, "bpf_iter_bpf_percpu_hash_map__load", in test_bpf_percpu_hash_map()
717 map_fd = bpf_map__fd(skel->maps.hashmap1); in test_bpf_percpu_hash_map()
718 for (i = 0; i < bpf_map__max_entries(skel->maps.hashmap1); i++) { in test_bpf_percpu_hash_map()
739 link = bpf_program__attach_iter(skel->progs.dump_bpf_percpu_hash_map, &opts); in test_bpf_percpu_hash_map()
754 if (CHECK(skel->bss->key_sum_a != expected_key_a, in test_bpf_percpu_hash_map()
756 skel->bss->key_sum_a, expected_key_a)) in test_bpf_percpu_hash_map()
758 if (CHECK(skel->bss->key_sum_b != expected_key_b, in test_bpf_percpu_hash_map()
760 skel->bss->key_sum_b, expected_key_b)) in test_bpf_percpu_hash_map()
762 if (CHECK(skel->bss->val_sum != expected_val, in test_bpf_percpu_hash_map()
764 skel->bss->val_sum, expected_val)) in test_bpf_percpu_hash_map()
772 bpf_iter_bpf_percpu_hash_map__destroy(skel); in test_bpf_percpu_hash_map()
780 struct bpf_iter_bpf_array_map *skel; in test_bpf_array_map() local
787 skel = bpf_iter_bpf_array_map__open_and_load(); in test_bpf_array_map()
788 if (CHECK(!skel, "bpf_iter_bpf_array_map__open_and_load", in test_bpf_array_map()
792 map_fd = bpf_map__fd(skel->maps.arraymap1); in test_bpf_array_map()
793 for (i = 0; i < bpf_map__max_entries(skel->maps.arraymap1); i++) { in test_bpf_array_map()
810 link = bpf_program__attach_iter(skel->progs.dump_bpf_array_map, &opts); in test_bpf_array_map()
835 if (CHECK(skel->bss->key_sum != expected_key, in test_bpf_array_map()
837 skel->bss->key_sum, expected_key)) in test_bpf_array_map()
839 if (CHECK(skel->bss->val_sum != expected_val, in test_bpf_array_map()
841 skel->bss->val_sum, expected_val)) in test_bpf_array_map()
844 for (i = 0; i < bpf_map__max_entries(skel->maps.arraymap1); i++) { in test_bpf_array_map()
858 bpf_iter_bpf_array_map__destroy(skel); in test_bpf_array_map()
864 struct bpf_iter_bpf_percpu_array_map *skel; in test_bpf_percpu_array_map() local
875 skel = bpf_iter_bpf_percpu_array_map__open(); in test_bpf_percpu_array_map()
876 if (CHECK(!skel, "bpf_iter_bpf_percpu_array_map__open", in test_bpf_percpu_array_map()
880 skel->rodata->num_cpus = bpf_num_possible_cpus(); in test_bpf_percpu_array_map()
882 err = bpf_iter_bpf_percpu_array_map__load(skel); in test_bpf_percpu_array_map()
883 if (CHECK(!skel, "bpf_iter_bpf_percpu_array_map__load", in test_bpf_percpu_array_map()
888 map_fd = bpf_map__fd(skel->maps.arraymap1); in test_bpf_percpu_array_map()
889 for (i = 0; i < bpf_map__max_entries(skel->maps.arraymap1); i++) { in test_bpf_percpu_array_map()
906 link = bpf_program__attach_iter(skel->progs.dump_bpf_percpu_array_map, &opts); in test_bpf_percpu_array_map()
921 if (CHECK(skel->bss->key_sum != expected_key, in test_bpf_percpu_array_map()
923 skel->bss->key_sum, expected_key)) in test_bpf_percpu_array_map()
925 if (CHECK(skel->bss->val_sum != expected_val, in test_bpf_percpu_array_map()
927 skel->bss->val_sum, expected_val)) in test_bpf_percpu_array_map()
935 bpf_iter_bpf_percpu_array_map__destroy(skel); in test_bpf_percpu_array_map()
942 struct bpf_iter_bpf_sk_storage_helpers *skel; in test_bpf_sk_storage_delete() local
950 skel = bpf_iter_bpf_sk_storage_helpers__open_and_load(); in test_bpf_sk_storage_delete()
951 if (CHECK(!skel, "bpf_iter_bpf_sk_storage_helpers__open_and_load", in test_bpf_sk_storage_delete()
955 map_fd = bpf_map__fd(skel->maps.sk_stg_map); in test_bpf_sk_storage_delete()
968 link = bpf_program__attach_iter(skel->progs.delete_bpf_sk_storage_map, in test_bpf_sk_storage_delete()
996 bpf_iter_bpf_sk_storage_helpers__destroy(skel); in test_bpf_sk_storage_delete()
1007 struct bpf_iter_bpf_sk_storage_helpers *skel; in test_bpf_sk_storage_get() local
1011 skel = bpf_iter_bpf_sk_storage_helpers__open_and_load(); in test_bpf_sk_storage_get()
1012 if (CHECK(!skel, "bpf_iter_bpf_sk_storage_helpers__open_and_load", in test_bpf_sk_storage_get()
1024 map_fd = bpf_map__fd(skel->maps.sk_stg_map); in test_bpf_sk_storage_get()
1030 do_dummy_read(skel->progs.fill_socket_owner); in test_bpf_sk_storage_get()
1038 do_dummy_read(skel->progs.negate_socket_local_storage); in test_bpf_sk_storage_get()
1048 bpf_iter_bpf_sk_storage_helpers__destroy(skel); in test_bpf_sk_storage_get()
1055 struct bpf_iter_bpf_sk_storage_map *skel; in test_bpf_sk_storage_map() local
1062 skel = bpf_iter_bpf_sk_storage_map__open_and_load(); in test_bpf_sk_storage_map()
1063 if (CHECK(!skel, "bpf_iter_bpf_sk_storage_map__open_and_load", in test_bpf_sk_storage_map()
1067 map_fd = bpf_map__fd(skel->maps.sk_stg_map); in test_bpf_sk_storage_map()
1087 link = bpf_program__attach_iter(skel->progs.dump_bpf_sk_storage_map, &opts); in test_bpf_sk_storage_map()
1102 if (CHECK(skel->bss->ipv6_sk_count != num_sockets, in test_bpf_sk_storage_map()
1104 skel->bss->ipv6_sk_count, num_sockets)) in test_bpf_sk_storage_map()
1107 if (CHECK(skel->bss->val_sum != expected_val, in test_bpf_sk_storage_map()
1109 skel->bss->val_sum, expected_val)) in test_bpf_sk_storage_map()
1121 bpf_iter_bpf_sk_storage_map__destroy(skel); in test_bpf_sk_storage_map()
1127 struct bpf_iter_test_kern5 *skel; in test_rdonly_buf_out_of_bound() local
1131 skel = bpf_iter_test_kern5__open_and_load(); in test_rdonly_buf_out_of_bound()
1132 if (CHECK(!skel, "bpf_iter_test_kern5__open_and_load", in test_rdonly_buf_out_of_bound()
1137 linfo.map.map_fd = bpf_map__fd(skel->maps.hashmap1); in test_rdonly_buf_out_of_bound()
1140 link = bpf_program__attach_iter(skel->progs.dump_bpf_hash_map, &opts); in test_rdonly_buf_out_of_bound()
1144 bpf_iter_test_kern5__destroy(skel); in test_rdonly_buf_out_of_bound()
1149 struct bpf_iter_test_kern6 *skel; in test_buf_neg_offset() local
1151 skel = bpf_iter_test_kern6__open_and_load(); in test_buf_neg_offset()
1152 if (CHECK(skel, "bpf_iter_test_kern6__open_and_load", in test_buf_neg_offset()
1154 bpf_iter_test_kern6__destroy(skel); in test_buf_neg_offset()
1182 struct bpf_iter_task_vma *skel; in test_task_vma() local
1186 skel = bpf_iter_task_vma__open(); in test_task_vma()
1187 if (CHECK(!skel, "bpf_iter_task_vma__open", "skeleton open failed\n")) in test_task_vma()
1190 skel->bss->pid = getpid(); in test_task_vma()
1192 err = bpf_iter_task_vma__load(skel); in test_task_vma()
1196 skel->links.proc_maps = bpf_program__attach_iter( in test_task_vma()
1197 skel->progs.proc_maps, NULL); in test_task_vma()
1199 if (!ASSERT_OK_PTR(skel->links.proc_maps, "bpf_program__attach_iter")) { in test_task_vma()
1200 skel->links.proc_maps = NULL; in test_task_vma()
1204 iter_fd = bpf_iter_create(bpf_link__fd(skel->links.proc_maps)); in test_task_vma()
1222 snprintf(maps_path, 64, "/proc/%u/maps", skel->bss->pid); in test_task_vma()
1239 bpf_iter_task_vma__destroy(skel); in test_task_vma()