/linux-6.1.9/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 54 pmu_fd[i] = syscall(__NR_perf_event_open, &attr, -1 /* pid */, in serial_test_tp_attach_query() 57 if (CHECK(pmu_fd[i] < 0, "perf_event_open", "err %d errno %d\n", in serial_test_tp_attach_query() 58 pmu_fd[i], errno)) in serial_test_tp_attach_query() 60 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_ENABLE, 0); in serial_test_tp_attach_query() 68 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_QUERY_BPF, query); in serial_test_tp_attach_query() 76 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_SET_BPF, prog_fd[i]); in serial_test_tp_attach_query() 84 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_QUERY_BPF, query); in serial_test_tp_attach_query() 93 err = ioctl(pmu_fd[i], PERF_EVENT_IOC_QUERY_BPF, in serial_test_tp_attach_query() 102 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 99 pmu_fd = syscall(__NR_perf_event_open, attr, pid, -1 /* cpu */, in test_send_signal_common() 101 if (!ASSERT_GE(pmu_fd, 0, "perf_event_open")) { in test_send_signal_common() 107 bpf_program__attach_perf_event(skel->progs.send_signal_perf, pmu_fd); in test_send_signal_common() 138 close(pmu_fd); in test_send_signal_common() 170 int pmu_fd; in test_send_signal_nmi() local 175 pmu_fd = syscall(__NR_perf_event_open, &attr, 0 /* pid */, in test_send_signal_nmi() 177 if (pmu_fd == -1) { in test_send_signal_nmi() 186 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()
|
/linux-6.1.9/tools/testing/selftests/bpf/ |
D | get_cgroup_id_user.c | 52 int err, bytes, efd, prog_fd, pmu_fd; in main() local 109 pmu_fd = syscall(__NR_perf_event_open, &attr, getpid(), -1, -1, 0); in main() 110 if (CHECK(pmu_fd < 0, "perf_event_open", "err %d errno %d\n", pmu_fd, in main() 114 err = ioctl(pmu_fd, PERF_EVENT_IOC_ENABLE, 0); in main() 119 err = ioctl(pmu_fd, PERF_EVENT_IOC_SET_BPF, prog_fd); in main() 140 close(pmu_fd); in main()
|
/linux-6.1.9/samples/bpf/ |
D | trace_event_user.c | 141 int i, pmu_fd, error = 1; in test_perf_event_all_cpu() local 153 pmu_fd = sys_perf_event_open(attr, -1, i, -1, 0); in test_perf_event_all_cpu() 154 if (pmu_fd < 0) { in test_perf_event_all_cpu() 158 links[i] = bpf_program__attach_perf_event(prog, pmu_fd); in test_perf_event_all_cpu() 162 close(pmu_fd); in test_perf_event_all_cpu() 184 int pmu_fd, error = 1; in test_perf_event_task() local 192 pmu_fd = sys_perf_event_open(attr, 0, -1, -1, 0); in test_perf_event_task() 193 if (pmu_fd < 0) { in test_perf_event_task() 197 link = bpf_program__attach_perf_event(prog, pmu_fd); in test_perf_event_task() 201 close(pmu_fd); in test_perf_event_task()
|
D | tracex6_user.c | 28 int pmu_fd, error = 0; in check_on_cpu() local 37 pmu_fd = sys_perf_event_open(attr, -1/*pid*/, cpu/*cpu*/, -1/*group_fd*/, 0); in check_on_cpu() 38 if (pmu_fd < 0) { in check_on_cpu() 43 assert(bpf_map_update_elem(map_fd[0], &cpu, &pmu_fd, BPF_ANY) == 0); in check_on_cpu() 44 assert(ioctl(pmu_fd, PERF_EVENT_IOC_ENABLE, 0) == 0); in check_on_cpu() 67 assert(ioctl(pmu_fd, PERF_EVENT_IOC_DISABLE, 0) == 0 || error); in check_on_cpu() 68 assert(close(pmu_fd) == 0 || error); in check_on_cpu()
|
D | sampleip_user.c | 39 int i, pmu_fd; in sampling_start() local 50 pmu_fd = sys_perf_event_open(&pe_sample_attr, -1 /* pid */, i, in sampling_start() 52 if (pmu_fd < 0) { in sampling_start() 56 links[i] = bpf_program__attach_perf_event(prog, pmu_fd); in sampling_start() 60 close(pmu_fd); in sampling_start()
|
/linux-6.1.9/tools/bpf/bpftool/ |
D | prog.c | 2172 int map_fd, pmu_fd; in profile_open_perf_events() local 2191 pmu_fd = syscall(__NR_perf_event_open, &metrics[m].attr, in profile_open_perf_events() 2193 if (pmu_fd < 0 || in profile_open_perf_events() 2195 &pmu_fd, BPF_ANY) || in profile_open_perf_events() 2196 ioctl(pmu_fd, PERF_EVENT_IOC_ENABLE, 0)) { in profile_open_perf_events() 2201 profile_perf_events[profile_perf_event_cnt++] = pmu_fd; in profile_open_perf_events()
|