Go to the documentation of this file.
8 #include <asm/unistd.h>
11 #define rmb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
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
19 #if defined(__x86_64__)
20 #define rmb() asm volatile("lfence" ::: "memory")
21 #define cpu_relax() asm volatile("rep; nop" ::: "memory");
22 #define CPUINFO_PROC "model name"
23 #ifndef __NR_perf_event_open
24 # define __NR_perf_event_open 298
29 #define rmb() asm volatile ("sync" ::: "memory")
30 #define cpu_relax() asm volatile ("" ::: "memory");
31 #define CPUINFO_PROC "cpu"
35 #define rmb() asm volatile("bcr 15,0" ::: "memory")
36 #define cpu_relax() asm volatile("" ::: "memory");
40 #if defined(__SH4A__) || defined(__SH5__)
41 # define rmb() asm volatile("synco" ::: "memory")
43 # define rmb() asm volatile("" ::: "memory")
45 #define cpu_relax() asm volatile("" ::: "memory")
46 #define CPUINFO_PROC "cpu type"
50 #define rmb() asm volatile("" ::: "memory")
51 #define cpu_relax() asm volatile("" ::: "memory");
52 #define CPUINFO_PROC "cpu"
56 #define rmb() asm volatile("":::"memory")
57 #define cpu_relax() asm volatile("":::"memory")
58 #define CPUINFO_PROC "cpu"
62 #define rmb() asm volatile("mb" ::: "memory")
63 #define cpu_relax() asm volatile("" ::: "memory")
64 #define CPUINFO_PROC "cpu model"
68 #define rmb() asm volatile ("mf" ::: "memory")
69 #define cpu_relax() asm volatile ("hint @pause" ::: "memory")
70 #define CPUINFO_PROC "model name"
78 #define rmb() ((void(*)(void))0xffff0fa0)()
79 #define cpu_relax() asm volatile("":::"memory")
80 #define CPUINFO_PROC "Processor"
84 #define rmb() asm volatile("dmb ld" ::: "memory")
85 #define cpu_relax() asm volatile("yield" ::: "memory")
89 #define rmb() asm volatile( \
96 #define cpu_relax() asm volatile("" ::: "memory")
97 #define CPUINFO_PROC "cpu model"
102 #include <sys/types.h>
103 #include <sys/syscall.h>
105 #include <linux/perf_event.h>
115 static inline unsigned int perf_mmap__read_head(
struct perf_mmap *mm)
123 static inline void perf_mmap__write_tail(
struct perf_mmap *
md,
139 #define PR_TASK_PERF_EVENTS_DISABLE 31
140 #define PR_TASK_PERF_EVENTS_ENABLE 32
143 # define NSEC_PER_SEC 1000000000ULL
146 static inline unsigned long long rdclock(
void)
160 #define unlikely(x) __builtin_expect(!!(x), 0)
161 #define min(x, y) ({ \
162 typeof(x) _min1 = (x); \
163 typeof(y) _min2 = (y); \
164 (void) (&_min1 == &_min2); \
165 _min1 < _min2 ? _min1 : _min2; })
176 #define MAX_COUNTERS 256
177 #define MAX_NR_CPUS 256