[RFC PATCH v4 0/1] Add decoding of general DRM ioctl

Zhibin Li haoyouab at gmail.com
Mon Aug 12 16:41:25 UTC 2019


In this patch I simply copy the libdrm headers into strace to get rid of
all those #ifdefs around drm ioctl constants. And there are still some
unfinished work. -v option is not added and I will try to discuss this
with you all later. I haven't incorporated esyr's print_local_array
since I'm not sure if I should rebase this commit and send them
together. drm_noop ioctls need to be tracked back to see if they worth
decoding. I might miss some thing here and comments are appreciated.

Changes in V4: 
 - Bundle the latest libdrm headers into strace so no need to check
   those #ifdefs now (any copyright statement needed?).
 - Factor out the common comma printing into ioctl_drm().
 - All #includes moved to the beginning.
 - Use the correct PRINT_FIELD_* macros.
 - Add a PRINT_FIELD_DRM_CRTC_ID macro for printing drm crtc_id fields
   since it's common in drm code. It's just a wrapper of PRINT_FIELD_U.
 - Print all pointers to arrays using print_array and provide
   corresponding callback printing functions.
 - Make all those missing R/W fields in place.
 - Those missing flags are added, too.
 - Add print_uint16_array_member().
 - Add a macro for wrapping !syserror && !umove.
 - Add #sorted and #value_indexed to xlat files.

Zhibin Li (1):
  drm: implement decoding of DRM ioctls

 Makefile.am                            |    4 +
 defs.h                                 |   13 +
 drm.c                                  | 1553 ++++++++++++++++++++++++
 drm_mpers.c                            |  882 ++++++++++++++
 ioctl.c                                |    4 +
 linux/drm/drm.h                        | 1042 ++++++++++++++++
 linux/drm/drm_mode.h                   |  914 ++++++++++++++
 print_fields.h                         |    3 +
 util.c                                 |    9 +
 xlat/drm_buf_desc_flags.in             |    6 +
 xlat/drm_capability.in                 |   15 +
 xlat/drm_client_capability.in          |    6 +
 xlat/drm_control_func.in               |    5 +
 xlat/drm_crtc_sequence_flags.in        |    3 +
 xlat/drm_ctx_flags.in                  |    3 +
 xlat/drm_lock_flags.in                 |    7 +
 xlat/drm_map_flags.in                  |    9 +
 xlat/drm_map_type.in                   |    7 +
 xlat/drm_mode_atomic_flags.in          |    6 +
 xlat/drm_mode_create_lease_flags.in    |    2 +
 xlat/drm_mode_cursor_flags.in          |    3 +
 xlat/drm_mode_encoder_type.in          |   10 +
 xlat/drm_mode_fb_cmd2_flags.in         |    3 +
 xlat/drm_mode_fb_dirty_cmd_flags.in    |    3 +
 xlat/drm_mode_flags.in                 |    6 +
 xlat/drm_mode_get_property_flags.in    |    9 +
 xlat/drm_mode_page_flip_flags.in       |    5 +
 xlat/drm_mode_set_plane_flags.in       |    3 +
 xlat/drm_mode_type.in                  |    8 +
 xlat/drm_modeset_cmd.in                |    3 +
 xlat/drm_prime_handle_flags.in         |    2 +
 xlat/drm_syncobj_fd_to_handle_flags.in |    2 +
 xlat/drm_syncobj_flags.in              |    2 +
 xlat/drm_syncobj_handle_to_fd_flags.in |    1 +
 xlat/drm_syncobj_wait_flags.in         |    4 +
 xlat/drm_vblank_seq_type.in            |    3 +
 xlat/drm_vblank_seq_type_flags.in      |    6 +
 37 files changed, 4566 insertions(+)
 create mode 100644 drm.c
 create mode 100644 drm_mpers.c
 create mode 100644 linux/drm/drm.h
 create mode 100644 linux/drm/drm_mode.h
 create mode 100644 xlat/drm_buf_desc_flags.in
 create mode 100644 xlat/drm_capability.in
 create mode 100644 xlat/drm_client_capability.in
 create mode 100644 xlat/drm_control_func.in
 create mode 100644 xlat/drm_crtc_sequence_flags.in
 create mode 100644 xlat/drm_ctx_flags.in
 create mode 100644 xlat/drm_lock_flags.in
 create mode 100644 xlat/drm_map_flags.in
 create mode 100644 xlat/drm_map_type.in
 create mode 100644 xlat/drm_mode_atomic_flags.in
 create mode 100644 xlat/drm_mode_create_lease_flags.in
 create mode 100644 xlat/drm_mode_cursor_flags.in
 create mode 100644 xlat/drm_mode_encoder_type.in
 create mode 100644 xlat/drm_mode_fb_cmd2_flags.in
 create mode 100644 xlat/drm_mode_fb_dirty_cmd_flags.in
 create mode 100644 xlat/drm_mode_flags.in
 create mode 100644 xlat/drm_mode_get_property_flags.in
 create mode 100644 xlat/drm_mode_page_flip_flags.in
 create mode 100644 xlat/drm_mode_set_plane_flags.in
 create mode 100644 xlat/drm_mode_type.in
 create mode 100644 xlat/drm_modeset_cmd.in
 create mode 100644 xlat/drm_prime_handle_flags.in
 create mode 100644 xlat/drm_syncobj_fd_to_handle_flags.in
 create mode 100644 xlat/drm_syncobj_flags.in
 create mode 100644 xlat/drm_syncobj_handle_to_fd_flags.in
 create mode 100644 xlat/drm_syncobj_wait_flags.in
 create mode 100644 xlat/drm_vblank_seq_type.in
 create mode 100644 xlat/drm_vblank_seq_type_flags.in

-- 
2.20.1



More information about the Strace-devel mailing list