diff options
Diffstat (limited to 'include/linux/ring_buffer.h')
-rw-r--r-- | include/linux/ring_buffer.h | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index 29f8599e6bea..5fcc31ed5771 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h | |||
@@ -75,20 +75,6 @@ ring_buffer_event_time_delta(struct ring_buffer_event *event) | |||
75 | } | 75 | } |
76 | 76 | ||
77 | /* | 77 | /* |
78 | * ring_buffer_event_discard can discard any event in the ring buffer. | ||
79 | * it is up to the caller to protect against a reader from | ||
80 | * consuming it or a writer from wrapping and replacing it. | ||
81 | * | ||
82 | * No external protection is needed if this is called before | ||
83 | * the event is commited. But in that case it would be better to | ||
84 | * use ring_buffer_discard_commit. | ||
85 | * | ||
86 | * Note, if an event that has not been committed is discarded | ||
87 | * with ring_buffer_event_discard, it must still be committed. | ||
88 | */ | ||
89 | void ring_buffer_event_discard(struct ring_buffer_event *event); | ||
90 | |||
91 | /* | ||
92 | * ring_buffer_discard_commit will remove an event that has not | 78 | * ring_buffer_discard_commit will remove an event that has not |
93 | * ben committed yet. If this is used, then ring_buffer_unlock_commit | 79 | * ben committed yet. If this is used, then ring_buffer_unlock_commit |
94 | * must not be called on the discarded event. This function | 80 | * must not be called on the discarded event. This function |
@@ -154,8 +140,17 @@ unsigned long ring_buffer_size(struct ring_buffer *buffer); | |||
154 | void ring_buffer_reset_cpu(struct ring_buffer *buffer, int cpu); | 140 | void ring_buffer_reset_cpu(struct ring_buffer *buffer, int cpu); |
155 | void ring_buffer_reset(struct ring_buffer *buffer); | 141 | void ring_buffer_reset(struct ring_buffer *buffer); |
156 | 142 | ||
143 | #ifdef CONFIG_RING_BUFFER_ALLOW_SWAP | ||
157 | int ring_buffer_swap_cpu(struct ring_buffer *buffer_a, | 144 | int ring_buffer_swap_cpu(struct ring_buffer *buffer_a, |
158 | struct ring_buffer *buffer_b, int cpu); | 145 | struct ring_buffer *buffer_b, int cpu); |
146 | #else | ||
147 | static inline int | ||
148 | ring_buffer_swap_cpu(struct ring_buffer *buffer_a, | ||
149 | struct ring_buffer *buffer_b, int cpu) | ||
150 | { | ||
151 | return -ENODEV; | ||
152 | } | ||
153 | #endif | ||
159 | 154 | ||
160 | int ring_buffer_empty(struct ring_buffer *buffer); | 155 | int ring_buffer_empty(struct ring_buffer *buffer); |
161 | int ring_buffer_empty_cpu(struct ring_buffer *buffer, int cpu); | 156 | int ring_buffer_empty_cpu(struct ring_buffer *buffer, int cpu); |
@@ -170,7 +165,6 @@ unsigned long ring_buffer_overruns(struct ring_buffer *buffer); | |||
170 | unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu); | 165 | unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu); |
171 | unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu); | 166 | unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu); |
172 | unsigned long ring_buffer_commit_overrun_cpu(struct ring_buffer *buffer, int cpu); | 167 | unsigned long ring_buffer_commit_overrun_cpu(struct ring_buffer *buffer, int cpu); |
173 | unsigned long ring_buffer_nmi_dropped_cpu(struct ring_buffer *buffer, int cpu); | ||
174 | 168 | ||
175 | u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu); | 169 | u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu); |
176 | void ring_buffer_normalize_time_stamp(struct ring_buffer *buffer, | 170 | void ring_buffer_normalize_time_stamp(struct ring_buffer *buffer, |