/linux-6.3-rc2/tools/testing/selftests/bpf/prog_tests/ |
A D | atomics.c | 13 prog_fd = skel->progs.add.prog_fd; in test_add() 167 struct atomics_lskel *skel; in test_atomics() local 173 if (skel->data->skip_tests) { in test_atomics() 179 skel->bss->pid = getpid(); in test_atomics() 182 test_add(skel); in test_atomics() 184 test_sub(skel); in test_atomics() 186 test_and(skel); in test_atomics() 188 test_or(skel); in test_atomics() 190 test_xor(skel); in test_atomics() 192 test_cmpxchg(skel); in test_atomics() [all …]
|
A D | test_strncmp.c | 12 cmp = skel->bss->cmp_ret; in trigger_strncmp() 28 char *str = skel->bss->str; in strncmp_full_str_cmp() 37 got = trigger_strncmp(skel); in strncmp_full_str_cmp() 46 struct strncmp_test *skel; in test_strncmp_ret() local 49 skel = strncmp_test__open(); in test_strncmp_ret() 66 skel->bss->str[0] = '\0'; in test_strncmp_ret() 71 memcpy(skel->bss->str, skel->rodata->target, sizeof(skel->bss->str)); in test_strncmp_ret() 76 memcpy(skel->bss->str, skel->rodata->target, sizeof(skel->bss->str)); in test_strncmp_ret() 77 skel->bss->str[sizeof(skel->bss->str) - 1] = 'A'; in test_strncmp_ret() 89 struct strncmp_test *skel; in test_strncmp_bad_not_const_str_size() local [all …]
|
A D | attach_probe.c | 33 struct test_attach_probe* skel; in test_attach_probe() local 60 skel = test_attach_probe__open(); in test_attach_probe() 90 skel->links.handle_kprobe_auto = bpf_program__attach(skel->progs.handle_kprobe_auto); in test_attach_probe() 93 skel->links.handle_kretprobe_auto = bpf_program__attach(skel->progs.handle_kretprobe_auto); in test_attach_probe() 133 skel->links.handle_uprobe_byname = in test_attach_probe() 152 skel->links.handle_uprobe_byname2 = in test_attach_probe() 171 skel->links.handle_kprobe_sleepable = bpf_program__attach(skel->progs.handle_kprobe_sleepable); in test_attach_probe() 180 skel->links.handle_uprobe_byname3 = bpf_program__attach(skel->progs.handle_uprobe_byname3); in test_attach_probe() 188 skel->links.handle_uretprobe_byname3 = bpf_program__attach(skel->progs.handle_uretprobe_byname3); in test_attach_probe() 192 skel->bss->user_ptr = test_data; in test_attach_probe() [all …]
|
A D | bpf_loop.c | 17 skel->bss->nr_loops = 0; in check_nr_loops() 21 ASSERT_EQ(skel->bss->nr_loops_returned, skel->bss->nr_loops, in check_nr_loops() 25 skel->bss->nr_loops = 500; in check_nr_loops() 29 ASSERT_EQ(skel->bss->nr_loops_returned, skel->bss->nr_loops, in check_nr_loops() 34 skel->bss->nr_loops = -1; in check_nr_loops() 57 ASSERT_EQ(skel->bss->nr_loops_returned, skel->data->stop_index + 1, in check_callback_fn_stop() 74 skel->bss->nr_loops = 10; in check_null_callback_ctx() 78 ASSERT_EQ(skel->bss->nr_loops_returned, skel->bss->nr_loops, in check_null_callback_ctx() 183 struct bpf_loop *skel; in test_bpf_loop() local 192 check_nr_loops(skel); in test_bpf_loop() [all …]
|
A D | cgrp_local_storage.c | 24 struct cgrp_ls_tp_btf *skel; in test_tp_btf() local 51 err = cgrp_ls_tp_btf__attach(skel); in test_tp_btf() 58 skel->bss->target_pid = 0; in test_tp_btf() 65 cgrp_ls_tp_btf__destroy(skel); in test_tp_btf() 126 struct cgrp_ls_recursion *skel; in test_recursion() local 141 cgrp_ls_recursion__destroy(skel); in test_recursion() 146 struct cgrp_ls_negative *skel; in test_negative() local 150 cgrp_ls_negative__destroy(skel); in test_negative() 159 struct cgrp_ls_sleepable *skel; in test_cgroup_iter_sleepable() local 198 struct cgrp_ls_sleepable *skel; in test_no_rcu_lock() local [all …]
|
A D | bpf_iter.c | 106 *skel = NULL; in do_read_map_iter_fd() 218 struct bpf_iter_task *skel; in test_task_common_nocheck() local 231 skel->bss->tid = getpid(); in test_task_common_nocheck() 369 skel->bss->last_tgid = 0; in test_task_file() 370 skel->bss->count = 0; in test_task_file() 438 bss = skel->bss; in test_task_btf() 440 ret = do_btf_read(skel); in test_task_btf() 749 ASSERT_EQ(skel->bss->map2_seqnum1, skel->bss->map2_seqnum2, "map2_seqnum"); in test_overflow() 1036 do_read_map_iter_fd(&skel->skeleton, skel->progs.dump_bpf_array_map, in test_bpf_array_map_iter_fd() 1232 do_read_map_iter_fd(&skel->skeleton, skel->progs.rw_bpf_sk_storage_map, in test_bpf_sk_stoarge_map_iter_fd() [all …]
|
A D | tracing_struct.c | 9 struct tracing_struct *skel; in test_fentry() local 12 skel = tracing_struct__open_and_load(); in test_fentry() 16 err = tracing_struct__attach(skel); in test_fentry() 24 ASSERT_EQ(skel->bss->t1_b, 1, "t1:b"); in test_fentry() 25 ASSERT_EQ(skel->bss->t1_c, 4, "t1:c"); in test_fentry() 34 ASSERT_EQ(skel->bss->t2_a, 1, "t2:a"); in test_fentry() 37 ASSERT_EQ(skel->bss->t2_c, 4, "t2:c"); in test_fentry() 40 ASSERT_EQ(skel->bss->t3_a, 1, "t3:a"); in test_fentry() 41 ASSERT_EQ(skel->bss->t3_b, 4, "t3:b"); in test_fentry() 56 tracing_struct__detach(skel); in test_fentry() [all …]
|
A D | find_vma.c | 19 skel->bss->found_vm_exec = 0; in test_and_reset_skel() 20 skel->data->find_addr_ret = -1; in test_and_reset_skel() 21 skel->data->find_zero_ret = -1; in test_and_reset_skel() 22 skel->bss->d_iname[0] = 0; in test_and_reset_skel() 84 err = find_vma__attach(skel); in test_find_vma_kprobe() 94 struct find_vma_fail1 *skel; in test_illegal_write_vma() local 103 struct find_vma_fail2 *skel; in test_illegal_write_task() local 112 struct find_vma *skel; in serial_test_find_vma() local 121 test_find_vma_pe(skel); in serial_test_find_vma() 122 test_find_vma_kprobe(skel); in serial_test_find_vma() [all …]
|
A D | btf_tag.c | 17 struct test_btf_decl_tag *skel; in test_btf_decl_tag() local 23 if (skel->rodata->skip_tests) { in test_btf_decl_tag() 28 test_btf_decl_tag__destroy(skel); in test_btf_decl_tag() 33 struct btf_type_tag *skel; in test_btf_type_tag() local 39 if (skel->rodata->skip_tests) { in test_btf_type_tag() 44 btf_type_tag__destroy(skel); in test_btf_type_tag() 113 struct btf_type_tag_user *skel; in test_btf_type_tag_mod_user() local 119 skel = btf_type_tag_user__open(); in test_btf_type_tag_mod_user() 132 btf_type_tag_user__destroy(skel); in test_btf_type_tag_mod_user() 141 struct btf_type_tag_user *skel; in test_btf_type_tag_vmlinux_user() local [all …]
|
A D | check_mtu.c | 121 test_check_mtu_run_xdp(skel, skel->progs.xdp_use_helper, mtu); in test_check_mtu_xdp() 122 test_check_mtu_run_xdp(skel, skel->progs.xdp_exceed_mtu, mtu); in test_check_mtu_xdp() 123 test_check_mtu_run_xdp(skel, skel->progs.xdp_minus_delta, mtu); in test_check_mtu_xdp() 124 test_check_mtu_run_xdp(skel, skel->progs.xdp_input_len, mtu); in test_check_mtu_xdp() 125 test_check_mtu_run_xdp(skel, skel->progs.xdp_input_len_exceed, mtu); in test_check_mtu_xdp() 174 test_check_mtu_run_tc(skel, skel->progs.tc_use_helper, mtu); in test_check_mtu_tc() 175 test_check_mtu_run_tc(skel, skel->progs.tc_exceed_mtu, mtu); in test_check_mtu_tc() 176 test_check_mtu_run_tc(skel, skel->progs.tc_exceed_mtu_da, mtu); in test_check_mtu_tc() 177 test_check_mtu_run_tc(skel, skel->progs.tc_minus_delta, mtu); in test_check_mtu_tc() 178 test_check_mtu_run_tc(skel, skel->progs.tc_input_len, mtu); in test_check_mtu_tc() [all …]
|
A D | rcu_read_lock.c | 17 struct rcu_read_lock *skel; in test_success() local 20 skel = rcu_read_lock__open(); in test_success() 32 err = rcu_read_lock__load(skel); in test_success() 45 rcu_read_lock__destroy(skel); in test_success() 50 struct rcu_read_lock *skel; in test_rcuptr_acquire() local 53 skel = rcu_read_lock__open(); in test_rcuptr_acquire() 67 rcu_read_lock__destroy(skel); in test_rcuptr_acquire() 81 struct rcu_read_lock *skel; in test_inproper_region() local 86 skel = rcu_read_lock__open(); in test_inproper_region() 97 rcu_read_lock__destroy(skel); in test_inproper_region() [all …]
|
A D | bpf_cookie.c | 114 skel->bss->pid = getpid(); in kprobe_multi_link_api_subtest() 198 skel->bss->pid = getpid(); in kprobe_multi_attach_api_subtest() 328 skel->bss->tp_res = 0; in tp_subtest() 400 skel->bss->pe_res = 0; in pe_subtest() 477 skel->bss->lsm_res = 0; in lsm_subtest() 511 kprobe_subtest(skel); in test_bpf_cookie() 517 uprobe_subtest(skel); in test_bpf_cookie() 519 tp_subtest(skel); in test_bpf_cookie() 521 pe_subtest(skel); in test_bpf_cookie() 523 tracing_subtest(skel); in test_bpf_cookie() [all …]
|
A D | test_bpf_syscall_macro.c | 11 struct bpf_syscall_macro *skel = NULL; in test_bpf_syscall_macro() local 22 skel = bpf_syscall_macro__open(); in test_bpf_syscall_macro() 23 if (!ASSERT_OK_PTR(skel, "bpf_syscall_macro__open")) in test_bpf_syscall_macro() 26 skel->rodata->filter_pid = getpid(); in test_bpf_syscall_macro() 29 err = bpf_syscall_macro__load(skel); in test_bpf_syscall_macro() 34 err = bpf_syscall_macro__attach(skel); in test_bpf_syscall_macro() 44 ASSERT_EQ(skel->bss->arg1, exp_arg1, "syscall_arg1"); in test_bpf_syscall_macro() 46 ASSERT_EQ(skel->bss->arg2, exp_arg2, "syscall_arg2"); in test_bpf_syscall_macro() 47 ASSERT_EQ(skel->bss->arg3, exp_arg3, "syscall_arg3"); in test_bpf_syscall_macro() 54 ASSERT_EQ(skel->bss->arg4, exp_arg4, "syscall_arg4"); in test_bpf_syscall_macro() [all …]
|
A D | type_cast.c | 9 struct type_cast *skel; in test_xdp() local 21 skel = type_cast__open(); in test_xdp() 26 err = type_cast__load(skel); in test_xdp() 36 ASSERT_EQ(skel->bss->ifindex, skel->bss->ingress_ifindex, "xdp_md ingress_ifindex"); in test_xdp() 41 type_cast__destroy(skel); in test_xdp() 46 struct type_cast *skel; in test_tc() local 55 skel = type_cast__open(); in test_tc() 73 ASSERT_EQ(skel->bss->kskb_len, skel->bss->kskb2_len, "skb len compare"); in test_tc() 76 type_cast__destroy(skel); in test_tc() 87 struct type_cast *skel; in test_negative() local [all …]
|
A D | task_local_storage.c | 19 struct task_local_storage *skel; in test_sys_enter_exit() local 28 err = task_local_storage__attach(skel); in test_sys_enter_exit() 40 task_local_storage__destroy(skel); in test_sys_enter_exit() 83 struct task_ls_recursion *skel; in test_recursion() local 96 err = task_ls_recursion__attach(skel); in test_recursion() 101 skel->bss->test_pid = getpid(); in test_recursion() 103 skel->bss->test_pid = 0; in test_recursion() 104 task_ls_recursion__detach(skel); in test_recursion() 140 task_ls_recursion__destroy(skel); in test_recursion() 162 if (skel->bss->nr_get_errs || skel->bss->nr_del_errs) in sock_create_loop() [all …]
|
A D | user_ringbuf.c | 72 struct user_ringbuf_success *skel; in open_load_ringbuf_skel() local 75 skel = user_ringbuf_success__open(); in open_load_ringbuf_skel() 91 return skel; in open_load_ringbuf_skel() 103 struct user_ringbuf_success *skel; in test_user_ringbuf_mappings() local 105 skel = open_load_ringbuf_skel(); in test_user_ringbuf_mappings() 106 if (!skel) in test_user_ringbuf_mappings() 146 struct user_ringbuf_success *skel; in load_skel_create_ringbufs() local 151 skel = open_load_ringbuf_skel(); in load_skel_create_ringbufs() 152 if (!skel) in load_skel_create_ringbufs() 156 skel->bss->pid = getpid(); in load_skel_create_ringbufs() [all …]
|
A D | snprintf.c | 40 struct test_snprintf *skel; in test_snprintf_positive() local 42 skel = test_snprintf__open_and_load(); in test_snprintf_positive() 43 if (!ASSERT_OK_PTR(skel, "skel_open")) in test_snprintf_positive() 46 skel->bss->pid = getpid(); in test_snprintf_positive() 60 ASSERT_OK(memcmp(skel->bss->sym_out, exp_sym_out, in test_snprintf_positive() 83 test_snprintf__destroy(skel); in test_snprintf_positive() 89 struct test_snprintf_single *skel; in load_single_snprintf() local 92 skel = test_snprintf_single__open(); in load_single_snprintf() 93 if (!skel) in load_single_snprintf() 98 ret = test_snprintf_single__load(skel); in load_single_snprintf() [all …]
|
A D | btf_skc_cls_ingress.c | 60 memset(&skel->bss->srv_sa6, 0, sizeof(skel->bss->srv_sa6)); in reset_test() 64 skel->bss->gen_cookie = 0; in reset_test() 65 skel->bss->linum = 0; in reset_test() 70 if (skel->bss->linum) in print_err_line() 106 skel->bss->listen_tp_sport, skel->bss->req_sk_sport, in test_conn() 110 if (CHECK(skel->bss->gen_cookie || skel->bss->recv_cookie, in test_conn() 113 skel->bss->gen_cookie, skel->bss->recv_cookie)) in test_conn() 117 skel->bss->linum); in test_conn() 170 skel->bss->gen_cookie != skel->bss->recv_cookie, in test_syncookie() 173 skel->bss->gen_cookie, skel->bss->recv_cookie)) in test_syncookie() [all …]
|
A D | uprobe_autoattach.c | 20 struct test_uprobe_autoattach *skel; in test_uprobe_autoattach() local 25 if (!ASSERT_OK_PTR(skel, "skel_open")) in test_uprobe_autoattach() 31 skel->bss->test_pid = getpid(); in test_uprobe_autoattach() 36 skel->bss->test_pid = getpid(); in test_uprobe_autoattach() 53 ASSERT_EQ(skel->bss->a[0], 1, "arg1"); in test_uprobe_autoattach() 54 ASSERT_EQ(skel->bss->a[1], 2, "arg2"); in test_uprobe_autoattach() 55 ASSERT_EQ(skel->bss->a[2], 3, "arg3"); in test_uprobe_autoattach() 57 ASSERT_EQ(skel->bss->a[3], 4, "arg4"); in test_uprobe_autoattach() 60 ASSERT_EQ(skel->bss->a[4], 5, "arg5"); in test_uprobe_autoattach() 63 ASSERT_EQ(skel->bss->a[5], 6, "arg6"); in test_uprobe_autoattach() [all …]
|
A D | for_each.c | 14 struct for_each_hash_map_elem *skel; in test_hash_map() local 25 skel = for_each_hash_map_elem__open_and_load(); in test_hash_map() 67 ASSERT_LT(skel->bss->cpu, num_cpus, "num_cpus"); in test_hash_map() 70 ASSERT_EQ(skel->bss->percpu_val, skel->bss->cpu + 1, "percpu_val"); in test_hash_map() 74 for_each_hash_map_elem__destroy(skel); in test_hash_map() 81 struct for_each_array_map_elem *skel; in test_array_map() local 91 skel = for_each_array_map_elem__open_and_load(); in test_array_map() 130 ASSERT_EQ(skel->bss->cpu + 1, skel->bss->percpu_val, "percpu_val"); in test_array_map() 134 for_each_array_map_elem__destroy(skel); in test_array_map() 139 struct for_each_map_elem_write_key *skel; in test_write_map_key() local [all …]
|
/linux-6.3-rc2/kernel/bpf/preload/iterators/ |
A D | iterators.lskel-little-endian.h | 66 if (!skel) in iterators_bpf__destroy() 71 skel_free_map_data(skel->rodata, skel->maps.rodata.initial_value, 4096); in iterators_bpf__destroy() 73 skel_free(skel); in iterators_bpf__destroy() 80 skel = skel_alloc(sizeof(*skel)); in iterators_bpf__open() 81 if (!skel) in iterators_bpf__open() 83 skel->ctx.sz = (void *)&skel->links - (void *)skel; in iterators_bpf__open() 90 if (!skel->rodata) in iterators_bpf__open() 92 skel->maps.rodata.initial_value = (__u64) (long) skel->rodata; in iterators_bpf__open() 93 return skel; in iterators_bpf__open() 416 if (!skel) in iterators_bpf__open_and_load() [all …]
|
A D | iterators.lskel-big-endian.h | 64 if (!skel) in iterators_bpf__destroy() 66 iterators_bpf__detach(skel); in iterators_bpf__destroy() 70 skel_free(skel); in iterators_bpf__destroy() 75 struct iterators_bpf *skel; in iterators_bpf__open() local 77 skel = skel_alloc(sizeof(*skel)); in iterators_bpf__open() 78 if (!skel) in iterators_bpf__open() 80 skel->ctx.sz = (void *)&skel->links - (void *)skel; in iterators_bpf__open() 81 return skel; in iterators_bpf__open() 83 iterators_bpf__destroy(skel); in iterators_bpf__open() 399 if (!skel) in iterators_bpf__open_and_load() [all …]
|
/linux-6.3-rc2/samples/v4l/ |
A D | v4l2-pci-skeleton.c | 159 skel->field = skel->format.field; in queue_setup() 403 if (skel->input) in skeleton_s_std() 423 skel->std = std; in skeleton_s_std() 426 skeleton_fill_pix_format(skel, &skel->format); in skeleton_s_std() 435 if (skel->input) in skeleton_g_std() 454 if (skel->input) in skeleton_querystd() 511 skeleton_fill_pix_format(skel, &skel->format); in skeleton_s_dv_timings() 624 skel->input = i; in skeleton_s_input() 633 skeleton_fill_pix_format(skel, &skel->format); in skeleton_s_input() 765 if (!skel) { in skeleton_probe() [all …]
|
/linux-6.3-rc2/drivers/hid/bpf/entrypoints/ |
A D | entrypoints.lskel.h | 49 if (!skel) in entrypoints_bpf__destroy() 51 entrypoints_bpf__detach(skel); in entrypoints_bpf__destroy() 54 skel_free(skel); in entrypoints_bpf__destroy() 59 struct entrypoints_bpf *skel; in entrypoints_bpf__open() local 61 skel = skel_alloc(sizeof(*skel)); in entrypoints_bpf__open() 62 if (!skel) in entrypoints_bpf__open() 64 skel->ctx.sz = (void *)&skel->links - (void *)skel; in entrypoints_bpf__open() 65 return skel; in entrypoints_bpf__open() 67 entrypoints_bpf__destroy(skel); in entrypoints_bpf__open() 228 if (!skel) in entrypoints_bpf__open_and_load() [all …]
|
/linux-6.3-rc2/tools/testing/selftests/bpf/ |
A D | test_cpp.cpp | 14 T *skel; member in Skeleton 16 Skeleton(): skel(nullptr) { } in Skeleton() 18 ~Skeleton() { if (skel) T::destroy(skel); } in ~Skeleton() 24 if (skel) in open() 27 skel = T::open(opts); in open() 30 skel = nullptr; in open() 61 err = skel.open(&opts); in try_skeleton_template() 68 skel->data->int_val = skel->data->ushort_val; in try_skeleton_template() 70 err = skel.load(); in try_skeleton_template() 79 err = skel.attach(); in try_skeleton_template() [all …]
|