10 Commits

Author SHA1 Message Date
Thomas Wood
fdecc1b5af tools/aubdump: remove void pointer arithmetic
A gcc extension allows void pointer arithmetic by treating the size of
void as 1, but this generates a warning when -Wpointer-arith is used.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11 14:39:43 +01:00
Kristian Høgsberg Kristensen
33bc41aa41 aubdump: Write header after figuring out the gen
We have to defer figuring out the gen until we have a PCI ID, which we
don't have for sure until the first execbuffer2 ioctl. We can't write
the file header until we have the gen since we need to know the size of
offsets in the file format.  Move the call to write_header() into the
dump_execbuffer2() where we have the gen.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-08-12 08:58:00 -07:00
Kristian Høgsberg Kristensen
3156305ace aubdump: Handle 48 bit ppgtt dumping
Put 48 bit block offsets in the AUB file and track the bo offsets with
uint64_t.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-08-12 08:58:00 -07:00
Kristian Høgsberg
9c15167c61 tools/aubdump: Get PCI ID from getparam ioctl when we can
Instead of doing an extra getparam ioctl to discover the PCI ID, we
can snoop it when the application queries it.

Signed-off-by: Kristian Høgsberg <krh@cryptic-dragon.jf.intel.com>
2015-08-07 15:00:32 -07:00
Kristian Høgsberg
5f4fad3182 tools/aubdump: Don't rely on open for discovering the drm fd
DRI3 passes the drm fd over X protocol and as such we can't rely on
hooking open to discover the drm fd. Instead we look for drm ioctl
codes in the ioctl wrapper. If we don't have a drm fd and see
something that looks like a drm ioctl, we stat the fd to see if it's a
drm fd.  If it is, we save it for later so we don't have to do an
extra stat on every ioctl.  We can then drop the open wrapper, but we
keep the close wrapper so we can invalidate our cached drm_fd if it's
closed.

Signed-off-by: Kristian Høgsberg <krh@cryptic-dragon.jf.intel.com>
2015-08-07 14:59:56 -07:00
Kristian Høgsberg Kristensen
78e2a2f245 tools: Use right #include path for i915_drm.h
pkg-config adds /usr/include/libdrm to the include path so we only need i915_drm.h

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-08-05 11:53:17 -07:00
Kristian Høgsberg Kristensen
220c7d1f91 tools/aubdump: Add --device option for overriding device ID
This lets us capture AUB traces for platforms different from the one
we're running on.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-08-04 15:00:50 -07:00
Kristian Høgsberg Kristensen
f47bdba8b0 tools/aubdump.c: Also define struct drm_i915_gem_userptr for compatibility
Oops, we obviously also need to define the argument struct for userptr.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-08-04 09:36:53 -07:00
Kristian Høgsberg Kristensen
e4fa17df02 tools/aubdump: #define DRM_IOCTL_I915_GEM_USERPTR if kernel headers don't
Fix compile error on older kernels.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-07-31 14:26:15 -07:00
Kristian Høgsberg Kristensen
e6a5d799fc tools: Add LD_PRELOAD-based AUB dumper tool
This does everything the aub dump functionality in libdrm does, but
without being part of libdrm.  This moves the very developer oriented
functionality out of core libdrm and adds some flexibility in how we
activate it (we can specify filename, for example).  Most importantly,
this lets us dump aub files for tools and/or drivers that don't use
libdrm, without having to add that code to each of those projects.

The tool is used much like strace or valgrind.  For example:

  $ intel_aubdump -v --output=stuff.aub -- glxgears -geometry 500x500

will launch glxgears with its options and enable aub dumping and pass
the -v and --output=stuff.aub options to the aub dumper.

Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-07-31 10:40:04 -07:00