Lines Matching refs:fd
35 int fd; in __event() local
52 fd = sys_perf_event_open(attr, -1, 0, -1, in __event()
54 if (fd < 0) { in __event()
59 return fd; in __event()
75 int i, fd[wp_cnt], fd_wp, ret; in bp_accounting() local
78 fd[i] = wp_event((void *)&the_var, &attr); in bp_accounting()
79 TEST_ASSERT_VAL("failed to create wp\n", fd[i] != -1); in bp_accounting()
87 ret = ioctl(fd[0], PERF_EVENT_IOC_MODIFY_ATTRIBUTES, &attr_mod); in bp_accounting()
99 close(fd[i]); in bp_accounting()
108 int fd[100], cnt = 0, i; in detect_cnt() local
115 fd[cnt] = __event(is_x, addr, &attr); in detect_cnt()
117 if (fd[cnt] < 0) in detect_cnt()
123 close(fd[i]); in detect_cnt()
131 int fd, ret = 1; in detect_ioctl() local
133 fd = wp_event((void *) &the_var, &attr); in detect_ioctl()
134 if (fd > 0) { in detect_ioctl()
135 ret = ioctl(fd, PERF_EVENT_IOC_MODIFY_ATTRIBUTES, &attr); in detect_ioctl()
136 close(fd); in detect_ioctl()
145 int i, fd[wp_cnt + bp_cnt], ret; in detect_share() local
148 fd[i] = wp_event((void *)&the_var, &attr); in detect_share()
149 TEST_ASSERT_VAL("failed to create wp\n", fd[i] != -1); in detect_share()
153 fd[i] = bp_event((void *)test_function, &attr); in detect_share()
154 if (fd[i] == -1) in detect_share()
161 close(fd[i]); in detect_share()