xfs: try to avoid blowing out the transaction reservation when bunmaping a shared...
[linux/fpc-iii.git] / tools / perf / perf-sys.h
blobe4b717e9eb6cf532c2d9c823c1b8f71e8da4256b
1 #ifndef _PERF_SYS_H
2 #define _PERF_SYS_H
4 #include <unistd.h>
5 #include <sys/types.h>
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>
12 #if defined(__i386__)
13 #define cpu_relax() asm volatile("rep; nop" ::: "memory");
14 #define CPUINFO_PROC {"model name"}
15 #endif
17 #if defined(__x86_64__)
18 #define cpu_relax() asm volatile("rep; nop" ::: "memory");
19 #define CPUINFO_PROC {"model name"}
20 #endif
22 #ifdef __powerpc__
23 #define CPUINFO_PROC {"cpu"}
24 #endif
26 #ifdef __s390__
27 #define CPUINFO_PROC {"vendor_id"}
28 #endif
30 #ifdef __sh__
31 #define CPUINFO_PROC {"cpu type"}
32 #endif
34 #ifdef __hppa__
35 #define CPUINFO_PROC {"cpu"}
36 #endif
38 #ifdef __sparc__
39 #define CPUINFO_PROC {"cpu"}
40 #endif
42 #ifdef __alpha__
43 #define CPUINFO_PROC {"cpu model"}
44 #endif
46 #ifdef __ia64__
47 #define cpu_relax() asm volatile ("hint @pause" ::: "memory")
48 #define CPUINFO_PROC {"model name"}
49 #endif
51 #ifdef __arm__
52 #define CPUINFO_PROC {"model name", "Processor"}
53 #endif
55 #ifdef __aarch64__
56 #define cpu_relax() asm volatile("yield" ::: "memory")
57 #endif
59 #ifdef __mips__
60 #define CPUINFO_PROC {"cpu model"}
61 #endif
63 #ifdef __arc__
64 #define CPUINFO_PROC {"Processor"}
65 #endif
67 #ifdef __metag__
68 #define CPUINFO_PROC {"CPU"}
69 #endif
71 #ifdef __xtensa__
72 #define CPUINFO_PROC {"core ID"}
73 #endif
75 #ifdef __tile__
76 #define cpu_relax() asm volatile ("mfspr zero, PASS" ::: "memory")
77 #define CPUINFO_PROC {"model name"}
78 #endif
80 #ifndef cpu_relax
81 #define cpu_relax() barrier()
82 #endif
84 static inline int
85 sys_perf_event_open(struct perf_event_attr *attr,
86 pid_t pid, int cpu, int group_fd,
87 unsigned long flags)
89 int fd;
91 fd = syscall(__NR_perf_event_open, attr, pid, cpu,
92 group_fd, flags);
94 #ifdef HAVE_ATTR_TEST
95 if (unlikely(test_attr__enabled))
96 test_attr__open(attr, pid, cpu, fd, group_fd, flags);
97 #endif
98 return fd;
101 #endif /* _PERF_SYS_H */