aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/perf.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2011-01-27 13:23:20 -0500
committerIngo Molnar <mingo@elte.hu>2011-01-27 13:23:20 -0500
commitd380eaaea70d775c0520dcb5702ea5d2a56b7be9 (patch)
tree3a4c2d15f8b558c68f9d275aba411180088f4a9d /tools/perf/perf.h
parentdda99116969142cc41e945a1047a419b937536af (diff)
parentef1d1af28ca37fdbc2745da040529cd2953c1af5 (diff)
Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 into perf/core
Diffstat (limited to 'tools/perf/perf.h')
-rw-r--r--tools/perf/perf.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 95aaf565c704..a5fc660c1f12 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -94,6 +94,32 @@ void get_term_dimensions(struct winsize *ws);
94#include "util/types.h" 94#include "util/types.h"
95#include <stdbool.h> 95#include <stdbool.h>
96 96
97struct perf_mmap {
98 void *base;
99 int mask;
100 unsigned int prev;
101};
102
103static inline unsigned int perf_mmap__read_head(struct perf_mmap *mm)
104{
105 struct perf_event_mmap_page *pc = mm->base;
106 int head = pc->data_head;
107 rmb();
108 return head;
109}
110
111static inline void perf_mmap__write_tail(struct perf_mmap *md,
112 unsigned long tail)
113{
114 struct perf_event_mmap_page *pc = md->base;
115
116 /*
117 * ensure all reads are done before we write the tail out.
118 */
119 /* mb(); */
120 pc->data_tail = tail;
121}
122
97/* 123/*
98 * prctl(PR_TASK_PERF_EVENTS_DISABLE) will (cheaply) disable all 124 * prctl(PR_TASK_PERF_EVENTS_DISABLE) will (cheaply) disable all
99 * counters in the current task. 125 * counters in the current task.