Handle more inputs, highlight keywords
readme: Add limitations section
readme: Add error example
Tool to help search drm debug logs. Build with go build
.
List all ioctls, how many messages occurred during them and their return codes (blank ioctl names indicate messages that happened outside an ioctl call):
$ cat dmesg.log | drminspect
0: <no ioctl>: 11 line(s)
1: I915_GET_RESET_STATS: 1 line(s), clay2 (32071): 0
2: I915_GET_RESET_STATS: 1 line(s), clay2 (32071): 0
3: I915_GEM_CREATE_EXT: 1 line(s), clay2 (32071): 0
4: I915_GEM_SET_DOMAIN: 1 line(s), clay2 (32071): 0
5: I915_GEM_MMAP_OFFSET: 1 line(s), clay2 (32071): 0
6: DRM_IOCTL_SYNCOBJ_WAIT: 1 line(s), clay2 (32071): 0
...
466: DRM_IOCTL_SYNCOBJ_CREATE: 1 line(s), clay2 (32071): 0
467: DRM_IOCTL_MODE_ATOMIC: 48 line(s), clay2 (32071): 0
468: DRM_IOCTL_MODE_ATOMIC: 42 line(s), clay2 (32071): -16
List messages during a specific ioctl:
$ cat dmesg.log | drminspect 468
[18824.869143] i915 0000:00:02.0: [drm:drm_ioctl] comm="clay2" pid=32071, dev=0xe201, auth=1, DRM_IOCTL_MODE_ATOMIC
[18824.869155] i915 0000:00:02.0: [drm:drm_atomic_state_init] Allocated atomic state 000000009a4e1851
[18824.869161] [drm:drm_mode_object_get] OBJ ID: 127 (5)
[18824.869163] [drm:drm_mode_object_get] OBJ ID: 127 (6)
[18824.869165] i915 0000:00:02.0: [drm:drm_atomic_get_plane_state] Added [PLANE:31:plane 1A] 00000000bedd76d7 state to 000000009a4e1851
...
[18824.869800] i915 0000:00:02.0: [drm:intel_plane_atomic_check_with_stat] [i915]] [CRTC:51:pipe A] with [PLANE:47:cursor A] visible 1 -> 1, off 0, on 0, ms 0
[18824.870210] i915 0000:00:02.0: [drm:intel_atomic_get_global_obj_stat] [i915]] Added new global object 00000000dd7f2188 state 0000000099a454d5 to 000000009a4e1851
[18824.870523] i915 0000:00:02.0: [drm:intel_atomic_get_global_obj_stat] [i915]] Added new global object 00000000ebe7658c state 00000000fd6815cc to 000000009a4e1851
[18824.870821] i915 0000:00:02.0: [drm:drm_atomic_nonblocking_commit] committing 000000009a4e1851 nonblocking
[18824.870881] i915 0000:00:02.0: [drm:drm_atomic_helper_setup_commit] [CRTC:51:pipe A] busy with a previous commit
[18824.870899] i915 0000:00:02.0: [drm:drm_ioctl] comm="clay2", pid=32071, ret=-16
List messages for a range of ioctls:
$ cat dmesg.log | drminspect 467 468
# does what you expect
It should be good enough for debugging e.g. failed atomic commits. Support for more complex cases like dealing with multiple processes can be added if need be.
Go to #kennylevinsen @ irc.libera.chat to discuss, or use ~kennylevinsen/public-inbox@lists.sr.ht