/kernel/linux/linux-6.6/tools/testing/radix-tree/ |
H A D | regression1.c | 168 static pthread_t *threads; variable 180 threads = malloc(nr_threads * sizeof(*threads)); in regression1_test() 184 if (pthread_create(&threads[i], NULL, regression1_fn, (void *)arg)) { in regression1_test() 191 if (pthread_join(threads[i], NULL)) { in regression1_test() 197 free(threads); in regression1_test()
|
H A D | iteration_check_2.c | 56 pthread_t threads[2]; in iteration_test2() local 67 if (pthread_create(&threads[0], NULL, iterator, &array)) { in iteration_test2() 71 if (pthread_create(&threads[1], NULL, throbber, &array)) { in iteration_test2() 80 if (pthread_join(threads[i], NULL)) { in iteration_test2()
|
/kernel/linux/linux-6.6/tools/testing/selftests/sync/ |
H A D | sync_stress_consumer.c | 56 int threads; member 112 int n = test_data_mpsc.threads; in mpcs_consumer_thread() 143 /* Release the producer threads */ in mpcs_consumer_thread() 145 "Failure releasing producer threads\n"); in mpcs_consumer_thread() 160 pthread_t threads[n]; in test_consumer_stress_multi_producer_single_consumer() local 169 test_data_mpsc.threads = n; in test_consumer_stress_multi_producer_single_consumer() 174 pthread_create(&threads[i], NULL, (void * (*)(void *)) in test_consumer_stress_multi_producer_single_consumer() 182 pthread_join(threads[i], NULL); in test_consumer_stress_multi_producer_single_consumer()
|
/kernel/linux/linux-6.6/tools/testing/selftests/powerpc/dscr/ |
H A D | dscr_explicit_test.c | 135 struct random_thread_args threads[THREADS]; in dscr_explicit_random_test() local 143 threads[i].do_yields = i % 2 == 0; in dscr_explicit_random_test() 144 threads[i].barrier = &barrier; in dscr_explicit_random_test() 146 FAIL_IF(pthread_create(&threads[i].thread_id, NULL, in dscr_explicit_random_test() 147 dscr_explicit_random_thread, (void *)&threads[i])); in dscr_explicit_random_test() 151 FAIL_IF(pthread_join(threads[i].thread_id, NULL)); in dscr_explicit_random_test()
|
/kernel/linux/linux-6.6/tools/testing/selftests/powerpc/math/ |
H A D | vsx_preempt.c | 7 * uses many threads and a long wait. As such, a successful test 27 * worker threads 92 int i, rc, threads; in test_preempt_vsx() local 97 threads = sysconf(_SC_NPROCESSORS_ONLN) * THREAD_FACTOR; in test_preempt_vsx() 98 tids = malloc(threads * sizeof(pthread_t)); in test_preempt_vsx() 102 threads_starting = threads; in test_preempt_vsx() 103 for (i = 0; i < threads; i++) { in test_preempt_vsx() 125 for (i = 0; i < threads; i++) { in test_preempt_vsx()
|
/kernel/linux/linux-5.10/tools/perf/tests/ |
H A D | openat-syscall.c | 21 struct perf_thread_map *threads = thread_map__new(-1, getpid(), UINT_MAX); in test__openat_syscall_event() local 25 if (threads == NULL) { in test__openat_syscall_event() 37 if (evsel__open_per_thread(evsel, threads) < 0) { in test__openat_syscall_event() 66 perf_thread_map__put(threads); in test__openat_syscall_event()
|
H A D | mmap-thread-lookup.c | 32 static struct thread_data threads[THREADS]; variable 81 struct thread_data *td = &threads[i]; in thread_create() 101 struct thread_data *td0 = &threads[0]; in threads_create() 118 struct thread_data *td0 = &threads[0]; in threads_destroy() 127 err = pthread_join(threads[i].pt, NULL); in threads_destroy() 162 * The threads_create will not return before all threads in mmap_events() 168 TEST_ASSERT_VAL("failed to create threads", !threads_create()); in mmap_events() 178 TEST_ASSERT_VAL("failed to destroy threads", !threads_destroy()); in mmap_events() 186 struct thread_data *td = &threads[i]; in mmap_events() 214 * This test creates 'THREADS' number of threads (includin [all...] |
H A D | keep-tracking.c | 74 struct perf_thread_map *threads = NULL; in test__keep_tracking() local 81 threads = thread_map__new(-1, getpid(), UINT_MAX); in test__keep_tracking() 82 CHECK_NOT_NULL__(threads); in test__keep_tracking() 90 perf_evlist__set_maps(&evlist->core, cpus, threads); in test__keep_tracking() 159 perf_thread_map__put(threads); in test__keep_tracking()
|
/kernel/linux/linux-5.10/tools/testing/radix-tree/ |
H A D | iteration_check_2.c | 56 pthread_t threads[2]; in iteration_test2() local 67 if (pthread_create(&threads[0], NULL, iterator, &array)) { in iteration_test2() 71 if (pthread_create(&threads[1], NULL, throbber, &array)) { in iteration_test2() 80 if (pthread_join(threads[i], NULL)) { in iteration_test2()
|
/kernel/linux/linux-5.10/tools/lib/perf/ |
H A D | evlist.c | 56 perf_thread_map__put(evsel->threads); in __perf_evlist__propagate_maps() 57 evsel->threads = perf_thread_map__get(evlist->threads); in __perf_evlist__propagate_maps() 130 perf_thread_map__put(evlist->threads); in perf_evlist__exit() 133 evlist->threads = NULL; in perf_evlist__exit() 151 struct perf_thread_map *threads) in perf_evlist__set_maps() 165 if (threads != evlist->threads) { in perf_evlist__set_maps() 166 perf_thread_map__put(evlist->threads); in perf_evlist__set_maps() 167 evlist->threads in perf_evlist__set_maps() 149 perf_evlist__set_maps(struct perf_evlist *evlist, struct perf_cpu_map *cpus, struct perf_thread_map *threads) perf_evlist__set_maps() argument [all...] |
/kernel/linux/linux-6.6/tools/perf/tests/ |
H A D | mmap-thread-lookup.c | 32 static struct thread_data threads[THREADS]; variable 81 struct thread_data *td = &threads[i]; in thread_create() 101 struct thread_data *td0 = &threads[0]; in threads_create() 118 struct thread_data *td0 = &threads[0]; in threads_destroy() 127 err = pthread_join(threads[i].pt, NULL); in threads_destroy() 162 * The threads_create will not return before all threads in mmap_events() 168 TEST_ASSERT_VAL("failed to create threads", !threads_create()); in mmap_events() 178 TEST_ASSERT_VAL("failed to destroy threads", !threads_destroy()); in mmap_events() 186 struct thread_data *td = &threads[i]; in mmap_events() 216 * This test creates 'THREADS' number of threads (includin [all...] |
H A D | sigtrap.c | 28 int tids_want_signal; /* Which threads still want a signal. */ 137 static int run_test_threads(pthread_t *threads, pthread_barrier_t *barrier) in run_test_threads() argument 143 TEST_ASSERT_EQUAL("pthread_join() failed", pthread_join(threads[i], NULL), 0); in run_test_threads() 148 static int run_stress_test(int fd, pthread_t *threads, pthread_barrier_t *barrier) in run_stress_test() argument 156 ret = run_test_threads(threads, barrier); in run_stress_test() 177 pthread_t threads[NUM_THREADS]; in test__sigtrap() local 210 if (pthread_create(&threads[i], NULL, test_thread, &barrier)) { in test__sigtrap() 216 ret = run_stress_test(fd, threads, &barrier); in test__sigtrap()
|
H A D | task-exit.c | 55 struct perf_thread_map *threads; in test__task_exit() local 68 * Create maps of threads and cpus to monitor. In this case in test__task_exit() 69 * we start with all threads and cpus (-1, -1) but then in in test__task_exit() 74 threads = thread_map__new_by_tid(-1); in test__task_exit() 75 if (!cpus || !threads) { in test__task_exit() 81 perf_evlist__set_maps(&evlist->core, cpus, threads); in test__task_exit() 150 perf_thread_map__put(threads); in test__task_exit()
|
H A D | sw-clock.c | 47 struct perf_thread_map *threads = NULL; in __test__sw_clock_freq() local 66 threads = thread_map__new_by_tid(getpid()); in __test__sw_clock_freq() 67 if (!cpus || !threads) { in __test__sw_clock_freq() 73 perf_evlist__set_maps(&evlist->core, cpus, threads); in __test__sw_clock_freq() 132 perf_thread_map__put(threads); in __test__sw_clock_freq()
|
H A D | keep-tracking.c | 74 struct perf_thread_map *threads = NULL; in test__keep_tracking() local 81 threads = thread_map__new(-1, getpid(), UINT_MAX); in test__keep_tracking() 82 CHECK_NOT_NULL__(threads); in test__keep_tracking() 90 perf_evlist__set_maps(&evlist->core, cpus, threads); in test__keep_tracking() 159 perf_thread_map__put(threads); in test__keep_tracking()
|
H A D | openat-syscall.c | 23 struct perf_thread_map *threads = thread_map__new(-1, getpid(), UINT_MAX); in test__openat_syscall_event() local 27 if (threads == NULL) { in test__openat_syscall_event() 40 if (evsel__open_per_thread(evsel, threads) < 0) { in test__openat_syscall_event() 70 perf_thread_map__put(threads); in test__openat_syscall_event()
|
/kernel/linux/linux-5.10/drivers/firmware/psci/ |
H A D | psci_checker.c | 285 /* Set maximum priority to preempt all other threads on this CPU. */ in suspend_test_thread() 370 struct task_struct **threads; in suspend_tests() local 373 threads = kmalloc_array(nb_available_cpus, sizeof(*threads), in suspend_tests() 375 if (!threads) in suspend_tests() 380 * mode, as it might interfere with the suspend threads on other CPUs. in suspend_tests() 381 * This does not prevent the suspend threads from using cpuidle (only in suspend_tests() 405 threads[nb_threads++] = thread; in suspend_tests() 416 * Wake up the suspend threads. To avoid the main thread being preempted in suspend_tests() 417 * before all the threads hav in suspend_tests() [all...] |
/kernel/linux/linux-6.6/drivers/firmware/psci/ |
H A D | psci_checker.c | 285 /* Set maximum priority to preempt all other threads on this CPU. */ in suspend_test_thread() 370 struct task_struct **threads; in suspend_tests() local 373 threads = kmalloc_array(nb_available_cpus, sizeof(*threads), in suspend_tests() 375 if (!threads) in suspend_tests() 380 * mode, as it might interfere with the suspend threads on other CPUs. in suspend_tests() 381 * This does not prevent the suspend threads from using cpuidle (only in suspend_tests() 405 threads[nb_threads++] = thread; in suspend_tests() 416 * Wake up the suspend threads. To avoid the main thread being preempted in suspend_tests() 417 * before all the threads hav in suspend_tests() [all...] |
/kernel/linux/linux-6.6/kernel/dma/ |
H A D | map_benchmark.c | 102 int threads = map->bparam.threads; in do_map_benchmark() local 109 tsk = kmalloc_array(threads, sizeof(*tsk), GFP_KERNEL); in do_map_benchmark() 115 for (i = 0; i < threads; i++) { in do_map_benchmark() 135 for (i = 0; i < threads; i++) { in do_map_benchmark() 142 /* wait for the completion of benchmark threads */ in do_map_benchmark() 143 for (i = 0; i < threads; i++) { in do_map_benchmark() 173 for (i = 0; i < threads; i++) in do_map_benchmark() 193 if (map->bparam.threads == 0 || in map_benchmark_ioctl() 194 map->bparam.threads > DMA_MAP_MAX_THREAD in map_benchmark_ioctl() [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/kvm/ |
H A D | max_guest_memory_test.c | 97 pthread_t *threads; in spawn_workers() local 100 threads = malloc(nr_vcpus * sizeof(*threads)); in spawn_workers() 101 TEST_ASSERT(threads, "Failed to allocate vCPU threads"); in spawn_workers() 114 pthread_create(&threads[i], NULL, vcpu_worker, &info[i]); in spawn_workers() 116 return threads; in spawn_workers() 174 pthread_t *threads; in main() local 254 threads = spawn_workers(vm, vcpus, start_gpa, gpa); in main() 288 pthread_join(threads[ in main() [all...] |
/kernel/linux/linux-6.6/tools/testing/selftests/bpf/benchs/ |
H A D | bench_local_storage_create.c | 19 static struct thread *threads; variable 109 threads = calloc(env.producer_cnt, sizeof(*threads)); in setup() 111 if (!threads) { in setup() 117 struct thread *t = &threads[i]; in setup() 148 struct thread *t = &threads[(long)(input)]; in sk_producer() 175 struct thread *t = &threads[(long)(input)]; in task_producer()
|
/kernel/linux/linux-6.6/tools/perf/util/ |
H A D | machine.c | 66 struct threads *threads = &machine->threads[i]; in machine__threads_init() local 67 threads->entries = RB_ROOT_CACHED; in machine__threads_init() 68 init_rwsem(&threads->lock); in machine__threads_init() 69 threads->nr = 0; in machine__threads_init() 70 INIT_LIST_HEAD(&threads->dead); in machine__threads_init() 71 threads->last_match = NULL; in machine__threads_init() 229 struct threads *threads in machine__delete_threads() local 260 struct threads *threads = &machine->threads[i]; machine__exit() local 570 __threads__get_last_match(struct threads *threads, struct machine *machine, int pid, int tid) __threads__get_last_match() argument 589 threads__get_last_match(struct threads *threads, struct machine *machine, int pid, int tid) threads__get_last_match() argument 601 __threads__set_last_match(struct threads *threads, struct thread *th) __threads__set_last_match() argument 608 threads__set_last_match(struct threads *threads, struct thread *th) threads__set_last_match() argument 618 ____machine__findnew_thread(struct machine *machine, struct threads *threads, pid_t pid, pid_t tid, bool create) ____machine__findnew_thread() argument 699 struct threads *threads = machine__threads(machine, tid); machine__findnew_thread() local 711 struct threads *threads = machine__threads(machine, tid); machine__find_thread() local 1131 struct threads *threads = &machine->threads[i]; machine__fprintf() local 2056 struct threads *threads = machine__threads(machine, thread__tid(th)); __machine__remove_thread() local 3216 struct threads *threads; machine__for_each_thread() local [all...] |
/kernel/liteos_a/testsuites/unittest/process/basic/pthread/smoke/ |
H A D | pthread_cond_test_002.cpp | 85 pthread_t threads[3]; in TestCase() local 94 rc = pthread_create(&threads[0], NULL, PthreadF01, (void *)t1); in TestCase() 97 rc = pthread_create(&threads[1], NULL, PthreadF02, (void *)t2); in TestCase() 101 rc = pthread_join(threads[i], NULL); in TestCase()
|
H A D | pthread_cond_test_001.cpp | 91 pthread_t threads[3]; // 3, need 3 pthread for test. in TestCase() local 99 rc = pthread_create(&threads[0], NULL, PthreadF01, (void *)t1); in TestCase() 102 rc = pthread_create(&threads[1], NULL, PthreadF02, (void *)t2); in TestCase() 106 rc = pthread_join(threads[i], NULL); in TestCase()
|
/kernel/linux/linux-5.10/tools/perf/util/ |
H A D | values.c | 19 pr_debug("failed to allocate read_values threads arrays"); in perf_read_values_init() 22 values->threads = 0; in perf_read_values_init() 54 for (i = 0; i < values->threads; i++) in perf_read_values_destroy() 84 pr_debug("failed to enlarge read_values threads arrays"); in perf_read_values__enlarge_threads() 93 for (i = 0; i < values->threads; i++) in perf_read_values__findnew_thread() 97 if (values->threads == values->threads_max) { in perf_read_values__findnew_thread() 103 i = values->threads; in perf_read_values__findnew_thread() 112 values->threads = i + 1; in perf_read_values__findnew_thread() 134 for (i = 0; i < values->threads; i++) { in perf_read_values__enlarge_counters() 217 for (i = 0; i < values->threads; in perf_read_values__display_pretty() [all...] |