]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ring-buffer: Get timestamp after event is allocated
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Fri, 29 May 2015 13:40:18 +0000 (09:40 -0400)
committerSteven Rostedt <rostedt@goodmis.org>
Tue, 21 Jul 2015 02:30:48 +0000 (22:30 -0400)
commita4543a2fa9ef31d6d0f854a4e14f8f82e7996d8d
tree20ce0568e66867059279578471fe574d18c21cad
parent9826b2733a4399149072058a11f611357479229d
ring-buffer: Get timestamp after event is allocated

Move the capturing of the timestamp to after an event is allocated.
If the event is not a commit (where it is an event that preempted
another event), then no timestamp is needed, because the delta of
nested events is always zero.

If the event starts on a new page, no delta needs to be calculated
as the full timestamp will be added to the page header, and the
event will have a delta of zero.

Now if the event requires a time extend (the delta does not fit
in the 27 bit delta slot in the header), then the event is discarded,
the length is extended to hold the TIME_EXTEND event that allows for
a 59 bit delta, and the commit is tried again.

If the event can't be discarded (another event came in after it),
then the TIME_EXTEND is added directly to the allocated event and
the rest of the event is given padding.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/ring_buffer.c