/tools/lib/ |
D | hweight.c | 20 unsigned int res = w - ((w >> 1) & 0x55555555); in __sw_hweight32() 21 res = (res & 0x33333333) + ((res >> 2) & 0x33333333); in __sw_hweight32() 22 res = (res + (res >> 4)) & 0x0F0F0F0F; in __sw_hweight32() 23 res = res + (res >> 8); in __sw_hweight32() 24 return (res + (res >> 16)) & 0x000000FF; in __sw_hweight32() 30 unsigned int res = w - ((w >> 1) & 0x5555); in __sw_hweight16() local 31 res = (res & 0x3333) + ((res >> 2) & 0x3333); in __sw_hweight16() 32 res = (res + (res >> 4)) & 0x0F0F; in __sw_hweight16() 33 return (res + (res >> 8)) & 0x00FF; in __sw_hweight16() 38 unsigned int res = w - ((w >> 1) & 0x55); in __sw_hweight8() local [all …]
|
/tools/testing/selftests/bpf/progs/ |
D | local_kptr_stash.c | 52 struct node_data *res; in create_and_stash() local 58 res = bpf_obj_new(typeof(*res)); in create_and_stash() 59 if (!res) in create_and_stash() 61 res->key = val; in create_and_stash() 63 res = bpf_kptr_xchg(&mapval->node, res); in create_and_stash() 64 if (res) in create_and_stash() 65 bpf_obj_drop(res); in create_and_stash() 79 struct plain_local *res; in stash_plain() local 86 res = bpf_obj_new(typeof(*res)); in stash_plain() 87 if (!res) in stash_plain() [all …]
|
D | local_kptr_stash_fail.c | 47 struct node_data2 *res; in stash_rb_nodes() local 54 res = bpf_obj_new(typeof(*res)); in stash_rb_nodes() 55 if (!res) in stash_rb_nodes() 57 res->key[0] = 40; in stash_rb_nodes() 59 res = bpf_kptr_xchg(&mapval->node, res); in stash_rb_nodes() 60 if (res) in stash_rb_nodes() 61 bpf_obj_drop(res); in stash_rb_nodes() 70 struct node_data *res; in drop_rb_node_off() local 77 res = bpf_obj_new(typeof(*res)); in drop_rb_node_off() 78 if (!res) in drop_rb_node_off() [all …]
|
D | rbtree.c | 77 struct bpf_rb_node *res = NULL; in rbtree_add_and_remove() local 93 res = bpf_rbtree_remove(&groot, &n->node); in rbtree_add_and_remove() 96 if (!res) in rbtree_add_and_remove() 99 n = container_of(res, struct node_data, node); in rbtree_add_and_remove() 115 struct bpf_rb_node *res = NULL; in rbtree_first_and_remove() local 141 res = bpf_rbtree_first(&groot); in rbtree_first_and_remove() 142 if (!res) { in rbtree_first_and_remove() 147 o = container_of(res, struct node_data, node); in rbtree_first_and_remove() 150 res = bpf_rbtree_remove(&groot, &o->node); in rbtree_first_and_remove() 153 if (!res) in rbtree_first_and_remove() [all …]
|
D | test_rdonly_maps.c | 22 } res = {}; variable 37 res.did_run = 1; in skip_loop() 38 res.iters = iters; in skip_loop() 39 res.sum = sum; in skip_loop() 56 res.did_run = 1; in part_loop() 57 res.iters = iters; in part_loop() 58 res.sum = sum; in part_loop() 77 res.did_run = 1; in full_loop() 78 res.iters = iters; in full_loop() 79 res.sum = sum; in full_loop()
|
D | rbtree_fail.c | 76 struct bpf_rb_node *res; in rbtree_api_remove_unadded_node() local 92 res = bpf_rbtree_remove(&groot, &n->node); in rbtree_api_remove_unadded_node() 93 n = container_of(res, struct node_data, node); in rbtree_api_remove_unadded_node() 96 res = bpf_rbtree_remove(&groot, &m->node); in rbtree_api_remove_unadded_node() 97 m = container_of(res, struct node_data, node); in rbtree_api_remove_unadded_node() 111 struct bpf_rb_node *res; in rbtree_api_remove_no_drop() local 115 res = bpf_rbtree_first(&groot); in rbtree_api_remove_no_drop() 116 if (!res) in rbtree_api_remove_no_drop() 119 res = bpf_rbtree_remove(&groot, res); in rbtree_api_remove_no_drop() 121 if (res) { in rbtree_api_remove_no_drop() [all …]
|
/tools/testing/selftests/futex/functional/ |
D | futex_waitv.c | 40 int res; in waiterfn() local 48 res = futex_waitv(waitv, NR_FUTEXES, 0, &to, CLOCK_MONOTONIC); in waiterfn() 49 if (res < 0) { in waiterfn() 52 } else if (res != NR_FUTEXES - 1) { in waiterfn() 54 res, NR_FUTEXES - 1); in waiterfn() 63 int res, ret = RET_PASS; in main() local 102 res = futex_wake(u64_to_ptr(waitv[NR_FUTEXES - 1].uaddr), 1, FUTEX_PRIVATE_FLAG); in main() 103 if (res != 1) { in main() 105 res ? errno : res, in main() 106 res ? strerror(errno) : ""); in main() [all …]
|
D | futex_requeue.c | 44 int res, ret = RET_PASS; in main() local 82 res = futex_cmp_requeue(f1, 0, &f2, 0, 1, 0); in main() 83 if (res != 1) { in main() 85 res ? errno : res, in main() 86 res ? strerror(errno) : ""); in main() 92 res = futex_wake(&f2, 1, 0); in main() 93 if (res != 1) { in main() 95 res ? errno : res, in main() 96 res ? strerror(errno) : ""); in main() 115 res = futex_cmp_requeue(f1, 0, &f2, 3, 7, 0); in main() [all …]
|
D | futex_wait_timeout.c | 64 static void test_timeout(int res, int *ret, char *test_name, int err) in test_timeout() argument 66 if (!res || errno != err) { in test_timeout() 72 res < 0 ? errno : res); in test_timeout() 104 int res, ret = RET_PASS; in main() local 148 res = futex_wait(&f1, f1, &to, 0); in main() 149 test_timeout(res, &ret, "futex_wait relative", ETIMEDOUT); in main() 154 res = futex_wait_bitset(&f1, f1, &to, 1, FUTEX_CLOCK_REALTIME); in main() 155 test_timeout(res, &ret, "futex_wait_bitset realtime", ETIMEDOUT); in main() 160 res = futex_wait_bitset(&f1, f1, &to, 1, 0); in main() 161 test_timeout(res, &ret, "futex_wait_bitset monotonic", ETIMEDOUT); in main() [all …]
|
D | futex_wait_wouldblock.c | 44 int res, ret = RET_PASS; in main() local 76 res = futex_wait(&f1, f1+1, &to, FUTEX_PRIVATE_FLAG); in main() 77 if (!res || errno != EWOULDBLOCK) { in main() 79 res ? errno : res, in main() 80 res ? strerror(errno) : ""); in main() 99 res = futex_waitv(&waitv, 1, 0, &to, CLOCK_MONOTONIC); in main() 100 if (!res || errno != EWOULDBLOCK) { in main() 106 res ? errno : res, in main() 107 res ? strerror(errno) : ""); in main()
|
/tools/perf/util/ |
D | fncache.c | 11 bool res; member 27 static bool lookup_fncache(const char *name, bool *res) in lookup_fncache() argument 34 *res = n->res; in lookup_fncache() 41 static void update_fncache(const char *name, bool res) in update_fncache() argument 49 n->res = res; in update_fncache() 56 bool res; in file_available() local 58 if (lookup_fncache(name, &res)) in file_available() 59 return res; in file_available() 60 res = access(name, R_OK) == 0; in file_available() 61 update_fncache(name, res); in file_available() [all …]
|
/tools/testing/selftests/resctrl/ |
D | resctrl_tests.c | 18 char *res; in detect_vendor() local 23 res = fgrep(inf, "vendor_id"); in detect_vendor() 25 if (res) in detect_vendor() 26 s = strchr(res, ':'); in detect_vendor() 34 free(res); in detect_vendor() 72 int res; in test_prepare() local 74 res = signal_handler_register(); in test_prepare() 75 if (res) { in test_prepare() 77 return res; in test_prepare() 80 res = mount_resctrlfs(); in test_prepare() [all …]
|
/tools/testing/selftests/mm/ |
D | mrelease_test.c | 57 int res; in run_negative_tests() local 61 res = (errno == ENOSYS ? KSFT_SKIP : KSFT_FAIL); in run_negative_tests() 63 exit(res); in run_negative_tests() 70 res = (errno == ENOSYS ? KSFT_SKIP : KSFT_FAIL); in run_negative_tests() 72 exit(res); in run_negative_tests() 78 int res; in child_main() local 82 res = alloc_noexit(MB(size) / psize(), pipefd[1]); in child_main() 84 return res; in child_main() 94 int res; in main() local 98 res = (errno == ENOSYS ? KSFT_SKIP : KSFT_FAIL); in main() [all …]
|
/tools/testing/selftests/prctl/ |
D | set-process-name.c | 18 int res; in set_name() local 20 res = prctl(PR_SET_NAME, name, NULL, NULL, NULL); in set_name() 22 if (res < 0) in set_name() 24 return res; in set_name() 30 int res; in check_is_name_correct() local 32 res = prctl(PR_GET_NAME, name, NULL, NULL, NULL); in check_is_name_correct() 34 if (res < 0) in check_is_name_correct() 43 int res; in check_null_pointer() local 45 res = prctl(PR_GET_NAME, name, NULL, NULL, NULL); in check_null_pointer() 47 return res; in check_null_pointer()
|
/tools/testing/selftests/tc-testing/ |
D | tdc.py | 248 def verify_by_json(procout, res, tidx, args, pm): argument 252 res.set_result(ResultState.fail) 253 res.set_failmsg('Cannot decode verify command\'s output. Is it JSON?') 254 return res 261 res.set_result(ResultState.fail) 262 res.set_failmsg(failmsg) 263 return res 268 res.set_result(ResultState.fail) 269 res.set_failmsg(failmsg) 270 return res [all …]
|
/tools/testing/nvdimm/test/ |
D | iomap.c | 55 struct nfit_test_resource *res; in get_nfit_res() local 58 res = __get_nfit_res(resource); in get_nfit_res() 61 return res; in get_nfit_res() 69 - nfit_res->res.start \ 81 - nfit_res->res.start; in __wrap_devm_ioremap() 92 return nfit_res->buf + offset - nfit_res->res.start; in __wrap_devm_memremap() 134 return nfit_res->buf + offset - nfit_res->res.start; in __wrap_devm_memremap_pages() 154 return nfit_res->buf + offset - nfit_res->res.start; in __wrap_memremap() 206 struct resource *res = *((struct resource **) data); in nfit_devres_release() local 208 WARN_ON(!nfit_test_release_region(NULL, &iomem_resource, res->start, in nfit_devres_release() [all …]
|
/tools/bpf/bpftool/ |
D | feature.c | 78 const char *define_name, bool res, const char *define_prefix) in print_bool_feature() argument 81 jsonw_bool_field(json_wtr, feat_name, res); in print_bool_feature() 84 res ? "" : "NO_", define_name); in print_bool_feature() 86 printf("%s is %savailable\n", plain_name, res ? "" : "NOT "); in print_bool_feature() 93 int res; in print_kernel_option() local 101 res = strtol(value, &endptr, 0); in print_kernel_option() 103 jsonw_int_field(json_wtr, name, res); in print_kernel_option() 175 long res; in read_procfs() local 181 res = getline(&line, &len, fd); in read_procfs() 183 if (res < 0) in read_procfs() [all …]
|
D | struct_ops.c | 24 struct res { struct 170 static int cmd_retval(const struct res *res, bool must_have_one_map) in cmd_retval() argument 172 if (res->nr_errs || (!res->nr_maps && must_have_one_map)) in cmd_retval() 186 static struct res do_search(const char *name, work_func func, void *data, in do_search() 190 struct res res = {}; in do_search() local 196 res.nr_errs++; in do_search() 197 return res; in do_search() 203 res.nr_maps++; in do_search() 206 res.nr_errs++; in do_search() 213 res.nr_errs++; in do_search() [all …]
|
/tools/testing/selftests/bpf/ |
D | bench.h | 57 void (*measure)(struct bench_res* res); 58 void (*report_progress)(int iter, struct bench_res* res, long delta_ns); 59 void (*report_final)(struct bench_res res[], int res_cnt); 70 void hits_drops_report_progress(int iter, struct bench_res *res, long delta_ns); 71 void hits_drops_report_final(struct bench_res res[], int res_cnt); 72 void false_hits_report_progress(int iter, struct bench_res *res, long delta_ns); 73 void false_hits_report_final(struct bench_res res[], int res_cnt); 74 void ops_report_progress(int iter, struct bench_res *res, long delta_ns); 75 void ops_report_final(struct bench_res res[], int res_cnt); 76 void local_storage_report_progress(int iter, struct bench_res *res, [all …]
|
D | bench.c | 38 void false_hits_report_progress(int iter, struct bench_res *res, long delta_ns) in false_hits_report_progress() argument 40 long total = res->false_hits + res->hits + res->drops; in false_hits_report_progress() 46 res->false_hits, total, ((float)res->false_hits / total) * 100); in false_hits_report_progress() 49 void false_hits_report_final(struct bench_res res[], int res_cnt) in false_hits_report_final() argument 55 total_hits += res[i].hits; in false_hits_report_final() 56 total_false_hits += res[i].false_hits; in false_hits_report_final() 57 total_drops += res[i].drops; in false_hits_report_final() 67 void hits_drops_report_progress(int iter, struct bench_res *res, long delta_ns) in hits_drops_report_progress() argument 72 hits_per_sec = res->hits / 1000000.0 / (delta_ns / 1000000000.0); in hits_drops_report_progress() 74 drops_per_sec = res->drops / 1000000.0 / (delta_ns / 1000000000.0); in hits_drops_report_progress() [all …]
|
/tools/testing/selftests/bpf/prog_tests/ |
D | verifier_log.c | 55 int i, mode, err, prog_fd, res; in verif_log_subtest() local 182 res = load_prog(&opts, expect_load_error); in verif_log_subtest() 183 ASSERT_NEQ(res, -ENOSPC, "prog_load_res_fixed"); in verif_log_subtest() 193 res = load_prog(&opts, expect_load_error); in verif_log_subtest() 194 ASSERT_NEQ(res, -ENOSPC, "prog_load_res_fixed_null"); in verif_log_subtest() 202 res = load_prog(&opts, expect_load_error); in verif_log_subtest() 203 ASSERT_NEQ(res, -ENOSPC, "prog_load_res_rolling"); in verif_log_subtest() 213 res = load_prog(&opts, expect_load_error); in verif_log_subtest() 214 ASSERT_NEQ(res, -ENOSPC, "prog_load_res_rolling_null"); in verif_log_subtest() 222 res = load_prog(&opts, true /* should fail */); in verif_log_subtest() [all …]
|
/tools/testing/selftests/ptp/ |
D | phc.sh | 92 local res 94 res=$(phc_ctl $DEV set 0 wait 120.5 get 2> /dev/null \ 98 (( res == 120 )) 103 local res 105 res=$(phc_ctl $DEV set 0 adj 10 get 2> /dev/null \ 109 (( res == 10 )) 114 local res 117 res=$(phc_ctl $DEV freq 10000000 set 0 wait 100.5 get 2> /dev/null \ 121 (( res == 101 ))
|
/tools/virtio/ringtest/ |
D | main.h | 155 void __read_once_size(const volatile void *p, void *res, int size) in __read_once_size() argument 158 case 1: *(unsigned char *)res = *(volatile unsigned char *)p; break; in __read_once_size() 159 case 2: *(unsigned short *)res = *(volatile unsigned short *)p; break; in __read_once_size() 160 case 4: *(unsigned int *)res = *(volatile unsigned int *)p; break; in __read_once_size() 161 case 8: *(unsigned long long *)res = *(volatile unsigned long long *)p; break; in __read_once_size() 164 __builtin_memcpy((void *)res, (const void *)p, size); in __read_once_size() 169 static __always_inline void __write_once_size(volatile void *p, void *res, int size) in __write_once_size() argument 172 case 1: *(volatile unsigned char *)p = *(unsigned char *)res; break; in __write_once_size() 173 case 2: *(volatile unsigned short *)p = *(unsigned short *)res; break; in __write_once_size() 174 case 4: *(volatile unsigned int *)p = *(unsigned int *)res; break; in __write_once_size() [all …]
|
/tools/testing/selftests/filesystems/fuse/ |
D | bpf_loader.c | 149 int res; in s_link() local 152 res = link(src_pathname.s, dst_pathname.s); in s_link() 154 res = -1; in s_link() 160 return res; in s_link() 165 int res; in s_symlink() local 168 res = symlink(src_pathname.s, dst_pathname.s); in s_symlink() 170 res = -1; in s_symlink() 176 return res; in s_symlink() 182 int res; in s_mkdir() local 189 res = mkdir(pathname.s, mode); in s_mkdir() [all …]
|
/tools/include/linux/ |
D | compiler.h | 135 static __always_inline void __read_once_size(const volatile void *p, void *res, int size) in __read_once_size() argument 138 case 1: *(__u8_alias_t *) res = *(volatile __u8_alias_t *) p; break; in __read_once_size() 139 case 2: *(__u16_alias_t *) res = *(volatile __u16_alias_t *) p; break; in __read_once_size() 140 case 4: *(__u32_alias_t *) res = *(volatile __u32_alias_t *) p; break; in __read_once_size() 141 case 8: *(__u64_alias_t *) res = *(volatile __u64_alias_t *) p; break; in __read_once_size() 144 __builtin_memcpy((void *)res, (const void *)p, size); in __read_once_size() 149 static __always_inline void __write_once_size(volatile void *p, void *res, int size) in __write_once_size() argument 152 case 1: *(volatile __u8_alias_t *) p = *(__u8_alias_t *) res; break; in __write_once_size() 153 case 2: *(volatile __u16_alias_t *) p = *(__u16_alias_t *) res; break; in __write_once_size() 154 case 4: *(volatile __u32_alias_t *) p = *(__u32_alias_t *) res; break; in __write_once_size() [all …]
|