/linux-master/tools/testing/selftests/bpf/prog_tests/ |
H A D | core_kern_overflow.c | 8 struct core_kern_overflow_lskel *skel; local 10 skel = core_kern_overflow_lskel__open_and_load(); 11 if (!ASSERT_NULL(skel, "open_and_load")) 12 core_kern_overflow_lskel__destroy(skel);
|
H A D | xdpwall.c | 5 #include "xdpwall.skel.h" 9 struct xdpwall *skel; local 11 skel = xdpwall__open_and_load(); 12 ASSERT_OK_PTR(skel, "Does LLVM have https://github.com/llvm/llvm-project/commit/ea72b0319d7b0f0c2fcf41d121afa5d031b319d5?"); 14 xdpwall__destroy(skel);
|
H A D | atomic_bounds.c | 5 #include "atomic_bounds.skel.h" 9 struct atomic_bounds *skel; local 12 skel = atomic_bounds__open_and_load(); 13 if (CHECK(!skel, "skel_load", "couldn't load program\n")) 16 atomic_bounds__destroy(skel);
|
H A D | access_variable_array.c | 5 #include "test_access_variable_array.skel.h" 9 struct test_access_variable_array *skel; local 11 skel = test_access_variable_array__open_and_load(); 12 if (!ASSERT_OK_PTR(skel, "test_access_variable_array__open_and_load")) 15 test_access_variable_array__destroy(skel);
|
H A D | core_kern.c | 9 struct core_kern_lskel *skel; local 12 skel = core_kern_lskel__open_and_load(); 13 if (!ASSERT_OK_PTR(skel, "open_and_load")) 16 link_fd = core_kern_lskel__core_relo_proto__attach(skel); 22 ASSERT_TRUE(skel->bss->proto_out[0], "bpf_core_type_exists"); 23 ASSERT_FALSE(skel->bss->proto_out[1], "!bpf_core_type_exists"); 24 ASSERT_TRUE(skel->bss->proto_out[2], "bpf_core_type_exists. nested"); 27 core_kern_lskel__destroy(skel);
|
H A D | test_struct_ops_maybe_null.c | 5 #include "struct_ops_maybe_null.skel.h" 6 #include "struct_ops_maybe_null_fail.skel.h" 13 struct struct_ops_maybe_null *skel; local 15 skel = struct_ops_maybe_null__open_and_load(); 16 if (!ASSERT_OK_PTR(skel, "struct_ops_module_open_and_load")) 19 struct_ops_maybe_null__destroy(skel); 27 struct struct_ops_maybe_null_fail *skel; local 29 skel = struct_ops_maybe_null_fail__open_and_load(); 30 if (ASSERT_ERR_PTR(skel, "struct_ops_module_fail__open_and_load")) 33 struct_ops_maybe_null_fail__destroy(skel); [all...] |
H A D | stack_var_off.c | 3 #include "test_stack_var_off.skel.h" 11 struct test_stack_var_off *skel; local 13 skel = test_stack_var_off__open_and_load(); 14 if (CHECK(!skel, "skel_open", "failed to open skeleton\n")) 18 skel->bss->test_pid = getpid(); 20 skel->bss->input[0] = 2; 21 skel->bss->input[1] = 42; /* This will be returned in probe_res. */ 23 if (!ASSERT_OK(test_stack_var_off__attach(skel), "skel_attach")) 29 if (CHECK(skel->bss->probe_res != 42, "check_probe_res", 30 "wrong probe res: %d\n", skel [all...] |
H A D | static_linked.c | 5 #include "test_static_linked.skel.h" 10 struct test_static_linked* skel; local 12 skel = test_static_linked__open(); 13 if (!ASSERT_OK_PTR(skel, "skel_open")) 16 skel->rodata->rovar1 = 1; 17 skel->rodata->rovar2 = 4; 19 err = test_static_linked__load(skel); 23 err = test_static_linked__attach(skel); 30 ASSERT_EQ(skel->data->var1, 1 * 2 + 2 + 3, "var1"); 31 ASSERT_EQ(skel [all...] |
H A D | prog_array_init.c | 5 #include "test_prog_array_init.skel.h" 9 struct test_prog_array_init *skel; local 12 skel = test_prog_array_init__open(); 13 if (!ASSERT_OK_PTR(skel, "could not open BPF object")) 16 skel->rodata->my_pid = getpid(); 18 err = test_prog_array_init__load(skel); 22 skel->links.entry = bpf_program__attach_raw_tracepoint(skel->progs.entry, "sys_enter"); 23 if (!ASSERT_OK_PTR(skel->links.entry, "could not attach BPF program")) 28 ASSERT_EQ(skel [all...] |
H A D | autoattach.c | 5 #include "test_autoattach.skel.h" 9 struct test_autoattach *skel; local 11 skel = test_autoattach__open_and_load(); 12 if (!ASSERT_OK_PTR(skel, "skel_open_and_load")) 16 bpf_program__set_autoattach(skel->progs.prog2, false); 17 ASSERT_TRUE(bpf_program__autoattach(skel->progs.prog1), "autoattach_prog1"); 18 ASSERT_FALSE(bpf_program__autoattach(skel->progs.prog2), "autoattach_prog2"); 19 if (!ASSERT_OK(test_autoattach__attach(skel), "skel_attach")) 24 ASSERT_TRUE(skel->bss->prog1_called, "attached_prog1"); 25 ASSERT_FALSE(skel [all...] |
H A D | tracing_struct.c | 5 #include "tracing_struct.skel.h" 9 struct tracing_struct *skel; local 12 skel = tracing_struct__open_and_load(); 13 if (!ASSERT_OK_PTR(skel, "tracing_struct__open_and_load")) 16 err = tracing_struct__attach(skel); 22 ASSERT_EQ(skel->bss->t1_a_a, 2, "t1:a.a"); 23 ASSERT_EQ(skel->bss->t1_a_b, 3, "t1:a.b"); 24 ASSERT_EQ(skel->bss->t1_b, 1, "t1:b"); 25 ASSERT_EQ(skel->bss->t1_c, 4, "t1:c"); 27 ASSERT_EQ(skel [all...] |
H A D | subprogs_extable.c | 4 #include "test_subprogs_extable.skel.h" 9 struct test_subprogs_extable *skel; local 12 skel = test_subprogs_extable__open_and_load(); 13 if (!ASSERT_OK_PTR(skel, "skel_open_and_load")) 16 err = test_subprogs_extable__attach(skel); 23 ASSERT_NEQ(skel->bss->triggered, 0, "verify at least one program ran"); 25 test_subprogs_extable__detach(skel); 28 test_subprogs_extable__destroy(skel);
|
H A D | autoload.c | 6 #include "test_autoload.skel.h" 11 struct test_autoload* skel; local 13 skel = test_autoload__open_and_load(); 15 if (CHECK(skel, "skel_open_and_load", "unexpected success\n")) 18 skel = test_autoload__open(); 19 if (CHECK(!skel, "skel_open", "failed to open skeleton\n")) 23 bpf_program__set_autoload(skel->progs.prog3, false); 25 err = test_autoload__load(skel); 29 err = test_autoload__attach(skel); 35 CHECK(!skel [all...] |
H A D | test_strncmp.c | 4 #include "strncmp_test.skel.h" 6 static int trigger_strncmp(const struct strncmp_test *skel) argument 12 cmp = skel->bss->cmp_ret; 24 static void strncmp_full_str_cmp(struct strncmp_test *skel, const char *name, argument 27 size_t nr = sizeof(skel->bss->str); 28 char *str = skel->bss->str; 33 memcpy(str, skel->rodata->target, nr); 37 got = trigger_strncmp(skel); 46 struct strncmp_test *skel; local 49 skel 89 struct strncmp_test *skel; local 106 struct strncmp_test *skel; local 123 struct strncmp_test *skel; local [all...] |
H A D | linked_funcs.c | 6 #include "linked_funcs.skel.h" 11 struct linked_funcs *skel; local 13 skel = linked_funcs__open(); 14 if (!ASSERT_OK_PTR(skel, "skel_open")) 20 bpf_program__set_autoload(skel->progs.handler1, true); 21 bpf_program__set_autoload(skel->progs.handler2, true); 23 skel->rodata->my_tid = syscall(SYS_gettid); 24 skel->bss->syscall_id = SYS_getpgid; 26 err = linked_funcs__load(skel); 30 err = linked_funcs__attach(skel); [all...] |
H A D | ptr_untrusted.c | 7 #include "test_ptr_untrusted.skel.h" 13 struct test_ptr_untrusted *skel; local 16 skel = test_ptr_untrusted__open_and_load(); 17 if (!ASSERT_OK_PTR(skel, "skel_open")) 21 skel->links.lsm_run = bpf_program__attach_lsm(skel->progs.lsm_run); 22 if (!ASSERT_OK_PTR(skel->links.lsm_run, "lsm_attach")) 26 skel->links.raw_tp_run = bpf_program__attach_raw_tracepoint(skel->progs.raw_tp_run, 28 if (!ASSERT_OK_PTR(skel [all...] |
H A D | test_struct_ops_module.c | 6 #include "struct_ops_module.skel.h" 7 #include "struct_ops_nulled_out_cb.skel.h" 8 #include "struct_ops_forgotten_cb.skel.h" 35 static int attach_ops_and_check(struct struct_ops_module *skel, argument 47 ASSERT_EQ(skel->bss->test_1_result, 0xdeadbeef, "test_1_result"); 48 ASSERT_EQ(skel->bss->test_2_result, expected_test_2_result, "test_2_result"); 56 struct struct_ops_module *skel; local 61 skel = struct_ops_module__open(); 62 if (!ASSERT_OK_PTR(skel, "struct_ops_module_open")) 65 skel 101 struct struct_ops_module *skel; local 157 struct struct_ops_module *skel; local 182 struct struct_ops_nulled_out_cb *skel; local 208 struct struct_ops_forgotten_cb *skel; local [all...] |
H A D | linked_maps.c | 6 #include "linked_maps.skel.h" 11 struct linked_maps *skel; local 13 skel = linked_maps__open_and_load(); 14 if (!ASSERT_OK_PTR(skel, "skel_open")) 17 err = linked_maps__attach(skel); 24 ASSERT_EQ(skel->bss->output_first1, 2000, "output_first1"); 25 ASSERT_EQ(skel->bss->output_second1, 2, "output_second1"); 26 ASSERT_EQ(skel->bss->output_weak1, 2, "output_weak1"); 29 linked_maps__destroy(skel);
|
H A D | tracing_failure.c | 4 #include "tracing_failure.skel.h" 8 struct tracing_failure *skel; local 11 skel = tracing_failure__open(); 12 if (!ASSERT_OK_PTR(skel, "tracing_failure__open")) 16 bpf_program__set_autoload(skel->progs.test_spin_lock, true); 18 bpf_program__set_autoload(skel->progs.test_spin_unlock, true); 20 err = tracing_failure__load(skel); 24 err = tracing_failure__attach(skel); 28 tracing_failure__destroy(skel);
|
H A D | lru_bug.c | 4 #include "lru_bug.skel.h" 8 struct lru_bug *skel; local 11 skel = lru_bug__open_and_load(); 12 if (!ASSERT_OK_PTR(skel, "lru_bug__open_and_load")) 14 ret = lru_bug__attach(skel); 18 ASSERT_OK(skel->data->result, "prealloc_lru_pop doesn't call check_and_init_map_value"); 20 lru_bug__destroy(skel);
|
H A D | linked_vars.c | 6 #include "linked_vars.skel.h" 11 struct linked_vars *skel; local 13 skel = linked_vars__open(); 14 if (!ASSERT_OK_PTR(skel, "skel_open")) 17 skel->bss->input_bss1 = 1000; 18 skel->bss->input_bss2 = 2000; 19 skel->bss->input_bss_weak = 3000; 21 err = linked_vars__load(skel); 25 err = linked_vars__attach(skel); 32 ASSERT_EQ(skel [all...] |
H A D | rcu_read_lock.c | 10 #include "rcu_read_lock.skel.h" 17 struct rcu_read_lock *skel; local 20 skel = rcu_read_lock__open(); 21 if (!ASSERT_OK_PTR(skel, "skel_open")) 24 skel->bss->target_pid = syscall(SYS_gettid); 26 bpf_program__set_autoload(skel->progs.get_cgroup_id, true); 27 bpf_program__set_autoload(skel->progs.task_succ, true); 28 bpf_program__set_autoload(skel->progs.two_regions, true); 29 bpf_program__set_autoload(skel->progs.non_sleepable_1, true); 30 bpf_program__set_autoload(skel 54 struct rcu_read_lock *skel; local 88 struct rcu_read_lock *skel; local 115 struct rcu_read_lock *skel; local [all...] |
H A D | timer_crash.c | 3 #include "timer_crash.skel.h" 12 struct timer_crash *skel; local 14 skel = timer_crash__open_and_load(); 15 if (!ASSERT_OK_PTR(skel, "timer_crash__open_and_load")) 17 skel->bss->pid = getpid(); 18 skel->bss->crash_map = mode; 19 if (!ASSERT_OK(timer_crash__attach(skel), "timer_crash__attach")) 23 timer_crash__destroy(skel);
|
H A D | find_vma.c | 6 #include "find_vma.skel.h" 7 #include "find_vma_fail1.skel.h" 8 #include "find_vma_fail2.skel.h" 10 static void test_and_reset_skel(struct find_vma *skel, int expected_find_zero_ret, bool need_test) argument 13 ASSERT_EQ(skel->bss->found_vm_exec, 1, "found_vm_exec"); 14 ASSERT_EQ(skel->data->find_addr_ret, 0, "find_addr_ret"); 15 ASSERT_EQ(skel->data->find_zero_ret, expected_find_zero_ret, "find_zero_ret"); 16 ASSERT_OK_PTR(strstr(skel->bss->d_iname, "test_progs"), "find_test_progs"); 19 skel->bss->found_vm_exec = 0; 20 skel 41 find_vma_pe_condition(struct find_vma *skel) argument 49 test_find_vma_pe(struct find_vma *skel) argument 80 test_find_vma_kprobe(struct find_vma *skel) argument 94 struct find_vma_fail1 *skel; local 103 struct find_vma_fail2 *skel; local 112 struct find_vma *skel; local [all...] |
/linux-master/drivers/hid/bpf/entrypoints/ |
H A D | entrypoints.lskel.h | 22 entrypoints_bpf__hid_tail_call__attach(struct entrypoints_bpf *skel) argument 24 int prog_fd = skel->progs.hid_tail_call.prog_fd; 28 skel->links.hid_tail_call_fd = fd; 33 entrypoints_bpf__attach(struct entrypoints_bpf *skel) argument 37 ret = ret < 0 ? ret : entrypoints_bpf__hid_tail_call__attach(skel); 42 entrypoints_bpf__detach(struct entrypoints_bpf *skel) 44 skel_closenz(skel->links.hid_tail_call_fd); 47 entrypoints_bpf__destroy(struct entrypoints_bpf *skel) 49 if (!skel) 51 entrypoints_bpf__detach(skel); 59 struct entrypoints_bpf *skel; local 72 entrypoints_bpf__load(struct entrypoints_bpf *skel) argument 225 struct entrypoints_bpf *skel; local [all...] |