]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ring-buffer: Always inline rb_event_data()
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Wed, 23 Nov 2016 16:40:34 +0000 (11:40 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Wed, 23 Nov 2016 16:40:34 +0000 (11:40 -0500)
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>
kernel/trace/ring_buffer.c

index 1f3580cee6cc771b532dd6897b33e89906c8861f..2760aaca6d1bfa4e41b98d7def89abc91a78d666 100644 (file)
@@ -245,7 +245,7 @@ unsigned ring_buffer_event_length(struct ring_buffer_event *event)
 EXPORT_SYMBOL_GPL(ring_buffer_event_length);
 
 /* inline for ring buffer fast paths */
-static void *
+static __always_inline void *
 rb_event_data(struct ring_buffer_event *event)
 {
        if (event->type_len == RINGBUF_TYPE_TIME_EXTEND)