diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2011-05-19 13:55:04 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-06-09 06:57:54 -0400 |
commit | 76369139ceb955deefc509e6e12ce9d6ce50ccab (patch) | |
tree | 5ba2732188d2fecd4fd49b93f73e51e17fb69082 /include/linux/perf_event.h | |
parent | b58f6b0dd3d677338b9065388cc2cc942b86338e (diff) |
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 <fweisbec@gmail.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Stephane Eranian <eranian@google.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1305827704-5607-1-git-send-email-fweisbec@gmail.com
[ v3: use clearer 'ring_buffer' and 'rb' naming ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r-- | include/linux/perf_event.h | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 3412684ce5d5..779f6ed54d52 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -680,33 +680,6 @@ enum perf_event_active_state { | |||
680 | }; | 680 | }; |
681 | 681 | ||
682 | struct file; | 682 | 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 | |||
710 | struct perf_sample_data; | 683 | struct perf_sample_data; |
711 | 684 | ||
712 | typedef void (*perf_overflow_handler_t)(struct perf_event *, int, | 685 | typedef void (*perf_overflow_handler_t)(struct perf_event *, int, |
@@ -745,6 +718,8 @@ struct perf_cgroup { | |||
745 | }; | 718 | }; |
746 | #endif | 719 | #endif |
747 | 720 | ||
721 | struct ring_buffer; | ||
722 | |||
748 | /** | 723 | /** |
749 | * struct perf_event - performance event kernel representation: | 724 | * struct perf_event - performance event kernel representation: |
750 | */ | 725 | */ |
@@ -834,7 +809,7 @@ struct perf_event { | |||
834 | atomic_t mmap_count; | 809 | atomic_t mmap_count; |
835 | int mmap_locked; | 810 | int mmap_locked; |
836 | struct user_struct *mmap_user; | 811 | struct user_struct *mmap_user; |
837 | struct perf_buffer *buffer; | 812 | struct ring_buffer *rb; |
838 | 813 | ||
839 | /* poll related */ | 814 | /* poll related */ |
840 | wait_queue_head_t waitq; | 815 | wait_queue_head_t waitq; |
@@ -945,7 +920,7 @@ struct perf_cpu_context { | |||
945 | 920 | ||
946 | struct perf_output_handle { | 921 | struct perf_output_handle { |
947 | struct perf_event *event; | 922 | struct perf_event *event; |
948 | struct perf_buffer *buffer; | 923 | struct ring_buffer *rb; |
949 | unsigned long wakeup; | 924 | unsigned long wakeup; |
950 | unsigned long size; | 925 | unsigned long size; |
951 | void *addr; | 926 | void *addr; |