1 /* SPDX-License-Identifier: GPL-2.0 */
7 #include <sys/syscall.h>
8 #include <linux/compiler.h>
10 struct perf_event_attr
;
12 extern bool test_attr__enabled
;
13 void test_attr__ready(void);
14 void test_attr__init(void);
15 void test_attr__open(struct perf_event_attr
*attr
, pid_t pid
, int cpu
,
16 int fd
, int group_fd
, unsigned long flags
);
18 #ifndef HAVE_ATTR_TEST
19 #define HAVE_ATTR_TEST 1
23 sys_perf_event_open(struct perf_event_attr
*attr
,
24 pid_t pid
, int cpu
, int group_fd
,
29 fd
= syscall(__NR_perf_event_open
, attr
, pid
, cpu
,
33 if (unlikely(test_attr__enabled
))
34 test_attr__open(attr
, pid
, cpu
, fd
, group_fd
, flags
);
39 #endif /* _PERF_SYS_H */