diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-03-03 00:27:49 -0500 |
---|---|---|
committer | Steven Rostedt <srostedt@redhat.com> | 2009-03-03 20:51:24 -0500 |
commit | ef7a4a161472b952941bf78855a9cd95703c024e (patch) | |
tree | 17145213ece6872d34951a2d33af6670fc2ae453 /include/linux | |
parent | 41be4da4e85e58520b934040966a6ae919c66c2d (diff) |
ring-buffer: fix ring_buffer_read_page
The ring_buffer_read_page was broken if it were to only copy part
of the page. This patch fixes that up as well as adds a parameter
to allow a length field, in order to only copy part of the buffer page.
Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/ring_buffer.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index f5e793d69bd3..79fcbc4b09d6 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h | |||
@@ -121,6 +121,9 @@ unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu); | |||
121 | u64 ring_buffer_time_stamp(int cpu); | 121 | u64 ring_buffer_time_stamp(int cpu); |
122 | void ring_buffer_normalize_time_stamp(int cpu, u64 *ts); | 122 | void ring_buffer_normalize_time_stamp(int cpu, u64 *ts); |
123 | 123 | ||
124 | size_t ring_buffer_page_len(void *page); | ||
125 | |||
126 | |||
124 | /* | 127 | /* |
125 | * The below functions are fine to use outside the tracing facility. | 128 | * The below functions are fine to use outside the tracing facility. |
126 | */ | 129 | */ |
@@ -138,8 +141,8 @@ static inline int tracing_is_on(void) { return 0; } | |||
138 | 141 | ||
139 | void *ring_buffer_alloc_read_page(struct ring_buffer *buffer); | 142 | void *ring_buffer_alloc_read_page(struct ring_buffer *buffer); |
140 | void ring_buffer_free_read_page(struct ring_buffer *buffer, void *data); | 143 | void ring_buffer_free_read_page(struct ring_buffer *buffer, void *data); |
141 | int ring_buffer_read_page(struct ring_buffer *buffer, | 144 | int ring_buffer_read_page(struct ring_buffer *buffer, void **data_page, |
142 | void **data_page, int cpu, int full); | 145 | size_t len, int cpu, int full); |
143 | 146 | ||
144 | enum ring_buffer_flags { | 147 | enum ring_buffer_flags { |
145 | RB_FL_OVERWRITE = 1 << 0, | 148 | RB_FL_OVERWRITE = 1 << 0, |