| /tools/testing/selftests/bpf/prog_tests/ |
| A D | tracing_struct.c | 23 ASSERT_EQ(skel->bss->t1_a_a, 2, "t1:a.a"); in test_struct_args() 25 ASSERT_EQ(skel->bss->t1_b, 1, "t1:b"); in test_struct_args() 26 ASSERT_EQ(skel->bss->t1_c, 4, "t1:c"); in test_struct_args() 35 ASSERT_EQ(skel->bss->t2_a, 1, "t2:a"); in test_struct_args() 38 ASSERT_EQ(skel->bss->t2_c, 4, "t2:c"); in test_struct_args() 41 ASSERT_EQ(skel->bss->t3_a, 1, "t3:a"); in test_struct_args() 42 ASSERT_EQ(skel->bss->t3_b, 4, "t3:b"); in test_struct_args() 48 ASSERT_EQ(skel->bss->t4_b, 1, "t4:b"); in test_struct_args() 49 ASSERT_EQ(skel->bss->t4_c, 2, "t4:c"); in test_struct_args() 50 ASSERT_EQ(skel->bss->t4_d, 3, "t4:d"); in test_struct_args() [all …]
|
| A D | usdt.c | 47 struct test_usdt__bss *bss; in subtest_basic_usdt() local 54 bss = skel->bss; in subtest_basic_usdt() 55 bss->my_pid = getpid(); in subtest_basic_usdt() 222 struct test_usdt__bss *bss; in subtest_multispec_usdt() local 229 bss = skel->bss; in subtest_multispec_usdt() 230 bss->my_pid = getpid(); in subtest_multispec_usdt() 259 bss->usdt_100_sum = 0; in subtest_multispec_usdt() 275 bss->usdt_100_called = 0; in subtest_multispec_usdt() 276 bss->usdt_100_sum = 0; in subtest_multispec_usdt() 366 bss = skel->bss; in subtest_urandom_usdt() [all …]
|
| A D | skeleton.c | 36 bss = skel->bss; in test_skeleton() 51 CHECK(bss->in3 != 0, "in3", "got %d != exp %d\n", bss->in3, 0); in test_skeleton() 52 CHECK(bss->out3 != 0, "out3", "got %d != exp %d\n", bss->out3, 0); in test_skeleton() 57 CHECK(bss->out6 != 0, "out6", "got %d != exp %d\n", bss->out6, 0); in test_skeleton() 68 bss->in3 = 12; in test_skeleton() 69 bss->in4 = 13; in test_skeleton() 83 CHECK(bss->in3 != 12, "in3", "got %d != exp %d\n", bss->in3, 12); in test_skeleton() 94 bss->in3 = 3; in test_skeleton() 95 bss->in4 = 4; in test_skeleton() 96 bss->in5.a = 5; in test_skeleton() [all …]
|
| A D | endian.c | 20 struct test_endian__bss *bss; in test_endian() local 26 bss = skel->bss; in test_endian() 28 bss->in16 = IN16; in test_endian() 29 bss->in32 = IN32; in test_endian() 30 bss->in64 = IN64; in test_endian() 39 (__u64)bss->out16, (__u64)OUT16); in test_endian() 41 (__u64)bss->out32, (__u64)OUT32); in test_endian() 43 (__u64)bss->out64, (__u64)OUT64); in test_endian() 46 (__u64)bss->const16, (__u64)OUT16); in test_endian() 48 (__u64)bss->const32, (__u64)OUT32); in test_endian() [all …]
|
| A D | test_bpf_syscall_macro.c | 41 ASSERT_EQ(skel->bss->arg1, exp_arg1, "syscall_arg1"); in test_bpf_syscall_macro() 42 ASSERT_EQ(skel->bss->arg2, exp_arg2, "syscall_arg2"); in test_bpf_syscall_macro() 43 ASSERT_EQ(skel->bss->arg3, exp_arg3, "syscall_arg3"); in test_bpf_syscall_macro() 46 ASSERT_NEQ(skel->bss->arg4_cx, exp_arg4, "syscall_arg4_from_cx"); in test_bpf_syscall_macro() 48 ASSERT_EQ(skel->bss->arg4_cx, exp_arg4, "syscall_arg4_from_cx"); in test_bpf_syscall_macro() 50 ASSERT_EQ(skel->bss->arg4, exp_arg4, "syscall_arg4"); in test_bpf_syscall_macro() 51 ASSERT_EQ(skel->bss->arg5, exp_arg5, "syscall_arg5"); in test_bpf_syscall_macro() 77 ASSERT_EQ(skel->bss->splice_fd_in, -42, "splice_arg1"); in test_bpf_syscall_macro() 78 ASSERT_EQ(skel->bss->splice_off_in, (__u64)&off_in, "splice_arg2"); in test_bpf_syscall_macro() 79 ASSERT_EQ(skel->bss->splice_fd_out, 42, "splice_arg3"); in test_bpf_syscall_macro() [all …]
|
| A D | uprobe_autoattach.c | 30 skel->bss->test_pid = getpid(); in test_uprobe_autoattach() 35 skel->bss->test_pid = getpid(); in test_uprobe_autoattach() 48 ASSERT_EQ(skel->bss->uretprobe_byname2_rc, (__u64)(long)devnull, in test_uprobe_autoattach() 52 ASSERT_EQ(skel->bss->a[0], 1, "arg1"); in test_uprobe_autoattach() 53 ASSERT_EQ(skel->bss->a[1], 2, "arg2"); in test_uprobe_autoattach() 54 ASSERT_EQ(skel->bss->a[2], 3, "arg3"); in test_uprobe_autoattach() 56 ASSERT_EQ(skel->bss->a[3], 4, "arg4"); in test_uprobe_autoattach() 59 ASSERT_EQ(skel->bss->a[4], 5, "arg5"); in test_uprobe_autoattach() 62 ASSERT_EQ(skel->bss->a[5], 6, "arg6"); in test_uprobe_autoattach() 65 ASSERT_EQ(skel->bss->a[6], 7, "arg7"); in test_uprobe_autoattach() [all …]
|
| A D | test_ima.c | 59 bss->use_ima_file_hash = false; in test_init() 61 bss->enable_kernel_read_file = false; in test_init() 62 bss->test_deny = false; in test_init() 103 test_init(skel->bss); in test_test_ima() 117 test_init(skel->bss); in test_test_ima() 118 skel->bss->use_ima_file_hash = true; in test_test_ima() 142 test_init(skel->bss); in test_test_ima() 174 test_init(skel->bss); in test_test_ima() 204 test_init(skel->bss); in test_test_ima() 222 test_init(skel->bss); in test_test_ima() [all …]
|
| A D | setget_sockopt.c | 44 struct setget_sockopt__bss *bss = skel->bss; in test_tcp() local 47 memset(bss, 0, sizeof(*bss)); in test_tcp() 62 ASSERT_EQ(bss->nr_listen, 1, "nr_listen"); in test_tcp() 67 ASSERT_EQ(bss->nr_binddev, 2, "nr_bind"); in test_tcp() 72 struct setget_sockopt__bss *bss = skel->bss; in test_udp() local 75 memset(bss, 0, sizeof(*bss)); in test_udp() 84 ASSERT_EQ(bss->nr_binddev, 1, "nr_bind"); in test_udp() 90 struct setget_sockopt__bss *bss = skel->bss; in test_ktls() local 94 memset(bss, 0, sizeof(*bss)); in test_ktls() 159 struct setget_sockopt__bss *bss = skel->bss; in test_nonstandard_opt() local [all …]
|
| A D | link_pinning.c | 12 struct test_link_pinning__bss *bss) in test_link_pinning_subtest() argument 23 bss->in = 1; in test_link_pinning_subtest() 25 CHECK(bss->out != 1, "res_check1", "exp %d, got %d\n", 1, bss->out); in test_link_pinning_subtest() 40 bss->in = 2; in test_link_pinning_subtest() 42 CHECK(bss->out != 2, "res_check2", "exp %d, got %d\n", 2, bss->out); in test_link_pinning_subtest() 48 bss->in = 3; in test_link_pinning_subtest() 50 CHECK(bss->out != 3, "res_check3", "exp %d, got %d\n", 3, bss->out); in test_link_pinning_subtest() 66 bss->in = 4; in test_link_pinning_subtest() 68 CHECK(bss->out != 4, "res_check4", "exp %d, got %d\n", 4, bss->out); in test_link_pinning_subtest() 79 bss->in = i; in test_link_pinning_subtest() [all …]
|
| A D | core_read_macros.c | 27 struct test_core_read_macros__bss *bss; in test_core_read_macros() local 34 bss = skel->bss; in test_core_read_macros() 35 bss->my_pid = getpid(); in test_core_read_macros() 38 bss->k_probe_in.func = (void *)(long)0x1234; in test_core_read_macros() 39 bss->k_core_in.func = (void *)(long)0xabcd; in test_core_read_macros() 43 bss->u_probe_in = &u_probe_in; in test_core_read_macros() 47 bss->u_core_in = &u_core_in; in test_core_read_macros() 56 ASSERT_EQ(bss->k_probe_out, 0x1234, "k_probe_out"); in test_core_read_macros() 57 ASSERT_EQ(bss->k_core_out, 0xabcd, "k_core_out"); in test_core_read_macros() 59 ASSERT_EQ(bss->u_probe_out, 0x5678, "u_probe_out"); in test_core_read_macros() [all …]
|
| A D | map_ops.c | 84 ASSERT_OK(skel->bss->err, "map_update_initial"); in map_ops_update_delete_subtest() 87 ASSERT_LT(skel->bss->err, 0, "map_update_existing"); in map_ops_update_delete_subtest() 91 ASSERT_OK(skel->bss->err, "map_delete_existing"); in map_ops_update_delete_subtest() 94 ASSERT_LT(skel->bss->err, 0, "map_delete_non_existing"); in map_ops_update_delete_subtest() 109 ASSERT_OK(skel->bss->err, "map_push_initial"); in map_ops_push_peek_pop_subtest() 112 ASSERT_LT(skel->bss->err, 0, "map_push_when_full"); in map_ops_push_peek_pop_subtest() 116 ASSERT_OK(skel->bss->err, "map_peek"); in map_ops_push_peek_pop_subtest() 119 ASSERT_OK(skel->bss->err, "map_pop"); in map_ops_push_peek_pop_subtest() 122 ASSERT_LT(skel->bss->err, 0, "map_peek_when_empty"); in map_ops_push_peek_pop_subtest() 126 ASSERT_LT(skel->bss->err, 0, "map_pop_when_empty"); in map_ops_push_peek_pop_subtest() [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() 52 skel->bss->nr_loops = 400; 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() 110 skel->bss->nr_loops = nr_loops; in check_nested_calls() 131 skel->bss->callback_selector = 0x0F; in check_non_constant_callback() [all …]
|
| A D | snprintf.c | 46 skel->bss->pid = getpid(); in test_snprintf_positive() 54 ASSERT_STREQ(skel->bss->num_out, EXP_NUM_OUT, "num_out"); in test_snprintf_positive() 55 ASSERT_EQ(skel->bss->num_ret, EXP_NUM_RET, "num_ret"); in test_snprintf_positive() 57 ASSERT_STREQ(skel->bss->ip_out, EXP_IP_OUT, "ip_out"); in test_snprintf_positive() 58 ASSERT_EQ(skel->bss->ip_ret, EXP_IP_RET, "ip_ret"); in test_snprintf_positive() 60 ASSERT_OK(memcmp(skel->bss->sym_out, exp_sym_out, in test_snprintf_positive() 62 ASSERT_LT(MIN_SYM_RET, skel->bss->sym_ret, "sym_ret"); in test_snprintf_positive() 64 ASSERT_OK(memcmp(skel->bss->addr_out, exp_addr_out, in test_snprintf_positive() 66 ASSERT_EQ(skel->bss->addr_ret, EXP_ADDR_RET, "addr_ret"); in test_snprintf_positive() 69 ASSERT_EQ(skel->bss->str_ret, EXP_STR_RET, "str_ret"); in test_snprintf_positive() [all …]
|
| A D | module_attach.c | 41 struct test_module_attach__bss *bss; in test_module_attach() local 62 bss = skel->bss; in test_module_attach() 72 ASSERT_EQ(bss->raw_tp_read_sz, READ_SZ, "raw_tp"); in test_module_attach() 74 ASSERT_EQ(bss->tp_btf_read_sz, READ_SZ, "tp_btf"); in test_module_attach() 75 ASSERT_EQ(bss->fentry_read_sz, READ_SZ, "fentry"); in test_module_attach() 79 ASSERT_EQ(bss->fexit_read_sz, READ_SZ, "fexit"); in test_module_attach() 80 ASSERT_EQ(bss->fexit_ret, -EIO, "fexit_tet"); in test_module_attach() 81 ASSERT_EQ(bss->fmod_ret_read_sz, READ_SZ, "fmod_ret"); in test_module_attach() 83 bss->raw_tp_writable_bare_early_ret = true; in test_module_attach() 84 bss->raw_tp_writable_bare_out_val = 0xf1f2f3f4; in test_module_attach() [all …]
|
| A D | snprintf_btf.c | 12 struct netif_receive_skb__bss *bss; in serial_test_snprintf_btf() local 23 bss = skel->bss; in serial_test_snprintf_btf() 34 if (bss->skip) { in serial_test_snprintf_btf() 45 if (!ASSERT_GT(bss->ret, 0, "bpf_snprintf_ret")) in serial_test_snprintf_btf() 48 if (CHECK(bss->ran_subtests == 0, "check if subtests ran", in serial_test_snprintf_btf() 52 if (CHECK(bss->num_subtests != bss->ran_subtests, in serial_test_snprintf_btf() 54 "only ran %d of %d tests\n", bss->num_subtests, in serial_test_snprintf_btf() 55 bss->ran_subtests)) in serial_test_snprintf_btf()
|
| A D | ringbuf.c | 71 skel->bss->dropped = 0; in trigger_samples() 72 skel->bss->total = 0; in trigger_samples() 73 skel->bss->discarded = 0; in trigger_samples() 76 skel->bss->value = 333; in trigger_samples() 78 skel->bss->value = 777; in trigger_samples() 124 skel->bss->discarded = 0; in ringbuf_write_subtest() 125 skel->bss->passed = 0; in ringbuf_write_subtest() 320 skel->bss->flags = 0; in ringbuf_subtest() 336 skel->bss->dropped = 0; in ringbuf_subtest() 337 skel->bss->total = 0; in ringbuf_subtest() [all …]
|
| A D | linked_vars.c | 17 skel->bss->input_bss1 = 1000; in test_linked_vars() 18 skel->bss->input_bss2 = 2000; in test_linked_vars() 19 skel->bss->input_bss_weak = 3000; in test_linked_vars() 32 ASSERT_EQ(skel->bss->output_bss1, 1000 + 2000 + 3000, "output_bss1"); in test_linked_vars() 33 ASSERT_EQ(skel->bss->output_bss2, 1000 + 2000 + 3000, "output_bss2"); in test_linked_vars() 35 ASSERT_EQ(skel->bss->output_data1, 1 + 2 + 10, "output_bss1"); in test_linked_vars() 36 ASSERT_EQ(skel->bss->output_data2, 1 + 2 + 10, "output_bss2"); in test_linked_vars() 38 ASSERT_EQ(skel->bss->output_rodata1, 11 + 22 + 100, "output_weak1"); in test_linked_vars() 39 ASSERT_EQ(skel->bss->output_rodata2, 11 + 22 + 100, "output_weak2"); in test_linked_vars()
|
| A D | ns_current_pid_tgid.c | 21 struct test_ns_current_pid_tgid__bss *bss) in get_pid_tgid() argument 33 bss->dev = st.st_dev; in get_pid_tgid() 34 bss->ino = st.st_ino; in get_pid_tgid() 35 bss->user_pid = 0; in get_pid_tgid() 36 bss->user_tgid = 0; in get_pid_tgid() 42 struct test_ns_current_pid_tgid__bss *bss; in test_current_pid_tgid_tp() local 57 bss = skel->bss; in test_current_pid_tgid_tp() 58 if (get_pid_tgid(&pid, &tgid, bss)) in test_current_pid_tgid_tp() 96 bss = skel->bss; in test_current_pid_tgid_cgrp() 97 if (get_pid_tgid(&pid, &tgid, bss)) in test_current_pid_tgid_cgrp() [all …]
|
| A D | cgroup1_hierarchy.c | 79 skel->bss->target_pid = getpid(); in test_cgroup1_hierarchy() 108 skel->bss->target_hid = hid; in test_cgroup1_hierarchy() 116 skel->bss->target_ancestor_cgid = 1; in test_cgroup1_hierarchy() 117 skel->bss->target_ancestor_level = 0; in test_cgroup1_hierarchy() 122 skel->bss->target_ancestor_cgid = 1; in test_cgroup1_hierarchy() 123 skel->bss->target_ancestor_level = 1; in test_cgroup1_hierarchy() 128 skel->bss->target_ancestor_cgid = 0; in test_cgroup1_hierarchy() 133 skel->bss->target_ancestor_cgid = 1; in test_cgroup1_hierarchy() 134 skel->bss->target_ancestor_level = 0; in test_cgroup1_hierarchy() 135 skel->bss->target_hid = -1; in test_cgroup1_hierarchy() [all …]
|
| A D | vmlinux.c | 21 struct test_vmlinux__bss *bss; in test_vmlinux() local 26 bss = skel->bss; in test_vmlinux() 35 ASSERT_TRUE(bss->tp_called, "tp"); in test_vmlinux() 36 ASSERT_TRUE(bss->raw_tp_called, "raw_tp"); in test_vmlinux() 37 ASSERT_TRUE(bss->tp_btf_called, "tp_btf"); in test_vmlinux() 38 ASSERT_TRUE(bss->kprobe_called, "kprobe"); in test_vmlinux() 39 ASSERT_TRUE(bss->fentry_called, "fentry"); in test_vmlinux()
|
| A D | varlen.c | 16 struct test_varlen__bss *bss; in test_varlen() local 27 bss = skel->bss; in test_varlen() 34 bss->test_pid = getpid(); in test_varlen() 37 memcpy(bss->buf_in1, str1, size1); in test_varlen() 38 memcpy(bss->buf_in2, str2, size2); in test_varlen() 39 bss->capture = true; in test_varlen() 41 bss->capture = false; in test_varlen() 43 CHECK_VAL(bss->payload1_len1, size1); in test_varlen() 44 CHECK_VAL(bss->payload1_len2, size2); in test_varlen() 45 CHECK_VAL(bss->total1, size1 + size2); in test_varlen() [all …]
|
| A D | d_path.c | 123 struct test_d_path__bss *bss; in test_d_path_basic() local 135 bss = skel->bss; in test_d_path_basic() 136 bss->my_pid = getpid(); in test_d_path_basic() 142 if (CHECK(!bss->called_stat, in test_d_path_basic() 147 if (CHECK(!bss->called_close, in test_d_path_basic() 162 CHECK(bss->rets_stat[i] != strlen(bss->paths_stat[i]) + 1, in test_d_path_basic() 165 i, bss->rets_stat[i], strlen(bss->paths_stat[i]) + 1, in test_d_path_basic() 166 bss->paths_stat[i]); in test_d_path_basic() 167 CHECK(bss->rets_close[i] != strlen(bss->paths_stat[i]) + 1, in test_d_path_basic() 170 i, bss->rets_close[i], strlen(bss->paths_close[i]) + 1, in test_d_path_basic() [all …]
|
| A D | btf_skc_cls_ingress.c | 69 memset(&skel->bss->srv_sa4, 0, sizeof(skel->bss->srv_sa4)); in reset_test() 70 memset(&skel->bss->srv_sa6, 0, sizeof(skel->bss->srv_sa6)); in reset_test() 71 skel->bss->listen_tp_sport = 0; in reset_test() 72 skel->bss->req_sk_sport = 0; in reset_test() 73 skel->bss->recv_cookie = 0; in reset_test() 74 skel->bss->gen_cookie = 0; in reset_test() 75 skel->bss->linum = 0; in reset_test() 76 skel->bss->mss = 0; in reset_test() 81 if (skel->bss->linum) in print_err_line() 178 ASSERT_EQ(skel->bss->gen_cookie, 0, in run_test() [all …]
|
| A D | rdonly_maps.c | 4 struct bss { struct 30 struct bss bss; in test_rdonly_maps() local 55 memset(&bss, 0, sizeof(bss)); in test_rdonly_maps() 56 err = bpf_map_update_elem(bpf_map__fd(bss_map), &zero, &bss, 0); in test_rdonly_maps() 70 err = bpf_map_lookup_elem(bpf_map__fd(bss_map), &zero, &bss); in test_rdonly_maps() 73 if (CHECK(bss.did_run == 0, "check_run", in test_rdonly_maps() 76 if (CHECK(bss.iters != t->exp_iters, "check_iters", in test_rdonly_maps() 78 t->prog_name, bss.iters, t->exp_iters)) in test_rdonly_maps() 80 if (CHECK(bss.sum != t->exp_sum, "check_sum", in test_rdonly_maps() 82 t->prog_name, bss.sum, t->exp_sum)) in test_rdonly_maps()
|
| /tools/sched_ext/ |
| A D | scx_qmap.c | 127 skel->bss->nr_reenqueued, skel->bss->nr_dequeued, in main() 128 skel->bss->nr_core_sched_execed, in main() 129 skel->bss->nr_ddsp_from_enq); in main() 131 skel->bss->nr_expedited_local, in main() 132 skel->bss->nr_expedited_remote, in main() 134 skel->bss->nr_expedited_lost); in main() 137 skel->bss->cpuperf_min, in main() 138 skel->bss->cpuperf_avg, in main() 139 skel->bss->cpuperf_max, in main() 140 skel->bss->cpuperf_target_min, in main() [all …]
|