Lines Matching refs:fd
44 int fd; in __event() local
61 fd = sys_perf_event_open(attr, -1, 0, -1, in __event()
63 if (fd < 0) { in __event()
68 return fd; in __event()
84 int i, fd[wp_cnt], fd_wp, ret; in bp_accounting() local
87 fd[i] = wp_event((void *)&the_var, &attr); in bp_accounting()
88 TEST_ASSERT_VAL("failed to create wp\n", fd[i] != -1); in bp_accounting()
96 ret = ioctl(fd[0], PERF_EVENT_IOC_MODIFY_ATTRIBUTES, &attr_mod); in bp_accounting()
108 close(fd[i]); in bp_accounting()
117 int fd[100], cnt = 0, i; in detect_cnt() local
124 fd[cnt] = __event(is_x, addr, &attr); in detect_cnt()
126 if (fd[cnt] < 0) in detect_cnt()
132 close(fd[i]); in detect_cnt()
140 int fd, ret = 1; in detect_ioctl() local
142 fd = wp_event((void *) &the_var, &attr); in detect_ioctl()
143 if (fd > 0) { in detect_ioctl()
144 ret = ioctl(fd, PERF_EVENT_IOC_MODIFY_ATTRIBUTES, &attr); in detect_ioctl()
145 close(fd); in detect_ioctl()
154 int i, *fd = NULL, ret = -1; in detect_share() local
159 fd = malloc(sizeof(int) * (wp_cnt + bp_cnt)); in detect_share()
160 if (!fd) in detect_share()
164 fd[i] = wp_event((void *)&the_var, &attr); in detect_share()
165 if (fd[i] == -1) { in detect_share()
172 fd[i] = bp_event((void *)test_function, &attr); in detect_share()
173 if (fd[i] == -1) in detect_share()
181 close(fd[i]); in detect_share()
183 free(fd); in detect_share()