diff options
Diffstat (limited to 'kernel/trace')
| -rw-r--r-- | kernel/trace/ring_buffer.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 9d939e7ca924..092fe0c8fdae 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c | |||
| @@ -2328,31 +2328,16 @@ static inline void rb_event_discard(struct ring_buffer_event *event) | |||
| 2328 | } | 2328 | } |
| 2329 | 2329 | ||
| 2330 | /** | 2330 | /** |
| 2331 | * ring_buffer_event_discard - discard any event in the ring buffer | ||
| 2332 | * @event: the event to discard | ||
| 2333 | * | ||
| 2334 | * Sometimes a event that is in the ring buffer needs to be ignored. | ||
| 2335 | * This function lets the user discard an event in the ring buffer | ||
| 2336 | * and then that event will not be read later. | ||
| 2337 | * | ||
| 2338 | * Note, it is up to the user to be careful with this, and protect | ||
| 2339 | * against races. If the user discards an event that has been consumed | ||
| 2340 | * it is possible that it could corrupt the ring buffer. | ||
| 2341 | */ | ||
| 2342 | void ring_buffer_event_discard(struct ring_buffer_event *event) | ||
| 2343 | { | ||
| 2344 | rb_event_discard(event); | ||
| 2345 | } | ||
| 2346 | EXPORT_SYMBOL_GPL(ring_buffer_event_discard); | ||
| 2347 | |||
| 2348 | /** | ||
| 2349 | * ring_buffer_commit_discard - discard an event that has not been committed | 2331 | * ring_buffer_commit_discard - discard an event that has not been committed |
| 2350 | * @buffer: the ring buffer | 2332 | * @buffer: the ring buffer |
| 2351 | * @event: non committed event to discard | 2333 | * @event: non committed event to discard |
| 2352 | * | 2334 | * |
| 2353 | * This is similar to ring_buffer_event_discard but must only be | 2335 | * Sometimes an event that is in the ring buffer needs to be ignored. |
| 2354 | * performed on an event that has not been committed yet. The difference | 2336 | * This function lets the user discard an event in the ring buffer |
| 2355 | * is that this will also try to free the event from the ring buffer | 2337 | * and then that event will not be read later. |
| 2338 | * | ||
| 2339 | * This function only works if it is called before the the item has been | ||
| 2340 | * committed. It will try to free the event from the ring buffer | ||
| 2356 | * if another event has not been added behind it. | 2341 | * if another event has not been added behind it. |
| 2357 | * | 2342 | * |
| 2358 | * If another event has been added behind it, it will set the event | 2343 | * If another event has been added behind it, it will set the event |
