Skip to contentSkip to conversation

perf: Simplify the ring-buffer logic: make perf_buffer_alloc() do everything needed

tip:perf/core tip-bot for Peter Zijlstra 1 participant 1 message Jun 9, 2010 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  d57e34fdd60be7ffd0b1d86bfa1a553df86b7172
Gitweb:     http://git.kernel.org/tip/d57e34fdd60be7ffd0b1d86bfa1a553df86b7172
Author:     Peter Zijlstra <[email protected]>
AuthorDate: Fri, 28 May 2010 19:41:35 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 9 Jun 2010 11:12:35 +0200

perf: Simplify the ring-buffer logic: make perf_buffer_alloc() do everything needed

Currently there are perf_buffer_alloc() + perf_buffer_init() + some separate bits, fold it all into a single perf_buffer_alloc() and only leave the attachment to the event separate.

LKML-Reference: <new-submission>

---
 include/linux/perf_event.h |    2 +
 kernel/perf_event.c        |   61 ++++++++++++++++++++++++-------------------
 2 files changed, 36 insertions(+), 27 deletions(-)
include/linux/perf_event.h +2 -0
index 2a0da02..441992a 100644
@@ -602,6 +602,8 @@ enum perf_event_active_state {
 
 struct file;
 
+#define PERF_BUFFER_WRITABLE		0x01
+
 struct perf_buffer {
 	atomic_t			refcount;
 	struct rcu_head			rcu_head;
kernel/perf_event.c +34 -27

123 lines not on this page · raw message