staticvoid *thread_fn(void *arg)
{ struct thread_data *td = arg;
ssize_t ret; int go = 0;
if (thread_init(td)) return NULL;
/* Signal thread_create thread is initialized. */
ret = write(td->ready[1], &go, sizeof(int)); if (ret != sizeof(int)) {
pr_err("failed to notify\n"); return NULL;
}
while (!go_away) { /* Waiting for main thread to kill us. */
usleep(100);
}
/* * The threads_create will not return before all threads * are spawned and all created memory map. * * They will loop until threads_destroy is called, so we * can safely run synthesizing function.
*/
TEST_ASSERT_VAL("failed to create threads", !threads_create());
TEST_ASSERT_VAL("failed to destroy threads", !threads_destroy());
TEST_ASSERT_VAL("failed to synthesize maps", !err);
/* * All data is synthesized, try to find map for each * thread object.
*/ for (i = 0; i < THREADS; i++) { struct thread_data *td = &threads[i]; struct addr_location al; struct thread *thread;
/* * This test creates 'THREADS' number of threads (including * main thread) and each thread creates memory map. * * When threads are created, we synthesize them with both * (separate tests): * perf_event__synthesize_thread_map (process based) * perf_event__synthesize_threads (global) * * We test we can find all memory maps via: * thread__find_map * * by using all thread objects.
*/ staticint test__mmap_thread_lookup(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ /* perf_event__synthesize_threads synthesize */
TEST_ASSERT_VAL("failed with synthesizing all",
!mmap_events(synth_all));
/* perf_event__synthesize_thread_map synthesize */
TEST_ASSERT_VAL("failed with synthesizing process",
!mmap_events(synth_process));
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.