/kernel/linux/linux-5.10/tools/testing/radix-tree/ |
H A D | main.c | 58 __gang_check(start, rand() % 113 + 1, rand() % 71, in __big_gang_check() 59 rand() % 157, rand() % 91 + 1); in __big_gang_check() 61 start += rand() % 1000000; in __big_gang_check() 164 start = rand(); in copy_tag_check() 165 end = rand(); in copy_tag_check() 166 if (start > end && (rand() % 10)) { in copy_tag_check() 173 cur = rand(); in copy_tag_check() 203 idx[i] = rand(); in copy_tag_check() [all...] |
/kernel/linux/linux-6.6/tools/testing/radix-tree/ |
H A D | main.c | 58 __gang_check(start, rand() % 113 + 1, rand() % 71, in __big_gang_check() 59 rand() % 157, rand() % 91 + 1); in __big_gang_check() 61 start += rand() % 1000000; in __big_gang_check() 164 start = rand(); in copy_tag_check() 165 end = rand(); in copy_tag_check() 166 if (start > end && (rand() % 10)) { in copy_tag_check() 173 cur = rand(); in copy_tag_check() 203 idx[i] = rand(); in copy_tag_check() [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/powerpc/ptrace/ |
H A D | ptrace-hwbreak.c | 139 if (rand() % 2) in test_workload() 155 if (rand() % 2) in test_workload() 164 gstruct.a[rand() % A_LEN] = 'a'; in test_workload() 167 cvar = gstruct.a[rand() % A_LEN]; in test_workload() 170 if (rand() % 2) in test_workload() 171 gstruct.a[rand() % A_LEN] = 'a'; in test_workload() 173 cvar = gstruct.a[rand() % A_LEN]; in test_workload() 176 gstruct.b[rand() % B_LEN] = 'b'; in test_workload() 179 cvar = gstruct.b[rand() % B_LEN]; in test_workload() 182 if (rand() in test_workload() [all...] |
H A D | ptrace-tm-spd-vsx.c | 136 fp_load[i] = 1 + rand(); in ptrace_tm_spd_vsx() 137 fp_load_new[i] = 1 + 2 * rand(); in ptrace_tm_spd_vsx() 138 fp_load_ckpt[i] = 1 + 3 * rand(); in ptrace_tm_spd_vsx() 139 fp_load_ckpt_new[i] = 1 + 4 * rand(); in ptrace_tm_spd_vsx()
|
/kernel/linux/linux-5.10/tools/testing/selftests/powerpc/ptrace/ |
H A D | ptrace-hwbreak.c | 138 if (rand() % 2) in test_workload() 154 if (rand() % 2) in test_workload() 163 gstruct.a[rand() % A_LEN] = 'a'; in test_workload() 166 cvar = gstruct.a[rand() % A_LEN]; in test_workload() 169 if (rand() % 2) in test_workload() 170 gstruct.a[rand() % A_LEN] = 'a'; in test_workload() 172 cvar = gstruct.a[rand() % A_LEN]; in test_workload() 175 gstruct.b[rand() % B_LEN] = 'b'; in test_workload() 178 cvar = gstruct.b[rand() % B_LEN]; in test_workload() 181 if (rand() in test_workload() [all...] |
H A D | ptrace-tm-spd-vsx.c | 135 fp_load[i] = 1 + rand(); in ptrace_tm_spd_vsx() 136 fp_load_new[i] = 1 + 2 * rand(); in ptrace_tm_spd_vsx() 137 fp_load_ckpt[i] = 1 + 3 * rand(); in ptrace_tm_spd_vsx() 138 fp_load_ckpt_new[i] = 1 + 4 * rand(); in ptrace_tm_spd_vsx()
|
/kernel/linux/linux-6.6/tools/testing/selftests/powerpc/dscr/ |
H A D | dscr_explicit_test.c | 107 expected_dscr = rand() % DSCR_MAX; in dscr_explicit_random_thread() 110 for (int j = rand() % 5; j > 0; --j) { in dscr_explicit_random_thread() 114 if (args->do_yields && rand() % 2) in dscr_explicit_random_thread() 118 expected_dscr = rand() % DSCR_MAX; in dscr_explicit_random_thread() 121 for (int j = rand() % 5; j > 0; --j) { in dscr_explicit_random_thread() 125 if (args->do_yields && rand() % 2) in dscr_explicit_random_thread()
|
/kernel/linux/linux-6.6/tools/testing/selftests/kvm/s390x/ |
H A D | memop.c | 292 mem1[i] = rand(); in prepare_mem12() 499 unsigned int rand; in choose_block() local 501 rand = i; in choose_block() 503 rand = rand * 19 + 11; in choose_block() 504 *size = 1 << ((rand % 3) + 2); in choose_block() 505 rand = rand * 19 + 11; in choose_block() 506 *offset = (rand % max_block) & ~(*size - 1); in choose_block() 508 rand in choose_block() 517 unsigned int rand; permutate_bits() local [all...] |
/kernel/linux/linux-5.10/arch/x86/kernel/ |
H A D | espfix_64.c | 97 unsigned long rand; in init_espfix_random() local 103 if (!arch_get_random_long(&rand)) { in init_espfix_random() 105 rand = rdtsc(); in init_espfix_random() 106 rand *= 0xc345c6b72fd16123UL; in init_espfix_random() 109 slot_random = rand % ESPFIX_STACKS_PER_PAGE; in init_espfix_random() 110 page_random = (rand / ESPFIX_STACKS_PER_PAGE) in init_espfix_random()
|
/kernel/linux/linux-5.10/tools/testing/selftests/vm/ |
H A D | mlock-random-test.c | 161 int is_mlock = !!(rand() % 2); in test_mlock_within_limit() 162 int lock_size = rand() % alloc_size; in test_mlock_within_limit() 163 int start_offset = rand() % (alloc_size - lock_size); in test_mlock_within_limit() 232 int is_mlock = !!(rand() % 2); in test_mlock_outof_limit() 233 int lock_size = (rand() % (alloc_size - cur.rlim_cur)) in test_mlock_outof_limit() 235 int start_offset = rand() % (alloc_size - lock_size); in test_mlock_outof_limit()
|
/kernel/linux/linux-6.6/tools/testing/selftests/mm/ |
H A D | mlock-random-test.c | 162 int is_mlock = !!(rand() % 2); in test_mlock_within_limit() 163 int lock_size = rand() % alloc_size; in test_mlock_within_limit() 164 int start_offset = rand() % (alloc_size - lock_size); in test_mlock_within_limit() 233 int is_mlock = !!(rand() % 2); in test_mlock_outof_limit() 234 int lock_size = (rand() % (alloc_size - cur.rlim_cur)) in test_mlock_outof_limit() 236 int start_offset = rand() % (alloc_size - lock_size); in test_mlock_outof_limit()
|
/kernel/linux/linux-6.6/include/linux/ |
H A D | randomize_kstack.h | 79 #define choose_random_kstack_offset(rand) do { \ 83 offset ^= (rand); \ 89 #define choose_random_kstack_offset(rand) do { } while (0)
|
/kernel/linux/linux-5.10/arch/x86/mm/ |
H A D | kaslr.c | 68 unsigned long rand, memory_tb; in kernel_randomize_memory() local 126 prandom_bytes_state(&rand_state, &rand, sizeof(rand)); in kernel_randomize_memory() 127 entropy = (rand % (entropy + 1)) & PUD_MASK; in kernel_randomize_memory()
|
/kernel/linux/linux-5.10/mm/ |
H A D | shuffle.c | 164 static u64 rand; in shuffle_pick_tail() local 170 * update the rand state it just adds to the entropy. in shuffle_pick_tail() 174 rand = get_random_u64(); in shuffle_pick_tail() 177 ret = rand & 1; in shuffle_pick_tail() 180 rand >>= 1; in shuffle_pick_tail()
|
/kernel/linux/linux-6.6/arch/x86/mm/ |
H A D | kaslr.c | 68 unsigned long rand, memory_tb; in kernel_randomize_memory() local 126 prandom_bytes_state(&rand_state, &rand, sizeof(rand)); in kernel_randomize_memory() 127 entropy = (rand % (entropy + 1)) & PUD_MASK; in kernel_randomize_memory()
|
/kernel/linux/linux-6.6/mm/ |
H A D | shuffle.c | 163 static u64 rand; in shuffle_pick_tail() local 169 * update the rand state it just adds to the entropy. in shuffle_pick_tail() 173 rand = get_random_u64(); in shuffle_pick_tail() 176 ret = rand & 1; in shuffle_pick_tail() 179 rand >>= 1; in shuffle_pick_tail()
|
/kernel/linux/linux-5.10/tools/testing/selftests/bpf/ |
H A D | bpf_rand.h | 11 return (((uint64_t)(uint32_t)rand()) | in bpf_rand_mask() 12 ((uint64_t)(uint32_t)rand() << 32)) & mask; in bpf_rand_mask() 37 switch (rand() % 39) { in bpf_semi_rand_get()
|
/kernel/linux/linux-6.6/tools/testing/selftests/bpf/ |
H A D | bpf_rand.h | 11 return (((uint64_t)(uint32_t)rand()) | in bpf_rand_mask() 12 ((uint64_t)(uint32_t)rand() << 32)) & mask; in bpf_rand_mask() 37 switch (rand() % 39) { in bpf_semi_rand_get()
|
/kernel/linux/linux-5.10/tools/testing/selftests/net/ |
H A D | ip_defrag.c | 245 if (!cfg_overlap && (rand() % 100 < 15)) { in send_udp_frags() 255 if (!cfg_overlap && (rand() % 100 < 20) && in send_udp_frags() 280 if (rand() % 100 == 1) in send_udp_frags() 299 offset = rand() % (payload_len / 2); in send_udp_frags() 300 frag_len = 2 * max_frag_len + 1 + rand() % 256; in send_udp_frags() 328 if (rand() % 100 == 1) in send_udp_frags() 364 payload_len += (rand() % 4096)) { in run_test() 375 rand() % (1500 - FRAG_HLEN - min_frag_len); in run_test() 389 max_frag_len += 8 * (rand() % 8); in run_test()
|
/kernel/linux/linux-5.10/tools/testing/selftests/bpf/prog_tests/ |
H A D | tcp_hdr_options.c | 86 fprintf(stderr, "%s{flags:0x%x, max_delack_ms:%u, rand:0x%x}\n", in print_option() 87 prefix ? : "", opt->flags, opt->max_delack_ms, opt->rand); in print_option() 340 exp_passive_estab_in.rand = 0xfa; in fastopen_estab() 344 exp_active_estab_in.rand = 0xce; in fastopen_estab() 378 exp_passive_estab_in.rand = 0xfa; in syncookie_estab() 383 exp_active_estab_in.rand = 0xce; in syncookie_estab() 423 exp_passive_fin_in.rand = 0xfa; in fin() 426 exp_active_fin_in.rand = 0xce; in fin() 456 exp_passive_estab_in.rand = 0xfa; in __simple_estab() 460 exp_active_estab_in.rand in __simple_estab() [all...] |
/kernel/linux/linux-5.10/drivers/media/test-drivers/vivid/ |
H A D | vivid-touch-cap.c | 213 unsigned int rand = get_random_int(); in vivid_fill_buff_noise() local 215 if (rand % 10) in vivid_fill_buff_noise() 218 tch_buf[i] = (rand / 10) % 7 - 3; in vivid_fill_buff_noise() 261 unsigned int test_pattern, test_pat_idx, rand; in vivid_fillbuff_tch() local 276 rand = dev->tch_pat_random; in vivid_fillbuff_tch() 281 vivid_tch_buf_set(f, tch_buf, rand % size); in vivid_fillbuff_tch() 285 vivid_tch_buf_set(f, tch_buf, rand % size); in vivid_fillbuff_tch() 289 vivid_tch_buf_set(f, tch_buf, rand % size); in vivid_fillbuff_tch() 293 (rand % f->height) * f->width + in vivid_fillbuff_tch()
|
/kernel/linux/linux-6.6/drivers/media/test-drivers/vivid/ |
H A D | vivid-touch-cap.c | 213 unsigned int rand = get_random_u32(); in vivid_fill_buff_noise() local 215 if (rand % 10) in vivid_fill_buff_noise() 218 tch_buf[i] = (rand / 10) % 7 - 3; in vivid_fill_buff_noise() 261 unsigned int test_pattern, test_pat_idx, rand; in vivid_fillbuff_tch() local 276 rand = dev->tch_pat_random; in vivid_fillbuff_tch() 281 vivid_tch_buf_set(f, tch_buf, rand % size); in vivid_fillbuff_tch() 285 vivid_tch_buf_set(f, tch_buf, rand % size); in vivid_fillbuff_tch() 289 vivid_tch_buf_set(f, tch_buf, rand % size); in vivid_fillbuff_tch() 293 (rand % f->height) * f->width + in vivid_fillbuff_tch()
|
/kernel/linux/linux-6.6/tools/testing/selftests/net/ |
H A D | ip_defrag.c | 245 if (!cfg_overlap && (rand() % 100 < 15)) { in send_udp_frags() 255 if (!cfg_overlap && (rand() % 100 < 20) && in send_udp_frags() 280 if (rand() % 100 == 1) in send_udp_frags() 299 offset = rand() % (payload_len / 2); in send_udp_frags() 300 frag_len = 2 * max_frag_len + 1 + rand() % 256; in send_udp_frags() 328 if (rand() % 100 == 1) in send_udp_frags() 364 payload_len += (rand() % 4096)) { in run_test() 375 rand() % (1500 - FRAG_HLEN - min_frag_len); in run_test() 389 max_frag_len += 8 * (rand() % 8); in run_test()
|
/kernel/linux/linux-6.6/tools/testing/selftests/bpf/prog_tests/ |
H A D | tcp_hdr_options.c | 63 fprintf(stderr, "%s{flags:0x%x, max_delack_ms:%u, rand:0x%x}\n", in print_option() 64 prefix ? : "", opt->flags, opt->max_delack_ms, opt->rand); in print_option() 304 exp_passive_estab_in.rand = 0xfa; in fastopen_estab() 308 exp_active_estab_in.rand = 0xce; in fastopen_estab() 341 exp_passive_estab_in.rand = 0xfa; in syncookie_estab() 346 exp_active_estab_in.rand = 0xce; in syncookie_estab() 385 exp_passive_fin_in.rand = 0xfa; in fin() 388 exp_active_fin_in.rand = 0xce; in fin() 417 exp_passive_estab_in.rand = 0xfa; in __simple_estab() 421 exp_active_estab_in.rand in __simple_estab() [all...] |
/kernel/linux/linux-6.6/kernel/ |
H A D | torture.c | 344 DEFINE_TORTURE_RANDOM(rand); in torture_onoff() 358 torture_hrtimeout_jiffies(onoff_holdoff, &rand); in torture_onoff() 363 torture_hrtimeout_jiffies(HZ / 10, &rand); in torture_onoff() 366 cpu = torture_random(&rand) % (maxcpu + 1); in torture_onoff() 373 torture_hrtimeout_jiffies(onoff_interval, &rand); in torture_onoff() 526 DEFINE_TORTURE_RANDOM(rand); in torture_shuffle_tasks() 547 if (!random_shuffle || torture_random(&rand) & 0x1) in torture_shuffle_tasks() 561 DEFINE_TORTURE_RANDOM(rand); in torture_shuffle() 565 torture_hrtimeout_jiffies(shuffle_interval, &rand); in torture_shuffle()
|