Tracepoints cleanup and improvements for requests

Submitted by Tvrtko Ursulin on Jan. 27, 2017, 12:01 p.m.

Details

Reviewer None
Submitted Jan. 27, 2017, 12:01 p.m.
Last Updated Jan. 30, 2017, 11:24 p.m.
Revision 5

Cover Letter(s)

Revision 1
      From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

During some performance analysis I have noticed that currently our trace points
are in a bit of a mess, especially the ones relating to requests.

This series attempts to tidy some of that and also adds some new trace points.

These new trace points are usable to analyze the engine utilization and also
look at how the scheduler resolves dependencies and fences, how much time
requests spend being blocked, and so on.

With some post-processing the new trace points can be used to generate request
and engine timeline graphs like for example the on on this URL:

https://people.freedesktop.org/~tursulin/trace-demo.html

If people find this interesting we could also merge the post-processing tool
to IGT. Although ideally, someone more versed in GUI development could pick up
on the general idea an implement something better than the not very scalable
or precise JS library I have used to prototype this.

Current way of getting to the graphs is essentially:

perf record -e <list-of-events> -a -c 1 binary-to-be-traced
perf script | trace.pl >output.html

Tvrtko

Tvrtko Ursulin (8):
  drm/i915/tracepoints: Tidy request event class
  drm/i915/tracepoints: Adjust i915_gem_ring_dispatch
  drm/i915/tracepoints: Tidy i915_gem_request_wait_begin
  drm/i915/tracepoints: Remove unused i915_gem_request_complete
  drm/i915/tracepoints: Add request submit and execute tracepoints
  drm/i915/tracepoints: Rename i915_gem_request_notify
  drm/i915/tracepoints: Add backend level request in and out tracepoints
  drm/i915/tracepoints: Add hw_id to context tracepoints

 drivers/gpu/drm/i915/Kconfig.debug         |  11 +++
 drivers/gpu/drm/i915/i915_gem_execbuffer.c |   4 +-
 drivers/gpu/drm/i915/i915_gem_request.c    |   2 +
 drivers/gpu/drm/i915/i915_guc_submission.c |   2 +
 drivers/gpu/drm/i915/i915_irq.c            |   2 +-
 drivers/gpu/drm/i915/i915_trace.h          | 122 ++++++++++++++++++++++++-----
 drivers/gpu/drm/i915/intel_lrc.c           |   4 +
 7 files changed, 124 insertions(+), 23 deletions(-)
    

Revisions

Patches download mbox

Tests

  LD      drivers/usb/storage/built-in.o
  CC [M]  drivers/gpu/drm/i915/gvt/render.o
  CC [M]  drivers/gpu/drm/i915/intel_lpe_audio.o
  LD      kernel/built-in.o
  LD      drivers/pci/pcie/aer/aerdriver.o
  LD      drivers/pci/pcie/aer/built-in.o
  LD      drivers/pci/pcie/built-in.o
  LD      net/packet/built-in.o
  LD      drivers/pci/built-in.o
  LD      drivers/scsi/scsi_mod.o
  LD      drivers/tty/serial/8250/8250.o
  LD      sound/built-in.o
  LD      drivers/gpu/drm/drm.o
  LD      drivers/iommu/built-in.o
  LD [M]  drivers/usb/serial/usbserial.o
  LD      drivers/acpi/acpica/acpi.o
  LD      drivers/thermal/thermal_sys.o
  LD      drivers/thermal/built-in.o
  LD      drivers/acpi/acpica/built-in.o
  LD [M]  drivers/net/ethernet/intel/igbvf/igbvf.o
  LD [M]  drivers/net/ethernet/intel/e1000/e1000.o
  LD      drivers/usb/gadget/libcomposite.o
  LD      drivers/acpi/built-in.o
  LD [M]  drivers/mmc/core/mmc_block.o
  LD      drivers/mmc/built-in.o
  LD      drivers/video/fbdev/core/fb.o
  LD      drivers/video/fbdev/core/built-in.o
  LD      drivers/spi/built-in.o
In file included from ./include/trace/define_trace.h:95:0,
                 from drivers/gpu/drm/i915/i915_trace.h:912,
                 from drivers/gpu/drm/i915/i915_trace_points.c:12:
./include/trace/trace_events.h:331:37: error: ‘trace_event_type_funcs_i915_gem_request_hw’ defined but not used [-Werror=unused-variable]
 static struct trace_event_functions trace_event_type_funcs_##call = { \
                                     ^
