Skip to content

Commit 7636913

Browse files
fweisbecIngo Molnar
authored andcommitted
perf: Split up buffer handling from core code
And create the internal perf events header. v2: Keep an internal inlined perf_output_copy() Signed-off-by: Frederic Weisbecker <[email protected]> Acked-by: Peter Zijlstra <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Steven Rostedt <[email protected]> Link: http://lkml.kernel.org/r/[email protected] [ v3: use clearer 'ring_buffer' and 'rb' naming ] Signed-off-by: Ingo Molnar <[email protected]>
1 parent b58f6b0 commit 7636913

File tree

5 files changed

+572
-527
lines changed

5 files changed

+572
-527
lines changed

include/linux/perf_event.h

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -680,33 +680,6 @@ enum perf_event_active_state {
680680
};
681681

682682
struct file;
683-
684-
#define PERF_BUFFER_WRITABLE 0x01
685-
686-
struct perf_buffer {
687-
atomic_t refcount;
688-
struct rcu_head rcu_head;
689-
#ifdef CONFIG_PERF_USE_VMALLOC
690-
struct work_struct work;
691-
int page_order; /* allocation order */
692-
#endif
693-
int nr_pages; /* nr of data pages */
694-
int writable; /* are we writable */
695-
696-
atomic_t poll; /* POLL_ for wakeups */
697-
698-
local_t head; /* write position */
699-
local_t nest; /* nested writers */
700-
local_t events; /* event limit */
701-
local_t wakeup; /* wakeup stamp */
702-
local_t lost; /* nr records lost */
703-
704-
long watermark; /* wakeup watermark */
705-
706-
struct perf_event_mmap_page *user_page;
707-
void *data_pages[0];
708-
};
709-
710683
struct perf_sample_data;
711684

712685
typedef void (*perf_overflow_handler_t)(struct perf_event *, int,
@@ -745,6 +718,8 @@ struct perf_cgroup {
745718
};
746719
#endif
747720

721+
struct ring_buffer;
722+
748723
/**
749724
* struct perf_event - performance event kernel representation:
750725
*/
@@ -834,7 +809,7 @@ struct perf_event {
834809
atomic_t mmap_count;
835810
int mmap_locked;
836811
struct user_struct *mmap_user;
837-
struct perf_buffer *buffer;
812+
struct ring_buffer *rb;
838813

839814
/* poll related */
840815
wait_queue_head_t waitq;
@@ -945,7 +920,7 @@ struct perf_cpu_context {
945920

946921
struct perf_output_handle {
947922
struct perf_event *event;
948-
struct perf_buffer *buffer;
923+
struct ring_buffer *rb;
949924
unsigned long wakeup;
950925
unsigned long size;
951926
void *addr;

kernel/events/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ ifdef CONFIG_FUNCTION_TRACER
22
CFLAGS_REMOVE_core.o = -pg
33
endif
44

5-
obj-y := core.o
5+
obj-y := core.o ring_buffer.o
66
obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o

0 commit comments

Comments
 (0)