Lines Matching refs:threads
68 struct perf_thread_map *threads;
74 threads = thread_map__new_event(&event->thread_map);
75 TEST_ASSERT_VAL("failed to alloc map", threads);
77 TEST_ASSERT_VAL("wrong nr", threads->nr == 1);
79 perf_thread_map__pid(threads, 0) == getpid());
81 perf_thread_map__comm(threads, 0) &&
82 !strcmp(perf_thread_map__comm(threads, 0), NAME));
84 refcount_read(&threads->refcnt) == 1);
85 perf_thread_map__put(threads);
91 struct perf_thread_map *threads;
97 threads = thread_map__new_by_pid(getpid());
98 TEST_ASSERT_VAL("failed to alloc map", threads);
100 thread_map__read_comms(threads);
103 !perf_event__synthesize_thread_map2(NULL, threads, process_event, NULL));
110 struct perf_thread_map *threads;
117 threads = thread_map__new_str(str, NULL, 0, false);
120 threads);
123 thread_map__fprintf(threads, stderr);
126 !thread_map__remove(threads, 0));
128 TEST_ASSERT_VAL("thread_map count != 1", threads->nr == 1);
131 thread_map__fprintf(threads, stderr);
134 !thread_map__remove(threads, 0));
136 TEST_ASSERT_VAL("thread_map count != 0", threads->nr == 0);
139 thread_map__fprintf(threads, stderr);
142 thread_map__remove(threads, 0));
144 for (i = 0; i < threads->nr; i++)
145 zfree(&threads->map[i].comm);
147 free(threads);