/linux/tools/perf/util/ |
H A D | thread_map.c | 36 struct perf_thread_map *threads; in thread_map__new_by_pid() local 47 threads = thread_map__alloc(items); in thread_map__new_by_pid() 48 if (threads != NULL) { in thread_map__new_by_pid() 50 perf_thread_map__set_pid(threads, i, atoi(namelist[i]->d_name)); in thread_map__new_by_pid() 51 threads->nr = items; in thread_map__new_by_pid() 52 refcount_set(&threads->refcnt, 1); in thread_map__new_by_pid() 59 return threads; in thread_map__new_by_pid() 64 struct perf_thread_map *threads = thread_map__alloc(1); in thread_map__new_by_tid() local 66 if (threads != NULL) { in thread_map__new_by_tid() 67 perf_thread_map__set_pid(threads, in thread_map__new_by_tid() 81 struct perf_thread_map *threads = thread_map__alloc(max_threads); thread_map__new_all_cpus() local 161 struct perf_thread_map *threads = NULL, *nt; thread_map__new_by_pid_str() local 223 struct perf_thread_map *threads = NULL, *nt; thread_map__new_by_tid_str() local 281 thread_map__fprintf(struct perf_thread_map * threads,FILE * fp) thread_map__fprintf() argument 337 thread_map__read_comms(struct perf_thread_map * threads) thread_map__read_comms() argument 345 thread_map__copy_event(struct perf_thread_map * threads,struct perf_record_thread_map * event) thread_map__copy_event() argument 362 struct perf_thread_map *threads; thread_map__new_event() local 371 thread_map__has(struct perf_thread_map * threads,pid_t pid) thread_map__has() argument 383 thread_map__remove(struct perf_thread_map * threads,int idx) thread_map__remove() argument [all...] |
H A D | threads.h | 20 struct threads { struct 24 void threads__init(struct threads *threads); 25 void threads__exit(struct threads *threads); 26 size_t threads__nr(struct threads *threads); 27 struct thread *threads__find(struct threads *threads, pid_t tid); 28 struct thread *threads__findnew(struct threads *thread 21 tablethreads global() argument [all...] |
H A D | threads.c | 2 #include "threads.h" 6 static struct threads_table_entry *threads__table(struct threads *threads, pid_t tid) in threads__table() argument 9 return &threads->table[(unsigned int)tid % THREADS__TABLE_SIZE]; in threads__table() 23 void threads__init(struct threads *threads) in threads__init() argument 26 struct threads_table_entry *table = &threads->table[i]; in threads__init() 34 void threads__exit(struct threads *threads) in threads__exit() argument 36 threads__remove_all_threads(threads); in threads__exit() 45 threads__nr(struct threads * threads) threads__nr() argument 92 threads__find(struct threads * threads,pid_t tid) threads__find() argument 109 threads__findnew(struct threads * threads,pid_t pid,pid_t tid,bool * created) threads__findnew() argument 135 threads__remove_all_threads(struct threads * threads) threads__remove_all_threads() argument 154 threads__remove(struct threads * threads,struct thread * thread) threads__remove() argument 168 threads__for_each_thread(struct threads * threads,int (* fn)(struct thread * thread,void * data),void * data) threads__for_each_thread() argument [all...] |
H A D | thread_map.h | 22 size_t thread_map__fprintf(struct perf_thread_map *threads, FILE *fp); 24 void thread_map__read_comms(struct perf_thread_map *threads); 25 bool thread_map__has(struct perf_thread_map *threads, pid_t pid); 26 int thread_map__remove(struct perf_thread_map *threads, int idx);
|
H A D | values.c | 20 pr_debug("failed to allocate read_values threads arrays"); in perf_read_values_init() 23 values->threads = 0; in perf_read_values_init() 51 for (i = 0; i < values->threads; i++) in perf_read_values_destroy() 78 pr_debug("failed to enlarge read_values threads arrays"); in perf_read_values__enlarge_threads() 87 for (i = 0; i < values->threads; i++) in perf_read_values__findnew_thread() 91 if (values->threads == values->threads_max) { in perf_read_values__findnew_thread() 97 i = values->threads; in perf_read_values__findnew_thread() 106 values->threads = i + 1; in perf_read_values__findnew_thread() 122 for (int i = 0; i < values->threads; i++) { in perf_read_values__enlarge_counters() 201 for (i = 0; i < values->threads; in perf_read_values__display_pretty() [all...] |
/linux/tools/lib/perf/ |
H A D | threadmap.c | 47 struct perf_thread_map *threads = thread_map__alloc(nr_threads); in perf_thread_map__new_array() local 50 if (!threads) in perf_thread_map__new_array() 54 perf_thread_map__set_pid(threads, i, array ? array[i] : -1); in perf_thread_map__new_array() 56 threads->nr = nr_threads; in perf_thread_map__new_array() 57 refcount_set(&threads->refcnt, 1); in perf_thread_map__new_array() 59 return threads; in perf_thread_map__new_array() 67 static void perf_thread_map__delete(struct perf_thread_map *threads) in perf_thread_map__delete() argument 69 if (threads) { in perf_thread_map__delete() 72 WARN_ONCE(refcount_read(&threads->refcnt) != 0, in perf_thread_map__delete() 74 for (i = 0; i < threads in perf_thread_map__delete() 93 perf_thread_map__nr(struct perf_thread_map * threads) perf_thread_map__nr() argument 108 perf_thread_map__idx(struct perf_thread_map * threads,pid_t pid) perf_thread_map__idx() argument [all...] |
/linux/tools/lib/perf/tests/ |
H A D | test-threadmap.c | 16 struct perf_thread_map *threads; in test_threadmap_array() local 19 threads = perf_thread_map__new_array(nr, array); in test_threadmap_array() 20 __T("Failed to allocate new thread map", threads); in test_threadmap_array() 22 __T("Unexpected number of threads", perf_thread_map__nr(threads) == nr); in test_threadmap_array() 26 perf_thread_map__pid(threads, i) == (array ? array[i] : -1)); in test_threadmap_array() 30 perf_thread_map__set_pid(threads, i, i * 100); in test_threadmap_array() 33 perf_thread_map__pid(threads, 0) == (array ? array[0] : -1)); in test_threadmap_array() 37 perf_thread_map__pid(threads, i) == i * 100); in test_threadmap_array() 40 perf_thread_map__put(threads); in test_threadmap_array() 48 struct perf_thread_map *threads; test_threadmap() local [all...] |
H A D | test-evsel.c | 56 struct perf_thread_map *threads; in test_stat_thread() local 64 threads = perf_thread_map__new_dummy(); in test_stat_thread() 65 __T("failed to create threads", threads); in test_stat_thread() 67 perf_thread_map__set_pid(threads, 0, 0); in test_stat_thread() 72 err = perf_evsel__open(evsel, NULL, threads); in test_stat_thread() 81 perf_thread_map__put(threads); in test_stat_thread() 88 struct perf_thread_map *threads; in test_stat_thread_enable() local 97 threads = perf_thread_map__new_dummy(); in test_stat_thread_enable() 98 __T("failed to create threads", thread in test_stat_thread_enable() 130 struct perf_thread_map *threads; test_stat_user_read() local 195 test_stat_read_format_single(struct perf_event_attr * attr,struct perf_thread_map * threads) test_stat_read_format_single() argument 230 test_stat_read_format_group(struct perf_event_attr * attr,struct perf_thread_map * threads) test_stat_read_format_group() argument 293 struct perf_thread_map *threads; test_stat_read_format() local [all...] |
H A D | test-evlist.c | 95 struct perf_thread_map *threads; in test_stat_thread() local 108 threads = perf_thread_map__new_dummy(); in test_stat_thread() 109 __T("failed to create threads", threads); in test_stat_thread() 111 perf_thread_map__set_pid(threads, 0, 0); in test_stat_thread() 130 perf_evlist__set_maps(evlist, NULL, threads); in test_stat_thread() 143 perf_thread_map__put(threads); in test_stat_thread() 150 struct perf_thread_map *threads; in test_stat_thread_enable() local 165 threads = perf_thread_map__new_dummy(); in test_stat_thread_enable() 166 __T("failed to create threads", thread in test_stat_thread_enable() 219 struct perf_thread_map *threads; test_mmap_thread() local 443 struct perf_thread_map *threads; test_stat_multiplexing() local [all...] |
/linux/tools/perf/bench/ |
H A D | breakpoint.c | 33 OPT_UINTEGER('t', "threads", &thread_params.nthreads, "Specify amount of threads"), 89 pthread_t *threads; in breakpoint_thread() local 91 threads = calloc(thread_params.nthreads, sizeof(threads[0])); in breakpoint_thread() 92 if (!threads) in breakpoint_thread() 98 if (pthread_create(&threads[i], NULL, passive_thread, &done)) in breakpoint_thread() 104 pthread_join(threads[i], NULL); in breakpoint_thread() 106 free(threads); in breakpoint_thread() 111 // then starts nparallel threads whic 203 pthread_t *threads; bench_breakpoint_enable() local [all...] |
/linux/tools/perf/tests/ |
H A D | event-times.c | 60 struct perf_thread_map *threads; in attach__current_disabled() local 65 threads = thread_map__new_by_tid(getpid()); in attach__current_disabled() 66 if (threads == NULL) { in attach__current_disabled() 73 err = evsel__open_per_thread(evsel, threads); in attach__current_disabled() 79 perf_thread_map__put(threads); in attach__current_disabled() 86 struct perf_thread_map *threads; in attach__current_enabled() local 91 threads = thread_map__new_by_tid(getpid()); in attach__current_enabled() 92 if (threads == NULL) { in attach__current_enabled() 97 err = evsel__open_per_thread(evsel, threads); in attach__current_enabled() 99 perf_thread_map__put(threads); in attach__current_enabled() [all...] |
/linux/tools/testing/selftests/powerpc/math/ |
H A D | fpu_signal.c | 27 * worker threads 73 int i, j, rc, threads; in test_signal_fpu() local 77 threads = sysconf(_SC_NPROCESSORS_ONLN) * THREAD_FACTOR; in test_signal_fpu() 78 tids = malloc(threads * sizeof(pthread_t)); in test_signal_fpu() 82 threads_starting = threads; in test_signal_fpu() 83 for (i = 0; i < threads; i++) { in test_signal_fpu() 94 printf("\tSending signals to all threads %d times...", ITERATIONS); in test_signal_fpu() 96 for (j = 0; j < threads; j++) { in test_signal_fpu() 105 for (i = 0; i < threads; i++) { in test_signal_fpu()
|
H A D | vmx_signal.c | 28 * worker threads 95 int i, j, rc, threads; in test_signal_vmx() local 102 threads = sysconf(_SC_NPROCESSORS_ONLN) * THREAD_FACTOR; in test_signal_vmx() 103 tids = malloc(threads * sizeof(pthread_t)); in test_signal_vmx() 107 threads_starting = threads; in test_signal_vmx() 108 for (i = 0; i < threads; i++) { in test_signal_vmx() 114 printf("\tWaiting for %d workers to start... %d", threads, threads_starting); in test_signal_vmx() 122 printf("\tSending signals to all threads %d times...", ITERATIONS); in test_signal_vmx() 124 for (j = 0; j < threads; j++) { in test_signal_vmx() 133 for (i = 0; i < threads; in test_signal_vmx() [all...] |
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()
|
/linux/tools/lib/perf/Documentation/examples/ |
H A D | counting.c | 23 struct perf_thread_map *threads; in main() local 40 threads = perf_thread_map__new_dummy(); in main() 41 if (!threads) { in main() 42 fprintf(stderr, "failed to create threads\n"); in main() 45 perf_thread_map__set_pid(threads, 0, 0); in main() 63 perf_evlist__set_maps(evlist, NULL, threads); in main() 81 perf_thread_map__put(threads); in main()
|
/linux/tools/testing/selftests/powerpc/tm/ |
H A D | tm-vmx-unavail.c | 90 int threads; in tm_vmx_unavail_test() local 98 threads = sysconf(_SC_NPROCESSORS_ONLN) * 4; in tm_vmx_unavail_test() 99 thread = malloc(sizeof(pthread_t)*threads); in tm_vmx_unavail_test() 103 for (uint64_t i = 0; i < threads; i++) in tm_vmx_unavail_test() 106 for (uint64_t i = 0; i < threads; i++) in tm_vmx_unavail_test()
|
/linux/tools/testing/selftests/sched_ext/ |
H A D | reload_loop.c | 15 static pthread_t threads[2]; variable 49 err = pthread_create(&threads[0], NULL, do_reload_loop, NULL); in run() 52 err = pthread_create(&threads[1], NULL, do_reload_loop, NULL); in run() 55 SCX_FAIL_IF(pthread_join(threads[0], &ret), "thread 0 failed"); in run() 56 SCX_FAIL_IF(pthread_join(threads[1], &ret), "thread 1 failed"); in run()
|
/linux/tools/testing/radix-tree/ |
H A D | iteration_check.c | 15 static pthread_t threads[NUM_THREADS]; variable 178 if (pthread_create(&threads[0], NULL, tagged_iteration_fn, NULL)) { in iteration_test() 182 if (pthread_create(&threads[1], NULL, untagged_iteration_fn, NULL)) { in iteration_test() 186 if (pthread_create(&threads[2], NULL, add_entries_fn, NULL)) { in iteration_test() 190 if (pthread_create(&threads[3], NULL, remove_entries_fn, NULL)) { in iteration_test() 194 if (pthread_create(&threads[4], NULL, tag_entries_fn, NULL)) { in iteration_test() 203 if (pthread_join(threads[i], NULL)) { in iteration_test()
|
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()
|
/linux/drivers/gpu/drm/i915/gt/ |
H A D | selftest_slpc.c | 499 struct slpc_thread *threads; in live_slpc_tile_interaction() local 502 threads = kcalloc(I915_MAX_GT, sizeof(*threads), GFP_KERNEL); in live_slpc_tile_interaction() 503 if (!threads) in live_slpc_tile_interaction() 507 threads[i].worker = kthread_run_worker(0, "igt/slpc_parallel:%d", gt->info.id); in live_slpc_tile_interaction() 509 if (IS_ERR(threads[i].worker)) { in live_slpc_tile_interaction() 510 ret = PTR_ERR(threads[i].worker); in live_slpc_tile_interaction() 514 threads[i].gt = gt; in live_slpc_tile_interaction() 515 kthread_init_work(&threads[i].work, slpc_spinner_thread); in live_slpc_tile_interaction() 516 kthread_queue_work(threads[ in live_slpc_tile_interaction() [all...] |
/linux/Documentation/driver-api/dmaengine/ |
H A D | dmatest.rst | 16 test multiple channels at the same time, and it can start multiple threads 73 (shared) parameters used for all threads will use the new values. 74 After the channels are specified, each thread is set as pending. All threads 82 Once started a message like " dmatest: Added 1 threads using dma0chan0" is 171 dmatest: Added 1 threads using dma0chan2 179 dmatest: Added 1 threads using dma0chan1 181 dmatest: Added 1 threads using dma0chan2 191 dmatest: Added 1 threads using dma0chan0 192 dmatest: Added 1 threads using dma0chan3 193 dmatest: Added 1 threads usin [all...] |
/linux/tools/testing/selftests/mm/ |
H A D | migration.c | 28 pthread_t *threads; in FIXTURE() local 54 self->threads = malloc(self->nthreads * sizeof(*self->threads)); in FIXTURE_SETUP() 55 ASSERT_NE(self->threads, NULL); in FIXTURE_SETUP() 62 free(self->threads); in FIXTURE_TEARDOWN() 121 * between nodes whilst other threads try and access them triggering the 130 SKIP(return, "Not enough threads or NUMA nodes available"); 138 if (pthread_create(&self->threads[i], NULL, access_mem, ptr)) 143 ASSERT_EQ(pthread_cancel(self->threads[i]), 0); 156 SKIP(return, "Not enough threads o [all...] |
/linux/Documentation/arch/x86/ |
H A D | topology.rst | 24 threads, cores, packages, etc. 37 - threads 52 The number of threads in a package. 97 A core consists of 1 or more threads. It does not matter whether the threads 98 are SMT- or CMT-type threads. 108 AMDs nomenclature for CMT threads is "Compute Unit Core". The kernel always 115 The cpumask contains all online threads in the package to which a thread 118 The number of online threads is also printed in /proc/cpuinfo "siblings." 122 The cpumask contains all online threads i [all...] |
/linux/tools/testing/selftests/powerpc/dscr/ |
H A D | dscr_default_test.c | 6 * it's sysfs interface and then verifies that all threads 121 struct random_thread_args threads[THREADS]; in dscr_default_random_test() local 137 threads[i].expected_system_dscr = &expected_system_dscr; in dscr_default_random_test() 138 threads[i].rw_lock = &rw_lock; in dscr_default_random_test() 139 threads[i].barrier = &barrier; in dscr_default_random_test() 141 FAIL_IF(pthread_create(&threads[i].thread_id, NULL, in dscr_default_random_test() 142 dscr_default_random_thread, (void *)&threads[i])); in dscr_default_random_test() 146 FAIL_IF(pthread_join(threads[i].thread_id, NULL)); in dscr_default_random_test()
|
/linux/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()
|