Commit graph

5 commits

Author SHA1 Message Date
Peter Hutterer
8684900464 tools: libinput-record: use .yml suffix in the man page
Makes things easier when users save it as yml file

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-06-21 15:02:20 +10:00
Peter Hutterer
6e4c83636a tools: libinput-record: add support for printing libinput events
Collect libinput events together with the evdev events and print them to the
log. This makes it possible to debug the full behavior of a user's machine
rather than having to replay it with potential different race conditions/side
effects.

Example event output:
  - evdev:
    - [  2, 314443,   4,   4,    57] # EV_MSC / MSC_SCAN               57
    - [  2, 314443,   1,  57,     1] # EV_KEY / KEY_SPACE               1
    - [  2, 314443,   0,   0,     0] # ------------ SYN_REPORT (0) ---------- +87ms
    libinput:
    - {time: 2.314443, type: KEYBOARD_KEY, key: 57, state: pressed}
  - evdev:
    - [  2, 377203,   4,   4,    57] # EV_MSC / MSC_SCAN               57
    - [  2, 377203,   1,  57,     0] # EV_KEY / KEY_SPACE               0
    - [  2, 377203,   0,   0,     0] # ------------ SYN_REPORT (0) ---------- +63ms
    libinput:
    - {time: 2.377203, type: KEYBOARD_KEY, key: 57, state: released}

Note that the only way to know that events are within the same frame is to
check the timestamp. libinput keeps those intact which means we can tell that
if we just had an evdev frame with timestamp T and get a pointer motion with
timestamp T, that frame caused the motion event.

So far, only key, pointer and touch events are printed. We also
hardcode-enable tapping where available until we have options to enable this
on the commandline just because that's useful to have.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-19 14:24:15 +10:00
Peter Hutterer
e9e134a18d tools: record udev properties in libinput-record
Only the ones we care about in libinput but for those it's handy to know which
ones are set (especially the LIBINPUT_MODEL ones).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-08 09:42:44 +10:00
Peter Hutterer
b02579121b tools: add --all to libinput-record
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-01 11:50:46 +10:00
Peter Hutterer
576f2ed2a7 tools: add a libinput-record tool
This is a tool that does effectively the same job as evemu-record.
evemu has two disadvantages: its API is clunky and hard to extend even for
simple features. And it has a custom file format that requires special
processing but is difficult to extend and hard to write manually. e.g. the
bitmasks require keeping a line number state to know which bit an entry refers
to.

libinput-record records the same data but the output is YAML. That can be
processed easier and extended in the future without breaking the parsing. We
can (in the future) also interleave the evemu output with libinput's debug
output, thus having a single file where the events can be compared and
analysed without the need for replaying.  Likewise, we can easily annotate the
file with parsable bits of information without having to shove all that into a
comment (like version numbers of libinput, kernel, etc).

User-visible differences to evemu-record:
* the output file requires an explicit -o or --output-file argument
* no evemu-describe equivalent, if you just want the description simply cancel
  before any events are sent
* to see key codes, a --show-keycodes flag must be supplied, otherwise all
  'normal' keys end up as KEY_A. This protects against inadvertent information
  leakage
* supports a --multiple option to record multiple devices simultaneously. All
  recordings have the same time offset, it is thus possible to reproduce bugs
  that depend on the interaction of more than one device.

And to answer the question of: why a printf-approach to writing out yaml
instead of a library, it's simply that we want to be able to have real-time
output of the recording.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-03-01 11:50:46 +10:00