diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-12 14:11:53 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-22 16:56:29 -0500 |
commit | 115d2d8963a426670ac3ce983fc4c4e001703943 (patch) | |
tree | c37115abbf95a7c68b0a99b1cf60e0ee0e48b7ea /tools/perf/perf.h | |
parent | 744bd8aa3c8b43447f689a27872fa95e700b8a4f (diff) |
perf record: Move perf_mmap__write_tail to perf.h
Close to perf_mmap__read_head() and the perf_mmap struct definition.
This is useful for any recorder, and we will need it in 'perf test'.
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/perf.h')
-rw-r--r-- | tools/perf/perf.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/perf/perf.h b/tools/perf/perf.h index 5fb5e1f11d1c..a5fc660c1f12 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h | |||
@@ -108,6 +108,18 @@ static inline unsigned int perf_mmap__read_head(struct perf_mmap *mm) | |||
108 | return head; | 108 | return head; |
109 | } | 109 | } |
110 | 110 | ||
111 | static 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 | |||
111 | /* | 123 | /* |
112 | * prctl(PR_TASK_PERF_EVENTS_DISABLE) will (cheaply) disable all | 124 | * prctl(PR_TASK_PERF_EVENTS_DISABLE) will (cheaply) disable all |
113 | * counters in the current task. | 125 | * counters in the current task. |