Skip to content
  • Arnaldo Carvalho de Melo's avatar
    perf trace beauty ioctl: Improve 'cmd' beautifier · 1cc47f2d
    Arnaldo Carvalho de Melo authored
    By using the _IOC_(DIR,NR,TYPE,SIZE) macros to lookup a 'type' keyed
    table that then gets indexed by 'nr', falling back to a notation similar
    to the one used by 'strace', only more compact, i.e.:
    
       474.356 ( 0.007 ms): gnome-shell/22401 ioctl(fd: 8</dev/dri/card0>, cmd: (READ|WRITE, 0x64, 0xae, 0x1c), arg: 0x7ffc934f7880) = 0
       474.369 ( 0.053 ms): gnome-shell/22401 ioctl(fd: 8</dev/dri/card0>, cmd: (READ|WRITE, 0x64, 0xb0, 0x18), arg: 0x7ffc934f77d0) = 0
       505.055 ( 0.014 ms): gnome-shell/22401 ioctl(fd: 8</dev/dri/card0>, cmd: (READ|WRITE, 0x64, 0xaf, 0x4), arg: 0x7ffc934f741c) = 0
    
    This also moves it out of builtin-trace.c and into trace/beauty/ioctl.c
    to better compartimentalize all these formatters.
    
    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: David Ahern <dsahern@gmail.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Wang Nan <wangnan0@huawei.com>
    Link: http://lkml.kernel.org/n/tip-s3enursdxsvnhdomh6qlte4g@git.kernel.org
    
    
    Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    1cc47f2d