aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/perf_counter/builtin-record.c3
-rw-r--r--Documentation/perf_counter/builtin-stat.c5
-rw-r--r--Documentation/perf_counter/builtin-top.c5
-rw-r--r--Documentation/perf_counter/perf.h31
4 files changed, 22 insertions, 22 deletions
diff --git a/Documentation/perf_counter/builtin-record.c b/Documentation/perf_counter/builtin-record.c
index efb87595f3cb..1b19f187d352 100644
--- a/Documentation/perf_counter/builtin-record.c
+++ b/Documentation/perf_counter/builtin-record.c
@@ -1,5 +1,6 @@
1 1
2 2
3#include "perf.h"
3#include "util/util.h" 4#include "util/util.h"
4 5
5#include <sys/types.h> 6#include <sys/types.h>
@@ -30,9 +31,7 @@
30#include <linux/unistd.h> 31#include <linux/unistd.h>
31#include <linux/types.h> 32#include <linux/types.h>
32 33
33#include "../../include/linux/perf_counter.h"
34 34
35#include "perf.h"
36 35
37#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) 36#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
38#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) 37#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
diff --git a/Documentation/perf_counter/builtin-stat.c b/Documentation/perf_counter/builtin-stat.c
index 03518d75d864..8ae01d51f291 100644
--- a/Documentation/perf_counter/builtin-stat.c
+++ b/Documentation/perf_counter/builtin-stat.c
@@ -61,6 +61,7 @@
61 * Released under the GPL v2. (and only v2, not any later version) 61 * Released under the GPL v2. (and only v2, not any later version)
62 */ 62 */
63 63
64#include "perf.h"
64#include "util/util.h" 65#include "util/util.h"
65 66
66#include <getopt.h> 67#include <getopt.h>
@@ -83,10 +84,6 @@
83#include <linux/unistd.h> 84#include <linux/unistd.h>
84#include <linux/types.h> 85#include <linux/types.h>
85 86
86#include "../../include/linux/perf_counter.h"
87
88#include "perf.h"
89
90#define EVENT_MASK_KERNEL 1 87#define EVENT_MASK_KERNEL 1
91#define EVENT_MASK_USER 2 88#define EVENT_MASK_USER 2
92 89
diff --git a/Documentation/perf_counter/builtin-top.c b/Documentation/perf_counter/builtin-top.c
index 814b2e4925e3..a3216a6018c4 100644
--- a/Documentation/perf_counter/builtin-top.c
+++ b/Documentation/perf_counter/builtin-top.c
@@ -42,6 +42,7 @@
42 * Released under the GPL v2. (and only v2, not any later version) 42 * Released under the GPL v2. (and only v2, not any later version)
43 */ 43 */
44 44
45#include "perf.h"
45#include "util/util.h" 46#include "util/util.h"
46 47
47#include <getopt.h> 48#include <getopt.h>
@@ -64,10 +65,6 @@
64#include <linux/unistd.h> 65#include <linux/unistd.h>
65#include <linux/types.h> 66#include <linux/types.h>
66 67
67#include "../../include/linux/perf_counter.h"
68
69#include "perf.h"
70
71static int system_wide = 0; 68static int system_wide = 0;
72 69
73static int nr_counters = 0; 70static int nr_counters = 0;
diff --git a/Documentation/perf_counter/perf.h b/Documentation/perf_counter/perf.h
index 81a737444c8f..a517683fc661 100644
--- a/Documentation/perf_counter/perf.h
+++ b/Documentation/perf_counter/perf.h
@@ -1,6 +1,25 @@
1#ifndef _PERF_PERF_H 1#ifndef _PERF_PERF_H
2#define _PERF_PERF_H 2#define _PERF_PERF_H
3 3
4#if defined(__x86_64__) || defined(__i386__)
5#include "../../arch/x86/include/asm/unistd.h"
6#define rmb() asm volatile("lfence" ::: "memory")
7#define cpu_relax() asm volatile("rep; nop" ::: "memory");
8#endif
9
10#ifdef __powerpc__
11#include "../../arch/powerpc/include/asm/unistd.h"
12#define rmb() asm volatile ("sync" ::: "memory")
13#define cpu_relax() asm volatile ("" ::: "memory");
14#endif
15
16#include <time.h>
17#include <unistd.h>
18#include <sys/types.h>
19#include <sys/syscall.h>
20
21#include "../../include/linux/perf_counter.h"
22
4/* 23/*
5 * prctl(PR_TASK_PERF_COUNTERS_DISABLE) will (cheaply) disable all 24 * prctl(PR_TASK_PERF_COUNTERS_DISABLE) will (cheaply) disable all
6 * counters in the current task. 25 * counters in the current task.
@@ -26,18 +45,6 @@ static inline unsigned long long rdclock(void)
26#define __user 45#define __user
27#define asmlinkage 46#define asmlinkage
28 47
29#if defined(__x86_64__) || defined(__i386__)
30#include "../../arch/x86/include/asm/unistd.h"
31#define rmb() asm volatile("lfence" ::: "memory")
32#define cpu_relax() asm volatile("rep; nop" ::: "memory");
33#endif
34
35#ifdef __powerpc__
36#include "../../arch/powerpc/include/asm/unistd.h"
37#define rmb() asm volatile ("sync" ::: "memory")
38#define cpu_relax() asm volatile ("" ::: "memory");
39#endif
40
41#define unlikely(x) __builtin_expect(!!(x), 0) 48#define unlikely(x) __builtin_expect(!!(x), 0)
42#define min(x, y) ({ \ 49#define min(x, y) ({ \
43 typeof(x) _min1 = (x); \ 50 typeof(x) _min1 = (x); \