The function rb_reserved_next_event() is called by two functions: ring_buffer_lock_reserve() and ring_buffer_write(). This is in a very hot path of the tracing code, and it is best that they are not functions. The two callers are basically wrapers for rb_reserver_next_event(). Removing the function calls can save execution time in the hotpath of tracing. Link: http://lkml.kernel.org/r/20161121183700.GW26852@two.firstfloor.org
Unified · Split
| @@ -2733,7 +2733,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer, · 2732 unmodified lines | ||
| 2733 | 2733 | return event; |
| 2734 | 2734 | } |
| 2735 | 2735 | |
| 2736 | −static struct ring_buffer_event * | |
| 2736 | +static __always_inline struct ring_buffer_event * | |
| 2737 | 2737 | rb_reserve_next_event(struct ring_buffer *buffer, |
| 2738 | 2738 | struct ring_buffer_per_cpu *cpu_buffer, |
| 2739 | 2739 | unsigned long length) |