/* Configure the perf event to signal on sample. */
err = fcntl(perf_fd, F_SETFL, O_ASYNC); if (!ASSERT_OK(err, "fcntl(F_SETFL, O_ASYNC)")) goto cleanup;
/* Allow at most one sample. A sample rejected by bpf should * not count against this.
*/
err = ioctl(perf_fd, PERF_EVENT_IOC_REFRESH, 1); if (!ASSERT_OK(err, "ioctl(PERF_EVENT_IOC_REFRESH)")) goto cleanup;
prog_link = bpf_program__attach_perf_event(skel->progs.handler, perf_fd); if (!ASSERT_OK_PTR(prog_link, "bpf_program__attach_perf_event")) goto cleanup;
/* Configure the bpf program to suppress the sample. */
skel->bss->ip = (uintptr_t)test_function;
test_function();
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.