/tools/testing/selftests/bpf/prog_tests/ |
D | get_stackid_cannot_attach.c | 23 int pmu_fd, err; in test_get_stackid_cannot_attach() local 36 pmu_fd = syscall(__NR_perf_event_open, &attr, -1 /* pid */, in test_get_stackid_cannot_attach() 39 if (pmu_fd < 0 && (errno == ENOENT || errno == EOPNOTSUPP)) { in test_get_stackid_cannot_attach() 45 if (CHECK(pmu_fd < 0, "perf_event_open", "err %d errno %d\n", in test_get_stackid_cannot_attach() 46 pmu_fd, errno)) in test_get_stackid_cannot_attach() 50 pmu_fd); in test_get_stackid_cannot_attach() 52 close(pmu_fd); in test_get_stackid_cannot_attach() 57 pmu_fd = syscall(__NR_perf_event_open, &attr, -1 /* pid */, in test_get_stackid_cannot_attach() 61 if (CHECK(pmu_fd < 0, "perf_event_open", "err %d errno %d\n", in test_get_stackid_cannot_attach() 62 pmu_fd, errno)) in test_get_stackid_cannot_attach() [all …]
|
D | tp_attach_query.c | 7 int i, j, bytes, efd, err, prog_fd[num_progs], pmu_fd[num_progs]; in serial_test_tp_attach_query() local 60 pmu_fd[i] = syscall(__NR_perf_event_open, &attr, -1 /* pid */, in serial_test_tp_attach_query() 63 if (CHECK(pmu_fd[i] < 0, "perf_event_open", "err %d errno %d\n", in serial_test_tp_attach_query() 64 pmu_fd[i], errno)) in serial_test_tp_attach_query() 66 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_ENABLE, 0); in serial_test_tp_attach_query() 74 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_QUERY_BPF, query); in serial_test_tp_attach_query() 82 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_SET_BPF, prog_fd[i]); in serial_test_tp_attach_query() 90 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_QUERY_BPF, query); in serial_test_tp_attach_query() 99 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_QUERY_BPF, in serial_test_tp_attach_query() 108 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_QUERY_BPF, query); in serial_test_tp_attach_query() [all …]
|
D | send_signal.c | 19 int err = -1, pmu_fd = -1; in test_send_signal_common() local 103 pmu_fd = syscall(__NR_perf_event_open, attr, pid, -1 /* cpu */, in test_send_signal_common() 105 if (!ASSERT_GE(pmu_fd, 0, "perf_event_open")) { in test_send_signal_common() 111 bpf_program__attach_perf_event(skel->progs.send_signal_perf, pmu_fd); in test_send_signal_common() 142 close(pmu_fd); in test_send_signal_common() 175 int pmu_fd; in test_send_signal_nmi() local 180 pmu_fd = syscall(__NR_perf_event_open, &attr, 0 /* pid */, in test_send_signal_nmi() 182 if (pmu_fd == -1) { in test_send_signal_nmi() 191 close(pmu_fd); in test_send_signal_nmi()
|
D | task_fd_query_tp.c | 8 int err, bytes, efd, prog_fd, pmu_fd; in test_task_fd_query_tp_core() local 41 pmu_fd = syscall(__NR_perf_event_open, &attr, -1 /* pid */, in test_task_fd_query_tp_core() 47 err = ioctl(pmu_fd, PERF_EVENT_IOC_ENABLE, 0); in test_task_fd_query_tp_core() 52 err = ioctl(pmu_fd, PERF_EVENT_IOC_SET_BPF, prog_fd); in test_task_fd_query_tp_core() 59 err = bpf_task_fd_query(getpid(), pmu_fd, 0, buf, &len, &prog_id, in test_task_fd_query_tp_core() 71 close(pmu_fd); in test_task_fd_query_tp_core()
|
D | stacktrace_build_id_nmi.c | 9 int err, pmu_fd; in test_stacktrace_build_id_nmi() local 35 pmu_fd = syscall(__NR_perf_event_open, &attr, -1 /* pid */, in test_stacktrace_build_id_nmi() 38 if (pmu_fd < 0 && errno == ENOENT) { in test_stacktrace_build_id_nmi() 43 if (CHECK(pmu_fd < 0, "perf_event_open", "err %d errno %d\n", in test_stacktrace_build_id_nmi() 44 pmu_fd, errno)) in test_stacktrace_build_id_nmi() 48 pmu_fd); in test_stacktrace_build_id_nmi() 50 close(pmu_fd); in test_stacktrace_build_id_nmi()
|
D | perf_event_stackmap.c | 73 int pmu_fd, err; in test_perf_event_stackmap() local 90 pmu_fd = syscall(__NR_perf_event_open, &attr, -1 /* pid */, in test_perf_event_stackmap() 93 if (pmu_fd < 0) { in test_perf_event_stackmap() 100 pmu_fd); in test_perf_event_stackmap() 102 close(pmu_fd); in test_perf_event_stackmap()
|
/tools/testing/selftests/bpf/ |
D | get_cgroup_id_user.c | 52 int err, bytes, efd, prog_fd, pmu_fd; in main() local 114 pmu_fd = syscall(__NR_perf_event_open, &attr, getpid(), -1, -1, 0); in main() 115 if (CHECK(pmu_fd < 0, "perf_event_open", "err %d errno %d\n", pmu_fd, in main() 119 err = ioctl(pmu_fd, PERF_EVENT_IOC_ENABLE, 0); in main() 124 err = ioctl(pmu_fd, PERF_EVENT_IOC_SET_BPF, prog_fd); in main() 145 close(pmu_fd); in main()
|
/tools/bpf/bpftool/ |
D | prog.c | 2272 int pmu_fd; in profile_open_perf_event() local 2274 pmu_fd = syscall(__NR_perf_event_open, &metrics[mid].attr, in profile_open_perf_event() 2276 if (pmu_fd < 0) { in profile_open_perf_event() 2288 &pmu_fd, BPF_ANY) || in profile_open_perf_event() 2289 ioctl(pmu_fd, PERF_EVENT_IOC_ENABLE, 0)) { in profile_open_perf_event() 2290 close(pmu_fd); in profile_open_perf_event() 2294 profile_perf_events[profile_perf_event_cnt++] = pmu_fd; in profile_open_perf_event()
|