aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/perf_counter/perf.h
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/perf_counter/perf.h')
-rw-r--r--Documentation/perf_counter/perf.h31
1 files changed, 19 insertions, 12 deletions
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); \