staticvoid sig_handler(int sig __maybe_unused)
{
exited = 1;
}
/* * evlist__prepare_workload will send a SIGUSR1 if the fork fails, since * we asked by setting its exec_error to this handler.
*/ staticvoid workload_exec_failed_signal(int signo __maybe_unused,
siginfo_t *info __maybe_unused, void *ucontext __maybe_unused)
{
exited = 1;
nr_exit = -1;
}
/* * This test will start a workload that does nothing then it checks * if the number of exit event reported by the kernel is 1 or not * in order to check the kernel returns correct number of event.
*/ staticint test__task_exit(struct test_suite *test __maybe_unused, int subtest __maybe_unused)
{ int err = -1; union perf_event *event; struct evsel *evsel; struct evlist *evlist; struct target target = {
.uses_mmap = true,
}; constchar *argv[] = { "true", NULL }; char sbuf[STRERR_BUFSIZE]; struct perf_cpu_map *cpus; struct perf_thread_map *threads; struct mmap *md; int retry_count = 0;
/* * Create maps of threads and cpus to monitor. In this case * we start with all threads and cpus (-1, -1) but then in * evlist__prepare_workload we'll fill in the only thread * we're monitoring, the one forked there.
*/
cpus = perf_cpu_map__new_any_cpu();
threads = thread_map__new_by_tid(-1); if (!cpus || !threads) {
err = -ENOMEM;
pr_debug("Not enough memory to create thread/cpu maps\n"); goto out_delete_evlist;
}
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.