Skip to content

tracing: Simplify and document the trace event filtering temp buffer code

Steven Rostedt lkml 2 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 0 repliesNew
  2. v12 patches 2 repliesSuperseded

Changes in v2 from the cover letter

Switch "unlikely" to "likely"
Test max_len <= instead of just <

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2tracing: Simplify the max length test when using the filtering temp bufferkernel/trace/trace.c+3 -10 replies
2/2tracing: Add better comments for the filtering temp buffer use casekernel/trace/trace.c+35 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

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

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.

Changes since v1:
Switch "unlikely" to "likely"
Test max_len <= instead of just <

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(-)