Lines Matching refs:attr
29 static int __event(bool is_x, void *addr, struct perf_event_attr *attr) in __event() argument
33 memset(attr, 0, sizeof(struct perf_event_attr)); in __event()
34 attr->type = PERF_TYPE_BREAKPOINT; in __event()
35 attr->size = sizeof(struct perf_event_attr); in __event()
37 attr->config = 0; in __event()
38 attr->bp_type = is_x ? HW_BREAKPOINT_X : HW_BREAKPOINT_W; in __event()
39 attr->bp_addr = (unsigned long) addr; in __event()
40 attr->bp_len = sizeof(long); in __event()
42 attr->sample_period = 1; in __event()
43 attr->sample_type = PERF_SAMPLE_IP; in __event()
45 attr->exclude_kernel = 1; in __event()
46 attr->exclude_hv = 1; in __event()
48 fd = sys_perf_event_open(attr, -1, 0, -1, in __event()
51 pr_debug("failed opening event %llx\n", attr->config); in __event()
58 static int wp_event(void *addr, struct perf_event_attr *attr) in wp_event() argument
60 return __event(false, addr, attr); in wp_event()
63 static int bp_event(void *addr, struct perf_event_attr *attr) in bp_event() argument
65 return __event(true, addr, attr); in bp_event()
70 struct perf_event_attr attr, attr_mod, attr_new; in bp_accounting() local
74 fd[i] = wp_event((void *)&the_var, &attr); in bp_accounting()
79 attr_mod = attr; in bp_accounting()
102 struct perf_event_attr attr; in detect_cnt() local
111 fd[cnt] = __event(is_x, addr, &attr); in detect_cnt()
126 struct perf_event_attr attr; in detect_ioctl() local
129 fd = wp_event((void *) &the_var, &attr); in detect_ioctl()
131 ret = ioctl(fd, PERF_EVENT_IOC_MODIFY_ATTRIBUTES, &attr); in detect_ioctl()
140 struct perf_event_attr attr; in detect_share() local
144 fd[i] = wp_event((void *)&the_var, &attr); in detect_share()
149 fd[i] = bp_event((void *)test_function, &attr); in detect_share()