6 #include <sys/syscall.h>
7 #include <linux/types.h>
8 #include <linux/compiler.h>
9 #include <linux/perf_event.h>
10 #include <asm/barrier.h>
13 #define cpu_relax() asm volatile("rep; nop" ::: "memory");
14 #define CPUINFO_PROC {"model name"}
17 #if defined(__x86_64__)
18 #define cpu_relax() asm volatile("rep; nop" ::: "memory");
19 #define CPUINFO_PROC {"model name"}
23 #include "../../arch/powerpc/include/uapi/asm/unistd.h"
24 #define CPUINFO_PROC {"cpu"}
28 #define CPUINFO_PROC {"vendor_id"}
32 #define CPUINFO_PROC {"cpu type"}
36 #define CPUINFO_PROC {"cpu"}
40 #define CPUINFO_PROC {"cpu"}
44 #define CPUINFO_PROC {"cpu model"}
48 #define cpu_relax() asm volatile ("hint @pause" ::: "memory")
49 #define CPUINFO_PROC {"model name"}
53 #define CPUINFO_PROC {"model name", "Processor"}
57 #define cpu_relax() asm volatile("yield" ::: "memory")
61 #define CPUINFO_PROC {"cpu model"}
65 #define CPUINFO_PROC {"Processor"}
69 #define CPUINFO_PROC {"CPU"}
73 #define CPUINFO_PROC {"core ID"}
77 #define cpu_relax() asm volatile ("mfspr zero, PASS" ::: "memory")
78 #define CPUINFO_PROC {"model name"}
82 #define cpu_relax() barrier()
86 sys_perf_event_open(struct perf_event_attr *attr,
87 pid_t pid, int cpu, int group_fd,
92 fd = syscall(__NR_perf_event_open, attr, pid, cpu,
96 if (unlikely(test_attr__enabled))
97 test_attr__open(attr, pid, cpu, fd, group_fd, flags);
102 #endif /* _PERF_SYS_H */