diff options
Diffstat (limited to 'kernel/trace/ring_buffer.c')
-rw-r--r-- | kernel/trace/ring_buffer.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index bffde630c4e2..e145969a8eda 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c | |||
@@ -1642,6 +1642,14 @@ int ring_buffer_unlock_commit(struct ring_buffer *buffer, | |||
1642 | } | 1642 | } |
1643 | EXPORT_SYMBOL_GPL(ring_buffer_unlock_commit); | 1643 | EXPORT_SYMBOL_GPL(ring_buffer_unlock_commit); |
1644 | 1644 | ||
1645 | static inline void rb_event_discard(struct ring_buffer_event *event) | ||
1646 | { | ||
1647 | event->type = RINGBUF_TYPE_PADDING; | ||
1648 | /* time delta must be non zero */ | ||
1649 | if (!event->time_delta) | ||
1650 | event->time_delta = 1; | ||
1651 | } | ||
1652 | |||
1645 | /** | 1653 | /** |
1646 | * ring_buffer_event_discard - discard any event in the ring buffer | 1654 | * ring_buffer_event_discard - discard any event in the ring buffer |
1647 | * @event: the event to discard | 1655 | * @event: the event to discard |
@@ -1656,10 +1664,8 @@ EXPORT_SYMBOL_GPL(ring_buffer_unlock_commit); | |||
1656 | */ | 1664 | */ |
1657 | void ring_buffer_event_discard(struct ring_buffer_event *event) | 1665 | void ring_buffer_event_discard(struct ring_buffer_event *event) |
1658 | { | 1666 | { |
1659 | event->type = RINGBUF_TYPE_PADDING; | 1667 | rb_event_discard(event); |
1660 | /* time delta must be non zero */ | 1668 | trace_recursive_unlock(); |
1661 | if (!event->time_delta) | ||
1662 | event->time_delta = 1; | ||
1663 | } | 1669 | } |
1664 | EXPORT_SYMBOL_GPL(ring_buffer_event_discard); | 1670 | EXPORT_SYMBOL_GPL(ring_buffer_event_discard); |
1665 | 1671 | ||
@@ -1690,7 +1696,7 @@ void ring_buffer_discard_commit(struct ring_buffer *buffer, | |||
1690 | int cpu; | 1696 | int cpu; |
1691 | 1697 | ||
1692 | /* The event is discarded regardless */ | 1698 | /* The event is discarded regardless */ |
1693 | ring_buffer_event_discard(event); | 1699 | rb_event_discard(event); |
1694 | 1700 | ||
1695 | /* | 1701 | /* |
1696 | * This must only be called if the event has not been | 1702 | * This must only be called if the event has not been |
@@ -1735,6 +1741,8 @@ void ring_buffer_discard_commit(struct ring_buffer *buffer, | |||
1735 | if (rb_is_commit(cpu_buffer, event)) | 1741 | if (rb_is_commit(cpu_buffer, event)) |
1736 | rb_set_commit_to_write(cpu_buffer); | 1742 | rb_set_commit_to_write(cpu_buffer); |
1737 | 1743 | ||
1744 | trace_recursive_unlock(); | ||
1745 | |||
1738 | /* | 1746 | /* |
1739 | * Only the last preempt count needs to restore preemption. | 1747 | * Only the last preempt count needs to restore preemption. |
1740 | */ | 1748 | */ |