Lines Matching refs:fd
14 #define WP_TEST_ASSERT_VAL(fd, text, val) \ argument
17 wp_read(fd, &count, sizeof(long long)); \
24 static int wp_read(int fd, long long *count, int size) in wp_read() argument
26 int ret = read(fd, count, size); in wp_read()
53 int fd; in __event() local
57 fd = sys_perf_event_open(&attr, 0, -1, -1, in __event()
59 if (fd < 0) in __event()
62 return fd; in __event()
67 int fd; in wp_ro_test() local
70 fd = __event(HW_BREAKPOINT_R, (void *)&data1, sizeof(data1)); in wp_ro_test()
71 if (fd < 0) in wp_ro_test()
75 WP_TEST_ASSERT_VAL(fd, "RO watchpoint", 1); in wp_ro_test()
78 WP_TEST_ASSERT_VAL(fd, "RO watchpoint", 1); in wp_ro_test()
80 close(fd); in wp_ro_test()
86 int fd; in wp_wo_test() local
89 fd = __event(HW_BREAKPOINT_W, (void *)&data1, sizeof(data1)); in wp_wo_test()
90 if (fd < 0) in wp_wo_test()
94 WP_TEST_ASSERT_VAL(fd, "WO watchpoint", 0); in wp_wo_test()
97 WP_TEST_ASSERT_VAL(fd, "WO watchpoint", 1); in wp_wo_test()
99 close(fd); in wp_wo_test()
105 int fd; in wp_rw_test() local
108 fd = __event(HW_BREAKPOINT_R | HW_BREAKPOINT_W, (void *)&data1, in wp_rw_test()
110 if (fd < 0) in wp_rw_test()
114 WP_TEST_ASSERT_VAL(fd, "RW watchpoint", 1); in wp_rw_test()
117 WP_TEST_ASSERT_VAL(fd, "RW watchpoint", 2); in wp_rw_test()
119 close(fd); in wp_rw_test()
125 int fd, ret; in wp_modify_test() local
129 fd = __event(HW_BREAKPOINT_W, (void *)&data1, sizeof(data1)); in wp_modify_test()
130 if (fd < 0) in wp_modify_test()
134 WP_TEST_ASSERT_VAL(fd, "Modify watchpoint", 1); in wp_modify_test()
140 ret = ioctl(fd, PERF_EVENT_IOC_MODIFY_ATTRIBUTES, &new_attr); in wp_modify_test()
143 close(fd); in wp_modify_test()
148 WP_TEST_ASSERT_VAL(fd, "Modify watchpoint", 1); in wp_modify_test()
151 ioctl(fd, PERF_EVENT_IOC_ENABLE, 0); in wp_modify_test()
154 close(fd); in wp_modify_test()
159 WP_TEST_ASSERT_VAL(fd, "Modify watchpoint", 2); in wp_modify_test()
162 WP_TEST_ASSERT_VAL(fd, "Modify watchpoint", 2); in wp_modify_test()
164 close(fd); in wp_modify_test()