• Arnaldo Carvalho de Melo's avatar
    tools headers UAPI: Sync drm/drm.h with the kernel · 9903c64f
    Arnaldo Carvalho de Melo authored
    To pick up the changes in these csets:
    
      060cebb2 ("drm: introduce a capability flag for syncobj timeline support")
      50d1ebef ("drm/syncobj: add timeline signal ioctl for syncobj v5")
      ea569910 ("drm/syncobj: add transition iotcls between binary and timeline v2")
      27b575a9 ("drm/syncobj: add timeline payload query ioctl v6")
      01d6c357 ("drm/syncobj: add support for timeline point wait v8")
      783195ec ("drm/syncobj: disable the timeline UAPI for now v2")
      48197bc5 ("drm: add syncobj timeline support v9")
    
    Which automagically results in the following new ioctls being recognized
    by the 'perf trace' ioctl cmd arg beautifier:
    
      $ tools/perf/trace/beauty/drm_ioctl.sh > /tmp/before
      $ cp include/uapi/drm/drm.h tools/include/uapi/drm/drm.h
      $ tools/perf/trace/beauty/drm_ioctl.sh > /tmp/after
      $ diff -u /tmp/before /tmp/after
      --- /tmp/before	2019-05-22 10:25:31.443151182 -0300
      +++ /tmp/after	2019-05-22 10:25:46.449354819 -0300
      @@ -103,6 +103,10 @@
       	[0xC7] = "MODE_LIST_LESSEES",
       	[0xC8] = "MODE_GET_LEASE",
       	[0xC9] = "MODE_REVOKE_LEASE",
      +	[0xCA] = "SYNCOBJ_TIMELINE_WAIT",
      +	[0xCB] = "SYNCOBJ_QUERY",
      +	[0xCC] = "SYNCOBJ_TRANSFER",
      +	[0xCD] = "SYNCOBJ_TIMELINE_SIGNAL",
       	[DRM_COMMAND_BASE + 0x00] = "I915_INIT",
       	[DRM_COMMAND_BASE + 0x01] = "I915_FLUSH",
       	[DRM_COMMAND_BASE + 0x02] = "I915_FLIP",
        $
    
    I.e. the strace like raw_tracepoint:sys_enter handler in 'perf trace'
    will get the cmd integer value and map it to the string.
    
    At some point it should be possible to translate from string to integer
    and use to filter using expressions such as:
    
       # perf trace -e ioctl/cmd==DRM_IOCTL_SYNCOBJ*/
    
    Or some more suitable syntax to express that only these ioctls when
    acting on DRM fds should be shown.
    Acked-by: default avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
    Cc: Christian König <christian.koenig@amd.com>
    Cc: Chunming Zhou <david1.zhou@amd.com>
    Cc: Dave Airlie <airlied@redhat.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Luis Cláudio Gonçalves <lclaudio@redhat.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Link: https://lkml.kernel.org/n/tip-jrc9ogw33w4zgqc3pu7o1l3g@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    9903c64f
drm.h 31.6 KB