]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Simplify the max length test when using the filtering temp buffer
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 9 Jun 2021 22:04:58 +0000 (18:04 -0400)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 10 Jun 2021 17:42:03 +0000 (13:42 -0400)
commit272b9c4128d78e2e5542d0ba817223bae5da2ca9
tree48605cec7494363fa92500802a9ae2f474d94641
parentfa847d8c118f1fcc285df00b3696abf64e036985
tracing: Simplify the max length test when using the filtering temp buffer

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.

Link: https://lore.kernel.org/stable/CAHk-=whKbJkuVmzb0hD3N6q7veprUrSpiBHRxVY=AffWZPtxmg@mail.gmail.com/
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace.c