evemu-record: add --timestamp-base option
This option allows recordings to be produced with the event timestamps
relative to boot time (like those in dmesg), rather than the time of the
first event received. Because evemu playback tools (e.g. uinput or
evemu-play on desktop Linux) immediately play the first event they
encounter and then subtract its timestamp from those of all following
events, the timestamp base used should have no effect on playback [0].
Where timestamps relative to boot come in useful is when collating data
from a recording with other logs. For example, the touchpad debugging
logs report timestamps relative to boot time, so one could record
touchpad input and those logs simultaneously, then automatically match
up events in the evemu recording with the gestures recognized by the
touchpad stack.
[0]: In fact, FreeDesktop evemu used boot time as the timestamp base
until version 1.2.0, so other timestamp bases have to be supported
to maintain backwards compatibility.
Bug: 302297266
Test: record events with --timestamp-base=boot, check recording replays
correctly with uinput
Test: check original behaviour is preserved when --timestamp-base isn't
specified
Change-Id: I89e9682bfc77267e0d5b2397c78ebfe4270e676f
1 file changed