Home
last modified time | relevance | path

Searched refs:CHECK (Results 1 – 25 of 87) sorted by relevance

1234

/Linux-v5.4/tools/testing/selftests/bpf/
Dtest_hashmap.c13 #define CHECK(condition, format...) ({ \ macro
62 if (CHECK(IS_ERR(map), "failed to create map: %ld\n", PTR_ERR(map))) in test_hashmap_generic()
70 if (CHECK(err != -ENOENT, "unexpected result: %d\n", err)) in test_hashmap_generic()
77 if (CHECK(oldk != NULL || oldv != NULL, in test_hashmap_generic()
82 if (CHECK(err, "failed to add k/v %ld = %ld: %d\n", in test_hashmap_generic()
86 if (CHECK(!hashmap__find(map, k, &oldv), in test_hashmap_generic()
89 if (CHECK(oldv != v, "found value is wrong: %ld\n", (long)oldv)) in test_hashmap_generic()
93 if (CHECK(hashmap__size(map) != ELEM_CNT, in test_hashmap_generic()
96 if (CHECK(hashmap__capacity(map) != exp_cap(hashmap__size(map)), in test_hashmap_generic()
106 if (CHECK(v - k != 1024, "invalid k/v pair: %ld = %ld\n", k, v)) in test_hashmap_generic()
[all …]
Dtest_sock_fields.c43 #define CHECK(condition, tag, format...) ({ \ macro
131 CHECK(err == -1, "bpf_map_lookup_elem(linum_map_fd)", in check_result()
136 CHECK(err == -1, "bpf_map_lookup_elem(linum_map_fd)", in check_result()
140 CHECK(err == -1, "bpf_map_lookup_elem(sk_map_fd, &egress_srv_idx)", in check_result()
143 CHECK(err == -1, "bpf_map_lookup_elem(tp_map_fd, &egress_srv_idx)", in check_result()
147 CHECK(err == -1, "bpf_map_lookup_elem(sk_map_fd, &egress_cli_idx)", in check_result()
150 CHECK(err == -1, "bpf_map_lookup_elem(tp_map_fd, &egress_cli_idx)", in check_result()
154 CHECK(err == -1, "bpf_map_lookup_elem(sk_map_fd, &ingress_listen_idx)", in check_result()
157 CHECK(err == -1, "bpf_map_lookup_elem(tp_map_fd, &ingress_listen_idx)", in check_result()
184 CHECK(listen_sk.state != 10 || in check_result()
[all …]
Dtest_select_reuseport.c49 #define CHECK(condition, tag, format...) ({ \ macro
70 CHECK(reuseport_array == -1, "creating reuseport_array", in create_maps()
81 CHECK(outer_map == -1, "creating outer_map", in create_maps()
96 CHECK(IS_ERR_OR_NULL(obj), "open test_select_reuseport_kern.o", in prepare_bpf_obj()
100 CHECK(!prog, "get first bpf_program", "!prog\n"); in prepare_bpf_obj()
104 CHECK(!map, "find outer_map", "!map\n"); in prepare_bpf_obj()
106 CHECK(err, "reuse outer_map", "err:%d\n", err); in prepare_bpf_obj()
109 CHECK(err, "load bpf_object", "err:%d\n", err); in prepare_bpf_obj()
112 CHECK(select_by_skb_data_prog == -1, "get prog fd", in prepare_bpf_obj()
116 CHECK(!map, "find result_map", "!map\n"); in prepare_bpf_obj()
[all …]
Dget_cgroup_id_user.c24 #define CHECK(condition, tag, format...) ({ \ macro
62 if (CHECK(err, "setup_cgroup_environment", "err %d errno %d\n", err, in main()
67 if (CHECK(cgroup_fd < 0, "create_and_get_cgroup", "err %d errno %d\n", in main()
72 if (CHECK(err, "join_cgroup", "err %d errno %d\n", err, errno)) in main()
76 if (CHECK(err, "bpf_prog_load", "err %d errno %d\n", err, errno)) in main()
80 if (CHECK(cgidmap_fd < 0, "bpf_find_map", "err %d errno %d\n", in main()
85 if (CHECK(pidmap_fd < 0, "bpf_find_map", "err %d errno %d\n", in main()
95 if (CHECK(efd < 0, "open", "err %d errno %d\n", efd, errno)) in main()
99 if (CHECK(bytes <= 0 || bytes >= sizeof(buf), "read", in main()
113 if (CHECK(pmu_fd < 0, "perf_event_open", "err %d errno %d\n", pmu_fd, in main()
[all …]
Dtest_btf_dump.c9 #define CHECK(condition, format...) ({ \ macro
70 if (CHECK(IS_ERR(btf), in test_btf_dump_case()
80 if (CHECK(fd < 0, "failed to create temp output file: %d\n", fd)) { in test_btf_dump_case()
85 if (CHECK(f == NULL, "failed to open temp output file: %s(%d)\n", in test_btf_dump_case()
95 if (CHECK(err, "failure during C dumping: %d\n", err)) { in test_btf_dump_case()
121 if (CHECK(err, in test_btf_dump_case()
/Linux-v5.4/lib/
Dpercpu_test.c5 #define CHECK(native, pcp, expected) \ macro
36 CHECK(l, long_counter, -1); in percpu_test_init()
40 CHECK(l, long_counter, 0); in percpu_test_init()
47 CHECK(ul, ulong_counter, 1); in percpu_test_init()
51 CHECK(ul, ulong_counter, 0); in percpu_test_init()
55 CHECK(ul, ulong_counter, -1); in percpu_test_init()
62 CHECK(ul, ulong_counter, -1); in percpu_test_init()
63 CHECK(ul, ulong_counter, ULONG_MAX); in percpu_test_init()
67 CHECK(l, long_counter, 0xffffffff); in percpu_test_init()
71 CHECK(l, long_counter, (long)0x100000000LL); in percpu_test_init()
[all …]
Dtest_bitfield.c102 #define CHECK(tp, mask) do { \ macro
112 CHECK(u8, 0x0f); in test_variables()
113 CHECK(u8, 0xf0); in test_variables()
114 CHECK(u8, 0x38); in test_variables()
116 CHECK(u16, 0x0038); in test_variables()
117 CHECK(u16, 0x0380); in test_variables()
118 CHECK(u16, 0x3800); in test_variables()
119 CHECK(u16, 0x8000); in test_variables()
121 CHECK(u32, 0x80000000); in test_variables()
122 CHECK(u32, 0x7f000000); in test_variables()
[all …]
/Linux-v5.4/tools/testing/selftests/bpf/prog_tests/
Dattach_probe.c46 if (CHECK(base_addr < 0, "get_base_addr", in test_attach_probe()
53 if (CHECK(err, "obj_load", "err %d errno %d\n", err, errno)) in test_attach_probe()
57 if (CHECK(!kprobe_prog, "find_probe", in test_attach_probe()
61 if (CHECK(!kretprobe_prog, "find_probe", in test_attach_probe()
65 if (CHECK(!uprobe_prog, "find_probe", in test_attach_probe()
69 if (CHECK(!uretprobe_prog, "find_probe", in test_attach_probe()
75 if (CHECK(results_map_fd < 0, "find_results_map", in test_attach_probe()
82 if (CHECK(IS_ERR(kprobe_link), "attach_kprobe", in test_attach_probe()
90 if (CHECK(IS_ERR(kretprobe_link), "attach_kretprobe", in test_attach_probe()
100 if (CHECK(IS_ERR(uprobe_link), "attach_uprobe", in test_attach_probe()
[all …]
Dstacktrace_build_id.c22 if (CHECK(err, "prog_load", "err %d errno %d\n", err, errno)) in test_stacktrace_build_id()
26 if (CHECK(!prog, "find_prog", "prog '%s' not found\n", prog_name)) in test_stacktrace_build_id()
30 if (CHECK(IS_ERR(link), "attach_tp", "err %ld\n", PTR_ERR(link))) in test_stacktrace_build_id()
35 if (CHECK(control_map_fd < 0, "bpf_find_map control_map", in test_stacktrace_build_id()
40 if (CHECK(stackid_hmap_fd < 0, "bpf_find_map stackid_hmap", in test_stacktrace_build_id()
45 if (CHECK(stackmap_fd < 0, "bpf_find_map stackmap", "err %d errno %d\n", in test_stacktrace_build_id()
50 if (CHECK(stack_amap_fd < 0, "bpf_find_map stack_amap", in test_stacktrace_build_id()
67 if (CHECK(err, "compare_map_keys stackid_hmap vs. stackmap", in test_stacktrace_build_id()
72 if (CHECK(err, "compare_map_keys stackmap vs. stackid_hmap", in test_stacktrace_build_id()
78 if (CHECK(err, "get build_id with readelf", in test_stacktrace_build_id()
[all …]
Dstacktrace_build_id_nmi.c42 if (CHECK(err, "prog_load", "err %d errno %d\n", err, errno)) in test_stacktrace_build_id_nmi()
46 if (CHECK(!prog, "find_prog", "prog '%s' not found\n", prog_name)) in test_stacktrace_build_id_nmi()
52 if (CHECK(pmu_fd < 0, "perf_event_open", in test_stacktrace_build_id_nmi()
58 if (CHECK(IS_ERR(link), "attach_perf_event", in test_stacktrace_build_id_nmi()
66 if (CHECK(control_map_fd < 0, "bpf_find_map control_map", in test_stacktrace_build_id_nmi()
71 if (CHECK(stackid_hmap_fd < 0, "bpf_find_map stackid_hmap", in test_stacktrace_build_id_nmi()
76 if (CHECK(stackmap_fd < 0, "bpf_find_map stackmap", "err %d errno %d\n", in test_stacktrace_build_id_nmi()
81 if (CHECK(stack_amap_fd < 0, "bpf_find_map stack_amap", in test_stacktrace_build_id_nmi()
98 if (CHECK(err, "compare_map_keys stackid_hmap vs. stackmap", in test_stacktrace_build_id_nmi()
103 if (CHECK(err, "compare_map_keys stackmap vs. stackid_hmap", in test_stacktrace_build_id_nmi()
[all …]
Dsend_signal.c24 if (CHECK(pipe(pipe_c2p), test_name, in test_send_signal_common()
28 if (CHECK(pipe(pipe_p2c), test_name, in test_send_signal_common()
36 if (CHECK(pid < 0, test_name, "fork error: %s\n", strerror(errno))) { in test_send_signal_common()
77 if (CHECK(err < 0, test_name, "bpf_prog_load error: %s\n", in test_send_signal_common()
83 if (CHECK(pmu_fd < 0, test_name, "perf_event_open error: %s\n", in test_send_signal_common()
90 if (CHECK(err < 0, test_name, "ioctl perf_event_ioc_enable error: %s\n", in test_send_signal_common()
95 if (CHECK(err < 0, test_name, "ioctl perf_event_ioc_set_bpf error: %s\n", in test_send_signal_common()
101 if (CHECK(info_map_fd < 0, test_name, "find map %s error\n", "info_map")) in test_send_signal_common()
105 if (CHECK(status_map_fd < 0, test_name, "find map %s error\n", "status_map")) in test_send_signal_common()
121 if (CHECK(err < 0, test_name, "reading pipe error: %s\n", strerror(errno))) in test_send_signal_common()
[all …]
Dperf_buffer.c14 CHECK(cpu_data != cpu, "check_cpu_data", in on_sample()
34 if (CHECK(nr_cpus < 0, "nr_cpus", "err %d\n", nr_cpus)) in test_perf_buffer()
39 if (CHECK(err, "obj_load", "err %d errno %d\n", err, errno)) in test_perf_buffer()
43 if (CHECK(!prog, "find_probe", "prog '%s' not found\n", prog_name)) in test_perf_buffer()
48 if (CHECK(!perf_buf_map, "find_perf_buf_map", "not found\n")) in test_perf_buffer()
54 if (CHECK(IS_ERR(link), "attach_kprobe", "err %ld\n", PTR_ERR(link))) in test_perf_buffer()
61 if (CHECK(IS_ERR(pb), "perf_buf__new", "err %ld\n", PTR_ERR(pb))) in test_perf_buffer()
72 if (err && CHECK(err, "set_affinity", "cpu #%d, err %d\n", in test_perf_buffer()
81 if (CHECK(err < 0, "perf_buffer__poll", "err %d\n", err)) in test_perf_buffer()
84 if (CHECK(CPU_COUNT(&cpu_seen) != nr_cpus, "seen_cpu_cnt", in test_perf_buffer()
Dtask_fd_query_rawtp.c15 if (CHECK(err, "prog_load raw tp", "err %d errno %d\n", err, errno)) in test_task_fd_query_rawtp()
19 if (CHECK(efd < 0, "raw_tp_open", "err %d errno %d\n", efd, errno)) in test_task_fd_query_rawtp()
26 if (CHECK(err < 0, "bpf_task_fd_query", "err %d errno %d\n", err, in test_task_fd_query_rawtp()
32 if (CHECK(!err, "check_results", "fd_type %d tp_name %s\n", in test_task_fd_query_rawtp()
40 if (CHECK(err < 0, "bpf_task_fd_query (len = 0)", "err %d errno %d\n", in test_task_fd_query_rawtp()
45 if (CHECK(!err, "check_results", "fd_type %d len %u\n", fd_type, len)) in test_task_fd_query_rawtp()
52 if (CHECK(err < 0, "bpf_task_fd_query (buf = 0)", "err %d errno %d\n", in test_task_fd_query_rawtp()
57 if (CHECK(!err, "check_results", "fd_type %d len %u\n", fd_type, len)) in test_task_fd_query_rawtp()
64 if (CHECK(err >= 0 || errno != ENOSPC, "bpf_task_fd_query (len = 3)", in test_task_fd_query_rawtp()
70 if (CHECK(!err, "check_results", "fd_type %d len %u\n", fd_type, len)) in test_task_fd_query_rawtp()
Dtp_attach_query.c22 if (CHECK(efd < 0, "open", "err %d errno %d\n", efd, errno)) in test_tp_attach_query()
26 if (CHECK(bytes <= 0 || bytes >= sizeof(buf), in test_tp_attach_query()
40 if (CHECK(err, "prog_load", "err %d errno %d\n", err, errno)) in test_tp_attach_query()
49 if (CHECK(err, "bpf_obj_get_info_by_fd", "err %d errno %d\n", in test_tp_attach_query()
57 if (CHECK(pmu_fd[i] < 0, "perf_event_open", "err %d errno %d\n", in test_tp_attach_query()
61 if (CHECK(err, "perf_event_ioc_enable", "err %d errno %d\n", in test_tp_attach_query()
69 if (CHECK(err || query->prog_cnt != 0, in test_tp_attach_query()
77 if (CHECK(err, "perf_event_ioc_set_bpf", "err %d errno %d\n", in test_tp_attach_query()
85 if (CHECK(err || query->prog_cnt != 2, in test_tp_attach_query()
95 if (CHECK(!err || errno != EFAULT, in test_tp_attach_query()
[all …]
Dget_stack_raw_tp.c77 CHECK(!good_kern_stack, "kern_stack", "corrupted kernel stack\n"); in get_stack_print_output()
79 CHECK(!good_user_stack, "user_stack", "corrupted user stack\n"); in get_stack_print_output()
97 if (CHECK(err, "prog_load raw tp", "err %d errno %d\n", err, errno)) in test_get_stack_raw_tp()
101 if (CHECK(!prog, "find_probe", "prog '%s' not found\n", prog_name)) in test_get_stack_raw_tp()
105 if (CHECK(!map, "bpf_find_map", "not found\n")) in test_get_stack_raw_tp()
109 if (CHECK(err < 0, "load_kallsyms", "err %d errno %d\n", err, errno)) in test_get_stack_raw_tp()
115 if (CHECK(err, "set_affinity", "err %d, errno %d\n", err, errno)) in test_get_stack_raw_tp()
119 if (CHECK(IS_ERR(link), "attach_raw_tp", "err %ld\n", PTR_ERR(link))) in test_get_stack_raw_tp()
124 if (CHECK(IS_ERR(pb), "perf_buf__new", "err %ld\n", PTR_ERR(pb))) in test_get_stack_raw_tp()
133 if (err < 0 && CHECK(err < 0, "pb__poll", "err %d\n", err)) in test_get_stack_raw_tp()
Dtask_fd_query_tp.c17 if (CHECK(err, "bpf_prog_load", "err %d errno %d\n", err, errno)) in test_task_fd_query_tp_core()
23 if (CHECK(efd < 0, "open", "err %d errno %d\n", efd, errno)) in test_task_fd_query_tp_core()
27 if (CHECK(bytes <= 0 || bytes >= sizeof(buf), "read", in test_task_fd_query_tp_core()
39 if (CHECK(err, "perf_event_open", "err %d errno %d\n", err, errno)) in test_task_fd_query_tp_core()
43 if (CHECK(err, "perf_event_ioc_enable", "err %d errno %d\n", err, in test_task_fd_query_tp_core()
48 if (CHECK(err, "perf_event_ioc_set_bpf", "err %d errno %d\n", err, in test_task_fd_query_tp_core()
56 if (CHECK(err < 0, "bpf_task_fd_query", "err %d errno %d\n", err, in test_task_fd_query_tp_core()
61 if (CHECK(!err, "check_results", "fd_type %d tp_name %s\n", in test_task_fd_query_tp_core()
Draw_tp_writable_test_run.c28 if (CHECK(bpf_fd < 0, "bpf_raw_tracepoint_writable loaded", in test_raw_tp_writable_test_run()
46 if (CHECK(filter_fd < 0, "test_program_loaded", "failed: %d errno %d\n", in test_raw_tp_writable_test_run()
51 if (CHECK(tp_fd < 0, "bpf_raw_tracepoint_writable opened", in test_raw_tp_writable_test_run()
62 CHECK(err != 42, "test_run", in test_raw_tp_writable_test_run()
64 CHECK(prog_ret != 0, "test_run_ret", in test_raw_tp_writable_test_run()
71 CHECK(err != 0, "test_run_notrace", in test_raw_tp_writable_test_run()
73 CHECK(prog_ret != 0, "test_run_ret_notrace", in test_raw_tp_writable_test_run()
Dstacktrace_map.c16 if (CHECK(err, "prog_load", "err %d errno %d\n", err, errno)) in test_stacktrace_map()
20 if (CHECK(!prog, "find_prog", "prog '%s' not found\n", prog_name)) in test_stacktrace_map()
24 if (CHECK(IS_ERR(link), "attach_tp", "err %ld\n", PTR_ERR(link))) in test_stacktrace_map()
56 if (CHECK(err, "compare_map_keys stackid_hmap vs. stackmap", in test_stacktrace_map()
61 if (CHECK(err, "compare_map_keys stackmap vs. stackid_hmap", in test_stacktrace_map()
67 if (CHECK(err, "compare_stack_ips stackmap vs. stack_amap", in test_stacktrace_map()
Dstacktrace_map_raw_tp.c16 if (CHECK(err, "prog_load raw tp", "err %d errno %d\n", err, errno)) in test_stacktrace_map_raw_tp()
20 if (CHECK(!prog, "find_prog", "prog '%s' not found\n", prog_name)) in test_stacktrace_map_raw_tp()
24 if (CHECK(IS_ERR(link), "attach_raw_tp", "err %ld\n", PTR_ERR(link))) in test_stacktrace_map_raw_tp()
52 if (CHECK(err, "compare_map_keys stackid_hmap vs. stackmap", in test_stacktrace_map_raw_tp()
57 if (CHECK(err, "compare_map_keys stackmap vs. stackid_hmap", in test_stacktrace_map_raw_tp()
Dbpf_obj_id.c32 CHECK(err >= 0 || errno != ENOENT, in test_bpf_obj_id()
36 CHECK(err >= 0 || errno != ENOENT, in test_bpf_obj_id()
68 if (CHECK(err || in test_bpf_obj_id()
109 if (CHECK(err || in test_bpf_obj_id()
154 if (CHECK(prog_fd < 0, "get-prog-fd(next_id)", in test_bpf_obj_id()
174 if (CHECK(!err || errno != EFAULT, in test_bpf_obj_id()
187 CHECK(err || info_len != sizeof(struct bpf_prog_info) || in test_bpf_obj_id()
197 CHECK(nr_id_found != nr_iters, in test_bpf_obj_id()
215 if (CHECK(map_fd < 0, "get-map-fd(next_id)", in test_bpf_obj_id()
234 CHECK(err || info_len != sizeof(struct bpf_map_info) || in test_bpf_obj_id()
[all …]
Dsignal_pending.c26 CHECK(prog_fd < 0, "test-run", "errno %d\n", errno); in test_signal_pending_by_type()
29 CHECK(err, "test-run-signal-sigaction", "errno %d\n", errno); in test_signal_pending_by_type()
32 CHECK(err, "test-run-signal-timer", "errno %d\n", errno); in test_signal_pending_by_type()
36 CHECK(duration > 500000000, /* 500ms */ in test_signal_pending_by_type()
Dglobal_data.c33 CHECK(err || num != tests[i].num, tests[i].name, in test_global_data_number()
62 CHECK(err || memcmp(str, tests[i].str, sizeof(str)), in test_global_data_string()
96 CHECK(err || memcmp(&val, &tests[i].val, sizeof(val)), in test_global_data_struct()
120 CHECK(!err || errno != EPERM, "test .rodata read-only map", in test_global_data_rdonly()
132 if (CHECK(err, "load program", "error %d loading %s\n", err, file)) in test_global_data()
137 CHECK(err || retval, "pass global data run", in test_global_data()
Dcore_reloc.c309 if (CHECK(IS_ERR_OR_NULL(obj), "obj_open", in test_core_reloc()
315 if (CHECK(!prog, "find_probe", in test_core_reloc()
325 CHECK(!err, "obj_load_fail", in test_core_reloc()
329 if (CHECK(err, "obj_load", in test_core_reloc()
336 if (CHECK(IS_ERR(link), "attach_raw_tp", "err %ld\n", in test_core_reloc()
341 if (CHECK(!data_map, "find_data_map", "data map not found\n")) in test_core_reloc()
349 if (CHECK(err, "update_data_map", in test_core_reloc()
357 if (CHECK(err, "get_result", in test_core_reloc()
363 if (CHECK(!equal, "check_result", in test_core_reloc()
/Linux-v5.4/include/linux/amba/
Dclcd.h247 #define CHECK(e,l,h) (var->e < l || var->e > h) in clcdfb_check() macro
248 if (CHECK(right_margin, (5+1), 256) || /* back porch */ in clcdfb_check()
249 CHECK(left_margin, (5+1), 256) || /* front porch */ in clcdfb_check()
250 CHECK(hsync_len, (5+1), 256) || in clcdfb_check()
257 #undef CHECK in clcdfb_check()
270 #define CHECK(e) (var->e != fb->fb.var.e) in clcdfb_check() macro
272 (CHECK(xres) || in clcdfb_check()
273 CHECK(yres) || in clcdfb_check()
274 CHECK(bits_per_pixel) || in clcdfb_check()
275 CHECK(pixclock) || in clcdfb_check()
[all …]
/Linux-v5.4/tools/testing/selftests/bpf/map_tests/
Dsk_storage_map.c151 CHECK(btf_fd == -1, "bpf_load_btf", "btf_fd:%d errno:%d\n", in create_sk_storage_map()
158 CHECK(map_fd == -1, in create_sk_storage_map()
418 CHECK(err, "setrlimit(RLIMIT_NOFILE)", "rlim_new:%lu errno:%d", in test_sk_storage_map_stress_free()
434 CHECK(err, "test_sk_storage_map_stress_free", "err:%d\n", err); in test_sk_storage_map_stress_free()
457 CHECK(err, "test_sk_storage_map_stress_change", "err:%d\n", err); in test_sk_storage_map_stress_change()
470 CHECK(btf_fd == -1, "bpf_load_btf", "btf_fd:%d errno:%d\n", in test_sk_storage_map_basic()
475 CHECK(sk_fd == -1, "socket()", "sk_fd:%d errno:%d\n", in test_sk_storage_map_basic()
479 CHECK(map_fd == -1, "bpf_create_map_xattr(good_xattr)", in test_sk_storage_map_basic()
486 CHECK(err, "bpf_map_update_elem(BPF_NOEXIST|BPF_F_LOCK)", in test_sk_storage_map_basic()
490 CHECK(err || lookup_value.cnt != value.cnt, in test_sk_storage_map_basic()
[all …]

1234