Home
last modified time | relevance | path

Searched refs:threads (Results 1 – 25 of 105) sorted by relevance

12345

/tools/perf/util/
Dthread_map.c35 struct perf_thread_map *threads; in thread_map__new_by_pid() local
46 threads = thread_map__alloc(items); in thread_map__new_by_pid()
47 if (threads != NULL) { in thread_map__new_by_pid()
49 perf_thread_map__set_pid(threads, i, atoi(namelist[i]->d_name)); in thread_map__new_by_pid()
50 threads->nr = items; in thread_map__new_by_pid()
51 refcount_set(&threads->refcnt, 1); in thread_map__new_by_pid()
58 return threads; in thread_map__new_by_pid()
63 struct perf_thread_map *threads = thread_map__alloc(1); in thread_map__new_by_tid() local
65 if (threads != NULL) { in thread_map__new_by_tid()
66 perf_thread_map__set_pid(threads, 0, tid); in thread_map__new_by_tid()
[all …]
Dthread_map.h26 size_t thread_map__fprintf(struct perf_thread_map *threads, FILE *fp);
28 void thread_map__read_comms(struct perf_thread_map *threads);
29 bool thread_map__has(struct perf_thread_map *threads, pid_t pid);
30 int thread_map__remove(struct perf_thread_map *threads, int idx);
/tools/perf/tests/
Dthread-map.c68 struct perf_thread_map *threads; in process_event() local
74 threads = thread_map__new_event(&event->thread_map); in process_event()
75 TEST_ASSERT_VAL("failed to alloc map", threads); in process_event()
77 TEST_ASSERT_VAL("wrong nr", threads->nr == 1); in process_event()
79 perf_thread_map__pid(threads, 0) == getpid()); in process_event()
81 perf_thread_map__comm(threads, 0) && in process_event()
82 !strcmp(perf_thread_map__comm(threads, 0), NAME)); in process_event()
84 refcount_read(&threads->refcnt) == 1); in process_event()
85 perf_thread_map__put(threads); in process_event()
91 struct perf_thread_map *threads; in test__thread_map_synthesize() local
[all …]
Devent-times.c62 struct perf_thread_map *threads; in attach__current_disabled() local
67 threads = thread_map__new(-1, getpid(), UINT_MAX); in attach__current_disabled()
68 if (threads == NULL) { in attach__current_disabled()
75 err = evsel__open_per_thread(evsel, threads); in attach__current_disabled()
81 perf_thread_map__put(threads); in attach__current_disabled()
88 struct perf_thread_map *threads; in attach__current_enabled() local
93 threads = thread_map__new(-1, getpid(), UINT_MAX); in attach__current_enabled()
94 if (threads == NULL) { in attach__current_enabled()
99 err = evsel__open_per_thread(evsel, threads); in attach__current_enabled()
101 perf_thread_map__put(threads); in attach__current_enabled()
Dtask-exit.c55 struct perf_thread_map *threads; in test__task_exit() local
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()
84 threads = NULL; in test__task_exit()
154 perf_thread_map__put(threads); in test__task_exit()
Dsw-clock.c46 struct perf_thread_map *threads; in __test__sw_clock_freq() local
65 threads = thread_map__new_by_tid(getpid()); in __test__sw_clock_freq()
66 if (!cpus || !threads) { in __test__sw_clock_freq()
72 perf_evlist__set_maps(&evlist->core, cpus, threads); in __test__sw_clock_freq()
75 threads = NULL; in __test__sw_clock_freq()
134 perf_thread_map__put(threads); in __test__sw_clock_freq()
Dopenat-syscall.c21 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()
Dmmap-basic.c36 struct perf_thread_map *threads; in test__basic_mmap() local
49 threads = thread_map__new(-1, getpid(), UINT_MAX); in test__basic_mmap()
50 if (threads == NULL) { in test__basic_mmap()
76 perf_evlist__set_maps(&evlist->core, cpus, threads); in test__basic_mmap()
93 if (evsel__open(evsels[i], cpus, threads) < 0) { in test__basic_mmap()
162 threads = NULL; in test__basic_mmap()
166 perf_thread_map__put(threads); in test__basic_mmap()
/tools/lib/perf/
Dthreadmap.c47 struct perf_thread_map *threads = thread_map__alloc(1); in perf_thread_map__new_dummy() local
49 if (threads != NULL) { in perf_thread_map__new_dummy()
50 perf_thread_map__set_pid(threads, 0, -1); in perf_thread_map__new_dummy()
51 threads->nr = 1; in perf_thread_map__new_dummy()
52 refcount_set(&threads->refcnt, 1); in perf_thread_map__new_dummy()
54 return threads; in perf_thread_map__new_dummy()
57 static void perf_thread_map__delete(struct perf_thread_map *threads) in perf_thread_map__delete() argument
59 if (threads) { in perf_thread_map__delete()
62 WARN_ONCE(refcount_read(&threads->refcnt) != 0, in perf_thread_map__delete()
64 for (i = 0; i < threads->nr; i++) in perf_thread_map__delete()
[all …]
/tools/lib/perf/tests/
Dtest-threadmap.c15 struct perf_thread_map *threads; in main() local
21 threads = perf_thread_map__new_dummy(); in main()
22 if (!threads) in main()
25 perf_thread_map__get(threads); in main()
26 perf_thread_map__put(threads); in main()
27 perf_thread_map__put(threads); in main()
Dtest-evsel.c52 struct perf_thread_map *threads; in test_stat_thread() local
60 threads = perf_thread_map__new_dummy(); in test_stat_thread()
61 __T("failed to create threads", threads); in test_stat_thread()
63 perf_thread_map__set_pid(threads, 0, 0); in test_stat_thread()
68 err = perf_evsel__open(evsel, NULL, threads); in test_stat_thread()
77 perf_thread_map__put(threads); in test_stat_thread()
84 struct perf_thread_map *threads; in test_stat_thread_enable() local
93 threads = perf_thread_map__new_dummy(); in test_stat_thread_enable()
94 __T("failed to create threads", threads); in test_stat_thread_enable()
96 perf_thread_map__set_pid(threads, 0, 0); in test_stat_thread_enable()
[all …]
Dtest-evlist.c85 struct perf_thread_map *threads; in test_stat_thread() local
98 threads = perf_thread_map__new_dummy(); in test_stat_thread()
99 __T("failed to create threads", threads); in test_stat_thread()
101 perf_thread_map__set_pid(threads, 0, 0); in test_stat_thread()
116 perf_evlist__set_maps(evlist, NULL, threads); in test_stat_thread()
129 perf_thread_map__put(threads); in test_stat_thread()
136 struct perf_thread_map *threads; in test_stat_thread_enable() local
151 threads = perf_thread_map__new_dummy(); in test_stat_thread_enable()
152 __T("failed to create threads", threads); in test_stat_thread_enable()
154 perf_thread_map__set_pid(threads, 0, 0); in test_stat_thread_enable()
[all …]
/tools/testing/selftests/powerpc/math/
Dfpu_preempt.c58 int i, rc, threads; in test_preempt_fpu() local
61 threads = sysconf(_SC_NPROCESSORS_ONLN) * THREAD_FACTOR; in test_preempt_fpu()
62 tids = malloc((threads) * sizeof(pthread_t)); in test_preempt_fpu()
66 threads_starting = threads; in test_preempt_fpu()
67 for (i = 0; i < threads; i++) { in test_preempt_fpu()
89 for (i = 0; i < threads; i++) { in test_preempt_fpu()
Dvmx_preempt.c59 int i, rc, threads; in test_preempt_vmx() local
65 threads = sysconf(_SC_NPROCESSORS_ONLN) * THREAD_FACTOR; in test_preempt_vmx()
66 tids = malloc(threads * sizeof(pthread_t)); in test_preempt_vmx()
70 threads_starting = threads; in test_preempt_vmx()
71 for (i = 0; i < threads; i++) { in test_preempt_vmx()
93 for (i = 0; i < threads; i++) { in test_preempt_vmx()
Dfpu_signal.c77 int i, j, rc, threads; in test_signal_fpu() local
81 threads = sysconf(_SC_NPROCESSORS_ONLN) * THREAD_FACTOR; in test_signal_fpu()
82 tids = malloc(threads * sizeof(pthread_t)); in test_signal_fpu()
86 threads_starting = threads; in test_signal_fpu()
87 for (i = 0; i < threads; i++) { in test_signal_fpu()
100 for (j = 0; j < threads; j++) { in test_signal_fpu()
109 for (i = 0; i < threads; i++) { in test_signal_fpu()
Dvmx_signal.c95 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()
124 for (j = 0; j < threads; j++) { in test_signal_vmx()
133 for (i = 0; i < threads; i++) { in test_signal_vmx()
Dvsx_preempt.c92 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()
/tools/testing/selftests/powerpc/tm/
Dtm-vmx-unavail.c91 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()
/tools/lib/perf/Documentation/examples/
Dcounting.c23 struct perf_thread_map *threads; in main() local
40 threads = perf_thread_map__new_dummy(); in main()
41 if (!threads) { 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()
/tools/perf/python/
Dtwatch.py13 threads = perf.thread_map(thread)
28 evsel.open(cpus = cpus, threads = threads);
29 evlist = perf.evlist(cpus, threads)
/tools/testing/radix-tree/
Diteration_check.c15 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()
Diteration_check_2.c56 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()
/tools/perf/bench/
Dsynthesize.c62 struct perf_thread_map *threads, in do_run_single_threaded() argument
81 target, threads, in do_run_single_threaded()
116 struct perf_thread_map *threads; in run_single_threaded() local
125 threads = thread_map__new_by_pid(getpid()); in run_single_threaded()
126 if (!threads) { in run_single_threaded()
136 err = do_run_single_threaded(session, threads, &target, false); in run_single_threaded()
140 err = do_run_single_threaded(session, threads, &target, true); in run_single_threaded()
143 if (threads) in run_single_threaded()
144 perf_thread_map__put(threads); in run_single_threaded()
Dsched-pipe.c79 struct thread_data threads[2], *td; in bench_sched_pipe() local
102 td = threads + t; in bench_sched_pipe()
119 td = threads + t; in bench_sched_pipe()
126 td = threads + t; in bench_sched_pipe()
137 worker_thread(threads + 0); in bench_sched_pipe()
140 worker_thread(threads + 1); in bench_sched_pipe()
/tools/testing/selftests/sync/
Dsync_stress_consumer.c56 int threads; member
112 int n = test_data_mpsc.threads; 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()

12345