Lines Matching defs:fd
43 static long long bp_count(int fd)
48 ret = read(fd, &count, sizeof(long long));
65 int fd, i, fails = 0;
94 fd = sys_perf_event_open(&pe, 0, -1, -1, 0);
95 if (fd < 0) {
100 fcntl(fd, F_SETFL, O_RDWR|O_NONBLOCK|O_ASYNC);
101 fcntl(fd, F_SETSIG, SIGIO);
102 fcntl(fd, F_SETOWN, getpid());
104 ioctl(fd, PERF_EVENT_IOC_RESET, 0);
105 ioctl(fd, PERF_EVENT_IOC_ENABLE, 0);
110 ioctl(fd, PERF_EVENT_IOC_DISABLE, 0);
112 count = bp_count(fd);
114 close(fd);