diff options
Diffstat (limited to 'include/linux/ring_buffer.h')
-rw-r--r-- | include/linux/ring_buffer.h | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index b3b359660082..e1b7b2173885 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h | |||
@@ -8,7 +8,7 @@ struct ring_buffer; | |||
8 | struct ring_buffer_iter; | 8 | struct ring_buffer_iter; |
9 | 9 | ||
10 | /* | 10 | /* |
11 | * Don't reference this struct directly, use functions below. | 11 | * Don't refer to this struct directly, use functions below. |
12 | */ | 12 | */ |
13 | struct ring_buffer_event { | 13 | struct ring_buffer_event { |
14 | u32 type:2, len:3, time_delta:27; | 14 | u32 type:2, len:3, time_delta:27; |
@@ -18,10 +18,13 @@ struct ring_buffer_event { | |||
18 | /** | 18 | /** |
19 | * enum ring_buffer_type - internal ring buffer types | 19 | * enum ring_buffer_type - internal ring buffer types |
20 | * | 20 | * |
21 | * @RINGBUF_TYPE_PADDING: Left over page padding | 21 | * @RINGBUF_TYPE_PADDING: Left over page padding or discarded event |
22 | * array is ignored | 22 | * If time_delta is 0: |
23 | * size is variable depending on how much | 23 | * array is ignored |
24 | * size is variable depending on how much | ||
24 | * padding is needed | 25 | * padding is needed |
26 | * If time_delta is non zero: | ||
27 | * everything else same as RINGBUF_TYPE_DATA | ||
25 | * | 28 | * |
26 | * @RINGBUF_TYPE_TIME_EXTEND: Extend the time delta | 29 | * @RINGBUF_TYPE_TIME_EXTEND: Extend the time delta |
27 | * array[0] = time delta (28 .. 59) | 30 | * array[0] = time delta (28 .. 59) |
@@ -65,6 +68,8 @@ ring_buffer_event_time_delta(struct ring_buffer_event *event) | |||
65 | return event->time_delta; | 68 | return event->time_delta; |
66 | } | 69 | } |
67 | 70 | ||
71 | void ring_buffer_event_discard(struct ring_buffer_event *event); | ||
72 | |||
68 | /* | 73 | /* |
69 | * size is in bytes for each per CPU buffer. | 74 | * size is in bytes for each per CPU buffer. |
70 | */ | 75 | */ |
@@ -74,13 +79,10 @@ void ring_buffer_free(struct ring_buffer *buffer); | |||
74 | 79 | ||
75 | int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size); | 80 | int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size); |
76 | 81 | ||
77 | struct ring_buffer_event * | 82 | struct ring_buffer_event *ring_buffer_lock_reserve(struct ring_buffer *buffer, |
78 | ring_buffer_lock_reserve(struct ring_buffer *buffer, | 83 | unsigned long length); |
79 | unsigned long length, | ||
80 | unsigned long *flags); | ||
81 | int ring_buffer_unlock_commit(struct ring_buffer *buffer, | 84 | int ring_buffer_unlock_commit(struct ring_buffer *buffer, |
82 | struct ring_buffer_event *event, | 85 | struct ring_buffer_event *event); |
83 | unsigned long flags); | ||
84 | int ring_buffer_write(struct ring_buffer *buffer, | 86 | int ring_buffer_write(struct ring_buffer *buffer, |
85 | unsigned long length, void *data); | 87 | unsigned long length, void *data); |
86 | 88 | ||
@@ -121,17 +123,19 @@ unsigned long ring_buffer_overruns(struct ring_buffer *buffer); | |||
121 | unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu); | 123 | unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu); |
122 | unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu); | 124 | unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu); |
123 | 125 | ||
124 | u64 ring_buffer_time_stamp(int cpu); | 126 | u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu); |
125 | void ring_buffer_normalize_time_stamp(int cpu, u64 *ts); | 127 | void ring_buffer_normalize_time_stamp(struct ring_buffer *buffer, |
128 | int cpu, u64 *ts); | ||
129 | void ring_buffer_set_clock(struct ring_buffer *buffer, | ||
130 | u64 (*clock)(void)); | ||
131 | |||
132 | size_t ring_buffer_page_len(void *page); | ||
126 | 133 | ||
127 | void tracing_on(void); | ||
128 | void tracing_off(void); | ||
129 | void tracing_off_permanent(void); | ||
130 | 134 | ||
131 | void *ring_buffer_alloc_read_page(struct ring_buffer *buffer); | 135 | void *ring_buffer_alloc_read_page(struct ring_buffer *buffer); |
132 | void ring_buffer_free_read_page(struct ring_buffer *buffer, void *data); | 136 | void ring_buffer_free_read_page(struct ring_buffer *buffer, void *data); |
133 | int ring_buffer_read_page(struct ring_buffer *buffer, | 137 | int ring_buffer_read_page(struct ring_buffer *buffer, void **data_page, |
134 | void **data_page, int cpu, int full); | 138 | size_t len, int cpu, int full); |
135 | 139 | ||
136 | enum ring_buffer_flags { | 140 | enum ring_buffer_flags { |
137 | RB_FL_OVERWRITE = 1 << 0, | 141 | RB_FL_OVERWRITE = 1 << 0, |