drivers/gpu/drm/i915/./i915_trace.h:585:1: note: in expansion of macro ‘DECLARE_EVENT_CLASS’
 DECLARE_EVENT_CLASS(i915_gem_request_hw,
 ^
In file included from ./include/trace/define_trace.h:95:0,
                 from drivers/gpu/drm/i915/i915_trace.h:912,
                 from drivers/gpu/drm/i915/i915_trace_points.c:12:
./include/trace/trace_events.h:726:13: error: ‘print_fmt_i915_gem_request_hw’ defined but not used [-Werror=unused-variable]
 static char print_fmt_##call[] = print;     \
             ^
drivers/gpu/drm/i915/./i915_trace.h:585:1: note: in expansion of macro ‘DECLARE_EVENT_CLASS’
 DECLARE_EVENT_CLASS(i915_gem_request_hw,
 ^
  LD      drivers/tty/serial/8250/8250_base.o
  LD      drivers/tty/serial/8250/built-in.o
  LD      drivers/usb/gadget/udc/udc-core.o
  LD      drivers/usb/gadget/udc/built-in.o
  LD      drivers/usb/gadget/built-in.o
  LD      drivers/tty/serial/built-in.o
  LD      drivers/scsi/sd_mod.o
  LD      drivers/video/fbdev/built-in.o
  LD      drivers/scsi/built-in.o
  AR      lib/lib.a
  EXPORTS lib/lib-ksyms.o
  LD      fs/btrfs/btrfs.o
  LD      lib/built-in.o
  LD      drivers/video/console/built-in.o
  LD      net/xfrm/built-in.o
  LD      drivers/video/built-in.o
  LD      drivers/usb/core/usbcore.o
  LD      fs/btrfs/built-in.o
  LD      drivers/usb/core/built-in.o
  CC      arch/x86/kernel/cpu/capflags.o
  LD      arch/x86/kernel/cpu/built-in.o
  LD      arch/x86/kernel/built-in.o
  LD      net/ipv4/built-in.o
  LD      drivers/tty/vt/built-in.o
  LD      drivers/tty/built-in.o
  LD      net/ipv6/ipv6.o
  LD      drivers/md/md-mod.o
  LD [M]  drivers/net/ethernet/intel/igb/igb.o
  LD      drivers/md/built-in.o
  LD      arch/x86/built-in.o
  LD      net/ipv6/built-in.o
cc1: all warnings being treated as errors
  LD      drivers/usb/host/xhci-hcd.o
scripts/Makefile.build:293: recipe for target 'drivers/gpu/drm/i915/i915_trace_points.o' failed
make[4]: *** [drivers/gpu/drm/i915/i915_trace_points.o] Error 1
make[4]: *** Waiting for unfinished jobs....
  LD      fs/ext4/ext4.o
  LD [M]  drivers/net/ethernet/intel/e1000e/e1000e.o
  LD      fs/ext4/built-in.o
  LD      fs/built-in.o
  LD      drivers/usb/host/built-in.o
  LD      drivers/usb/built-in.o
  LD      net/core/built-in.o
  LD      net/built-in.o
  LD      drivers/net/ethernet/built-in.o
  LD      drivers/net/built-in.o
scripts/Makefile.build:551: recipe for target 'drivers/gpu/drm/i915' failed
make[3]: *** [drivers/gpu/drm/i915] Error 2
scripts/Makefile.build:551: recipe for target 'drivers/gpu/drm' failed
make[2]: *** [drivers/gpu/drm] Error 2
scripts/Makefile.build:551: recipe for target 'drivers/gpu' failed
make[1]: *** [drivers/gpu] Error 2
Makefile:988: recipe for target 'drivers' failed
make: *** [drivers] Error 2

Patches download mbox

Tests

Series 18676v5 Tracepoints cleanup and improvements for requests
https://patchwork.freedesktop.org/api/1.0/series/18676/revisions/5/mbox/

Test kms_flip:
        Subgroup basic-flip-vs-wf_vblank:
                dmesg-warn -> PASS       (fi-snb-2520m)
Test kms_force_connector_basic:
        Subgroup force-connector-state:
                dmesg-warn -> PASS       (fi-snb-2520m)
Test kms_pipe_crc_basic:
        Subgroup nonblocking-crc-pipe-a:
                dmesg-warn -> PASS       (fi-snb-2520m)

fi-bdw-5557u     total:246  pass:232  dwarn:0   dfail:0   fail:0   skip:14 
fi-bsw-n3050     total:246  pass:207  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205     total:246  pass:224  dwarn:0   dfail:0   fail:0   skip:22 
fi-bxt-t5700     total:78   pass:65   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900     total:246  pass:219  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820     total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-hsw-4770r     total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-ivb-3520m     total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-ivb-3770      total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-kbl-7500u     total:246  pass:223  dwarn:0   dfail:0   fail:2   skip:21 
fi-skl-6260u     total:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-skl-6700hq    total:246  pass:226  dwarn:0   dfail:0   fail:0   skip:20 
fi-skl-6700k     total:246  pass:221  dwarn:4   dfail:0   fail:0   skip:21 
fi-skl-6770hq    total:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-snb-2520m     total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-snb-2600      total:246  pass:214  dwarn:0   dfail:0   fail:0   skip:32 

123d798c350471aba7e0625c154c6d9e395756c8 drm-tip: 2017y-01m-30d-21h-14m-37s UTC integration manifest
76609c5 drm/i915/tracepoints: Add hw_id to context tracepoints
e6bea66 drm/i915/tracepoints: Add backend level request in and out tracepoints
593c326 drm/i915/tracepoints: Rename i915_gem_request_notify
90db18b drm/i915/tracepoints: Add request submit and execute tracepoints
c8695c6 drm/i915/tracepoints: Remove unused i915_gem_request_complete
cec9de6 drm/i915/tracepoints: Tidy i915_gem_request_wait_begin
cbf06b5 drm/i915/tracepoints: Adjust i915_gem_ring_dispatch
b542e3c drm/i915/tracepoints: Tidy request event class