aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ring_buffer.h
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2008-12-02 15:34:07 -0500
committerIngo Molnar <mingo@elte.hu>2008-12-03 02:56:21 -0500
commit8789a9e7df6bf9b93739c4c7d4e380725bc9e936 (patch)
tree0930b286d987611b4a453766e8479bb005edbc27 /include/linux/ring_buffer.h
parentabc9b56d66fbd4d93302ef4bf6fa726e1b8255f9 (diff)
ring-buffer: read page interface
Impact: new API to ring buffer This patch adds a new interface into the ring buffer that allows a page to be read from the ring buffer on a given CPU. For every page read, one must also be given to allow for a "swap" of the pages. rpage = ring_buffer_alloc_read_page(buffer); if (!rpage) goto err; ret = ring_buffer_read_page(buffer, &rpage, cpu, full); if (!ret) goto empty; process_page(rpage); ring_buffer_free_read_page(rpage); The caller of these functions must handle any waits that are needed to wait for new data. The ring_buffer_read_page will simply return 0 if there is no data, or if "full" is set and the writer is still on the current page. Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/ring_buffer.h')
-rw-r--r--include/linux/ring_buffer.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index 3bb87a753fa3..1a350a847edd 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -124,6 +124,11 @@ void tracing_on(void);
124void tracing_off(void); 124void tracing_off(void);
125void tracing_off_permanent(void); 125void tracing_off_permanent(void);
126 126
127void *ring_buffer_alloc_read_page(struct ring_buffer *buffer);
128void ring_buffer_free_read_page(struct ring_buffer *buffer, void *data);
129int ring_buffer_read_page(struct ring_buffer *buffer,
130 void **data_page, int cpu, int full);
131
127enum ring_buffer_flags { 132enum ring_buffer_flags {
128 RB_FL_OVERWRITE = 1 << 0, 133 RB_FL_OVERWRITE = 1 << 0,
129}; 134};