6 #include <sys/syscall.h>
7 #include <linux/types.h>
8 #include <linux/perf_event.h>
9 #include <asm/barrier.h>
12 #define cpu_relax() asm volatile("rep; nop" ::: "memory");
13 #define CPUINFO_PROC {"model name"}
14 #ifndef __NR_perf_event_open
15 # define __NR_perf_event_open 336
18 # define __NR_futex 240
21 # define __NR_gettid 224
25 #if defined(__x86_64__)
26 #define cpu_relax() asm volatile("rep; nop" ::: "memory");
27 #define CPUINFO_PROC {"model name"}
28 #ifndef __NR_perf_event_open
29 # define __NR_perf_event_open 298
32 # define __NR_futex 202
35 # define __NR_gettid 186
40 #include "../../arch/powerpc/include/uapi/asm/unistd.h"
41 #define CPUINFO_PROC {"cpu"}
45 #define CPUINFO_PROC {"vendor_id"}
49 #define CPUINFO_PROC {"cpu type"}
53 #define CPUINFO_PROC {"cpu"}
57 #define CPUINFO_PROC {"cpu"}
61 #define CPUINFO_PROC {"cpu model"}
65 #define cpu_relax() asm volatile ("hint @pause" ::: "memory")
66 #define CPUINFO_PROC {"model name"}
70 #define CPUINFO_PROC {"model name", "Processor"}
74 #define cpu_relax() asm volatile("yield" ::: "memory")
78 #define CPUINFO_PROC {"cpu model"}
82 #define CPUINFO_PROC {"Processor"}
86 #define CPUINFO_PROC {"CPU"}
90 #define CPUINFO_PROC {"core ID"}
94 #define cpu_relax() asm volatile ("mfspr zero, PASS" ::: "memory")
95 #define CPUINFO_PROC {"model name"}
99 #define cpu_relax() barrier()
103 sys_perf_event_open(struct perf_event_attr
*attr
,
104 pid_t pid
, int cpu
, int group_fd
,
109 fd
= syscall(__NR_perf_event_open
, attr
, pid
, cpu
,
112 #ifdef HAVE_ATTR_TEST
113 if (unlikely(test_attr__enabled
))
114 test_attr__open(attr
, pid
, cpu
, fd
, group_fd
, flags
);
119 #endif /* _PERF_SYS_H */
This page took 0.034091 seconds and 5 git commands to generate.