Lines Matching refs:pmu_fd
37 static int sampling_start(int *pmu_fd, int freq) in sampling_start() argument
50 pmu_fd[i] = sys_perf_event_open(&pe_sample_attr, -1 /* pid */, i, in sampling_start()
52 if (pmu_fd[i] < 0) { in sampling_start()
56 assert(ioctl(pmu_fd[i], PERF_EVENT_IOC_SET_BPF, in sampling_start()
58 assert(ioctl(pmu_fd[i], PERF_EVENT_IOC_ENABLE, 0) == 0); in sampling_start()
64 static void sampling_end(int *pmu_fd) in sampling_end() argument
69 close(pmu_fd[i]); in sampling_end()
138 int *pmu_fd, opt, freq = DEFAULT_FREQ, secs = DEFAULT_SECS; in main() local
167 pmu_fd = malloc(nr_cpus * sizeof(int)); in main()
168 if (pmu_fd == NULL) { in main()
190 if (sampling_start(pmu_fd, freq) != 0) in main()
193 sampling_end(pmu_fd); in main()
194 free(pmu_fd); in main()