Lines Matching refs:pmu_fd
140 int *pmu_fd = malloc(nr_cpus * sizeof(int)); in test_perf_event_all_cpu() local
148 pmu_fd[i] = sys_perf_event_open(attr, -1, i, -1, 0); in test_perf_event_all_cpu()
149 if (pmu_fd[i] < 0) { in test_perf_event_all_cpu()
154 assert(ioctl(pmu_fd[i], PERF_EVENT_IOC_SET_BPF, prog_fd[0]) == 0); in test_perf_event_all_cpu()
155 assert(ioctl(pmu_fd[i], PERF_EVENT_IOC_ENABLE) == 0); in test_perf_event_all_cpu()
165 ioctl(pmu_fd[i], PERF_EVENT_IOC_DISABLE); in test_perf_event_all_cpu()
166 close(pmu_fd[i]); in test_perf_event_all_cpu()
168 free(pmu_fd); in test_perf_event_all_cpu()
175 int pmu_fd, error = 0; in test_perf_event_task() local
183 pmu_fd = sys_perf_event_open(attr, 0, -1, -1, 0); in test_perf_event_task()
184 if (pmu_fd < 0) { in test_perf_event_task()
188 assert(ioctl(pmu_fd, PERF_EVENT_IOC_SET_BPF, prog_fd[0]) == 0); in test_perf_event_task()
189 assert(ioctl(pmu_fd, PERF_EVENT_IOC_ENABLE) == 0); in test_perf_event_task()
197 ioctl(pmu_fd, PERF_EVENT_IOC_DISABLE); in test_perf_event_task()
198 close(pmu_fd); in test_perf_event_task()