perf.h (94bd217e2d683719ab21a4ac117d8a1b91cbedc9) perf.h (fbe96f29ce4b33e0a22219cc7f5996d9157717e3)
1#ifndef _PERF_PERF_H
2#define _PERF_PERF_H
3
4struct winsize;
5
6void get_term_dimensions(struct winsize *ws);
7
8#if defined(__i386__)
9#include "../../arch/x86/include/asm/unistd.h"
10#define rmb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
11#define cpu_relax() asm volatile("rep; nop" ::: "memory");
1#ifndef _PERF_PERF_H
2#define _PERF_PERF_H
3
4struct winsize;
5
6void get_term_dimensions(struct winsize *ws);
7
8#if defined(__i386__)
9#include "../../arch/x86/include/asm/unistd.h"
10#define rmb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
11#define cpu_relax() asm volatile("rep; nop" ::: "memory");
12#define CPUINFO_PROC "model name"
12#endif
13
14#if defined(__x86_64__)
15#include "../../arch/x86/include/asm/unistd.h"
16#define rmb() asm volatile("lfence" ::: "memory")
17#define cpu_relax() asm volatile("rep; nop" ::: "memory");
13#endif
14
15#if defined(__x86_64__)
16#include "../../arch/x86/include/asm/unistd.h"
17#define rmb() asm volatile("lfence" ::: "memory")
18#define cpu_relax() asm volatile("rep; nop" ::: "memory");
19#define CPUINFO_PROC "model name"
18#endif
19
20#ifdef __powerpc__
21#include "../../arch/powerpc/include/asm/unistd.h"
22#define rmb() asm volatile ("sync" ::: "memory")
23#define cpu_relax() asm volatile ("" ::: "memory");
20#endif
21
22#ifdef __powerpc__
23#include "../../arch/powerpc/include/asm/unistd.h"
24#define rmb() asm volatile ("sync" ::: "memory")
25#define cpu_relax() asm volatile ("" ::: "memory");
26#define CPUINFO_PROC "cpu"
24#endif
25
26#ifdef __s390__
27#include "../../arch/s390/include/asm/unistd.h"
28#define rmb() asm volatile("bcr 15,0" ::: "memory")
29#define cpu_relax() asm volatile("" ::: "memory");
30#endif
31
32#ifdef __sh__
33#include "../../arch/sh/include/asm/unistd.h"
34#if defined(__SH4A__) || defined(__SH5__)
35# define rmb() asm volatile("synco" ::: "memory")
36#else
37# define rmb() asm volatile("" ::: "memory")
38#endif
39#define cpu_relax() asm volatile("" ::: "memory")
27#endif
28
29#ifdef __s390__
30#include "../../arch/s390/include/asm/unistd.h"
31#define rmb() asm volatile("bcr 15,0" ::: "memory")
32#define cpu_relax() asm volatile("" ::: "memory");
33#endif
34
35#ifdef __sh__
36#include "../../arch/sh/include/asm/unistd.h"
37#if defined(__SH4A__) || defined(__SH5__)
38# define rmb() asm volatile("synco" ::: "memory")
39#else
40# define rmb() asm volatile("" ::: "memory")
41#endif
42#define cpu_relax() asm volatile("" ::: "memory")
43#define CPUINFO_PROC "cpu type"
40#endif
41
42#ifdef __hppa__
43#include "../../arch/parisc/include/asm/unistd.h"
44#define rmb() asm volatile("" ::: "memory")
45#define cpu_relax() asm volatile("" ::: "memory");
44#endif
45
46#ifdef __hppa__
47#include "../../arch/parisc/include/asm/unistd.h"
48#define rmb() asm volatile("" ::: "memory")
49#define cpu_relax() asm volatile("" ::: "memory");
50#define CPUINFO_PROC "cpu"
46#endif
47
48#ifdef __sparc__
49#include "../../arch/sparc/include/asm/unistd.h"
50#define rmb() asm volatile("":::"memory")
51#define cpu_relax() asm volatile("":::"memory")
51#endif
52
53#ifdef __sparc__
54#include "../../arch/sparc/include/asm/unistd.h"
55#define rmb() asm volatile("":::"memory")
56#define cpu_relax() asm volatile("":::"memory")
57#define CPUINFO_PROC "cpu"
52#endif
53
54#ifdef __alpha__
55#include "../../arch/alpha/include/asm/unistd.h"
56#define rmb() asm volatile("mb" ::: "memory")
57#define cpu_relax() asm volatile("" ::: "memory")
58#endif
59
60#ifdef __alpha__
61#include "../../arch/alpha/include/asm/unistd.h"
62#define rmb() asm volatile("mb" ::: "memory")
63#define cpu_relax() asm volatile("" ::: "memory")
64#define CPUINFO_PROC "cpu model"
58#endif
59
60#ifdef __ia64__
61#include "../../arch/ia64/include/asm/unistd.h"
62#define rmb() asm volatile ("mf" ::: "memory")
63#define cpu_relax() asm volatile ("hint @pause" ::: "memory")
65#endif
66
67#ifdef __ia64__
68#include "../../arch/ia64/include/asm/unistd.h"
69#define rmb() asm volatile ("mf" ::: "memory")
70#define cpu_relax() asm volatile ("hint @pause" ::: "memory")
71#define CPUINFO_PROC "model name"
64#endif
65
66#ifdef __arm__
67#include "../../arch/arm/include/asm/unistd.h"
68/*
69 * Use the __kuser_memory_barrier helper in the CPU helper page. See
70 * arch/arm/kernel/entry-armv.S in the kernel source for details.
71 */
72#define rmb() ((void(*)(void))0xffff0fa0)()
73#define cpu_relax() asm volatile("":::"memory")
72#endif
73
74#ifdef __arm__
75#include "../../arch/arm/include/asm/unistd.h"
76/*
77 * Use the __kuser_memory_barrier helper in the CPU helper page. See
78 * arch/arm/kernel/entry-armv.S in the kernel source for details.
79 */
80#define rmb() ((void(*)(void))0xffff0fa0)()
81#define cpu_relax() asm volatile("":::"memory")
82#define CPUINFO_PROC "Processor"
74#endif
75
76#ifdef __mips__
77#include "../../arch/mips/include/asm/unistd.h"
78#define rmb() asm volatile( \
79 ".set mips2\n\t" \
80 "sync\n\t" \
81 ".set mips0" \
82 : /* no output */ \
83 : /* no input */ \
84 : "memory")
85#define cpu_relax() asm volatile("" ::: "memory")
83#endif
84
85#ifdef __mips__
86#include "../../arch/mips/include/asm/unistd.h"
87#define rmb() asm volatile( \
88 ".set mips2\n\t" \
89 "sync\n\t" \
90 ".set mips0" \
91 : /* no output */ \
92 : /* no input */ \
93 : "memory")
94#define cpu_relax() asm volatile("" ::: "memory")
95#define CPUINFO_PROC "cpu model"
86#endif
87
88#include <time.h>
89#include <unistd.h>
90#include <sys/types.h>
91#include <sys/syscall.h>
92
93#include "../../include/linux/perf_event.h"

--- 72 unchanged lines hidden (view full) ---

166#define MAX_NR_CPUS 256
167
168struct ip_callchain {
169 u64 nr;
170 u64 ips[0];
171};
172
173extern bool perf_host, perf_guest;
96#endif
97
98#include <time.h>
99#include <unistd.h>
100#include <sys/types.h>
101#include <sys/syscall.h>
102
103#include "../../include/linux/perf_event.h"

--- 72 unchanged lines hidden (view full) ---

176#define MAX_NR_CPUS 256
177
178struct ip_callchain {
179 u64 nr;
180 u64 ips[0];
181};
182
183extern bool perf_host, perf_guest;
184extern const char perf_version_string[];
174
175#endif
185
186#endif