/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 test_tp_attach_query() local 54 pmu_fd[i] = syscall(__NR_perf_event_open, &attr, -1 /* pid */, in test_tp_attach_query() 57 if (CHECK(pmu_fd[i] < 0, "perf_event_open", "err %d errno %d\n", in test_tp_attach_query() 58 pmu_fd[i], errno)) in test_tp_attach_query() 60 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_ENABLE, 0); in test_tp_attach_query() 68 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_QUERY_BPF, query); in test_tp_attach_query() 76 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_SET_BPF, prog_fd[i]); in test_tp_attach_query() 84 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_QUERY_BPF, query); in test_tp_attach_query() 93 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_QUERY_BPF, in test_tp_attach_query() 102 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_QUERY_BPF, query); in test_tp_attach_query() [all …]
|
D | send_signal.c | 19 int err = -1, pmu_fd = -1; in test_send_signal_common() local 96 pmu_fd = syscall(__NR_perf_event_open, attr, pid, -1, in test_send_signal_common() 98 if (!ASSERT_GE(pmu_fd, 0, "perf_event_open")) { in test_send_signal_common() 104 bpf_program__attach_perf_event(skel->progs.send_signal_perf, pmu_fd); in test_send_signal_common() 135 close(pmu_fd); in test_send_signal_common() 167 int pmu_fd; in test_send_signal_nmi() local 172 pmu_fd = syscall(__NR_perf_event_open, &attr, 0 /* pid */, in test_send_signal_nmi() 174 if (pmu_fd == -1) { in test_send_signal_nmi() 183 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 36 pmu_fd = syscall(__NR_perf_event_open, &attr, -1 /* pid */, in test_task_fd_query_tp_core() 42 err = ioctl(pmu_fd, PERF_EVENT_IOC_ENABLE, 0); in test_task_fd_query_tp_core() 47 err = ioctl(pmu_fd, PERF_EVENT_IOC_SET_BPF, prog_fd); in test_task_fd_query_tp_core() 54 err = bpf_task_fd_query(getpid(), pmu_fd, 0, buf, &len, &prog_id, in test_task_fd_query_tp_core() 66 close(pmu_fd); in test_task_fd_query_tp_core()
|
D | stacktrace_build_id_nmi.c | 24 int err, pmu_fd; in test_stacktrace_build_id_nmi() local 51 pmu_fd = syscall(__NR_perf_event_open, &attr, -1 /* pid */, in test_stacktrace_build_id_nmi() 54 if (pmu_fd < 0 && errno == ENOENT) { in test_stacktrace_build_id_nmi() 59 if (CHECK(pmu_fd < 0, "perf_event_open", "err %d errno %d\n", in test_stacktrace_build_id_nmi() 60 pmu_fd, errno)) in test_stacktrace_build_id_nmi() 64 pmu_fd); in test_stacktrace_build_id_nmi() 66 close(pmu_fd); in test_stacktrace_build_id_nmi()
|
D | perf_event_stackmap.c | 72 int pmu_fd, err; in test_perf_event_stackmap() local 89 pmu_fd = syscall(__NR_perf_event_open, &attr, -1 /* pid */, in test_perf_event_stackmap() 92 if (pmu_fd < 0) { in test_perf_event_stackmap() 99 pmu_fd); in test_perf_event_stackmap() 101 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 106 pmu_fd = syscall(__NR_perf_event_open, &attr, getpid(), -1, -1, 0); in main() 107 if (CHECK(pmu_fd < 0, "perf_event_open", "err %d errno %d\n", pmu_fd, in main() 111 err = ioctl(pmu_fd, PERF_EVENT_IOC_ENABLE, 0); in main() 116 err = ioctl(pmu_fd, PERF_EVENT_IOC_SET_BPF, prog_fd); in main() 137 close(pmu_fd); in main()
|
/tools/bpf/bpftool/ |
D | prog.c | 2069 int pmu_fd; in profile_open_perf_event() local 2071 pmu_fd = syscall(__NR_perf_event_open, &metrics[mid].attr, in profile_open_perf_event() 2073 if (pmu_fd < 0) { in profile_open_perf_event() 2085 &pmu_fd, BPF_ANY) || in profile_open_perf_event() 2086 ioctl(pmu_fd, PERF_EVENT_IOC_ENABLE, 0)) { in profile_open_perf_event() 2087 close(pmu_fd); in profile_open_perf_event() 2091 profile_perf_events[profile_perf_event_cnt++] = pmu_fd; in profile_open_perf_event()
|