[PATCH 0/2] tracing: Simplify and document the trace event filtering temp buffer code

From: Steven Rostedt
Date: Wed Jun 09 2021 - 18:05:41 EST



When filtering trace events, a temp buffer is used because the extra copy
from the temp buffer into the ring buffer is still faster than the direct
write into the ring buffer followed by a discard if the filter does not
match.

But the data that can be stored in the temp buffer is a PAGE_SIZE minus the
ring buffer event header. The calculation of that header size is complex,
but using the helper macro "struct_size()" can simplify it.

Also, add more documentation about what is going on.

Link: https://lore.kernel.org/stable/CAHk-=whKbJkuVmzb0hD3N6q7veprUrSpiBHRxVY=AffWZPtxmg@xxxxxxxxxxxxxx/

Steven Rostedt (VMware) (2):
tracing: Simplify the max length test when using the filtering temp buffer
tracing: Add better comments for the filtering temp buffer use case

----
kernel/trace/trace.c | 40 ++++++++++++++++++++++++++++++++++++++--
1 file changed, 38 insertions(+), 2 deletions(-)