Skip to content

Commit 929ddbf

Browse files
committed
ring-buffer: Always inline rb_event_data()
The rb_event_data() is the fast path of getting the ring buffer data from an event. Externally, ring_buffer_event_data() is used to access this function. But unfortunately, rb_event_data() is not inlined, and calling ring_buffer_event_data() causes that function to be called again. Force rb_event_data() to be inlined to lower the number of operations needed when calling ring_buffer_event_data(). Link: http://lkml.kernel.org/r/20161121183700.GW26852@two.firstfloor.org Reported-by: Andi Kleen <andi@firstfloor.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent fa7ffb3 commit 929ddbf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎kernel/trace/ring_buffer.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ unsigned ring_buffer_event_length(struct ring_buffer_event *event)
245245
EXPORT_SYMBOL_GPL(ring_buffer_event_length);
246246

247247
/* inline for ring buffer fast paths */
248-
static void *
248+
static __always_inline void *
249249
rb_event_data(struct ring_buffer_event *event)
250250
{
251251
if (event->type_len == RINGBUF_TYPE_TIME_EXTEND)

0 commit comments

Comments
 (0)