staticint find_comm(struct evlist *evlist, constchar *comm)
{ union perf_event *event; struct mmap *md; int i, found;
found = 0; for (i = 0; i < evlist->core.nr_mmaps; i++) {
md = &evlist->mmap[i]; if (perf_mmap__read_init(&md->core) < 0) continue; while ((event = perf_mmap__read_event(&md->core)) != NULL) { if (event->header.type == PERF_RECORD_COMM &&
(pid_t)event->comm.pid == getpid() &&
(pid_t)event->comm.tid == getpid() &&
strcmp(event->comm.comm, comm) == 0)
found += 1;
perf_mmap__consume(&md->core);
}
perf_mmap__read_done(&md->core);
} return found;
}
/** * test__keep_tracking - test using a dummy software event to keep tracking. * * This function implements a test that checks that tracking events continue * when an event is disabled but a dummy software event is not disabled. If the * test passes %0 is returned, otherwise %-1 is returned.
*/ staticint test__keep_tracking(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ struct record_opts opts = {
.mmap_pages = UINT_MAX,
.user_freq = UINT_MAX,
.user_interval = ULLONG_MAX,
.target = {
.uses_mmap = true,
},
}; struct perf_thread_map *threads = NULL; struct perf_cpu_map *cpus = NULL; struct evlist *evlist = NULL; struct evsel *evsel = NULL; int found, err = -1; constchar *comm;
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.