summaryrefslogtreecommitdiff
path: root/tools/aubdump.c
AgeCommit message (Collapse)Author
2016-07-08aubdump: Only close aub file if we opened itKristian Høgsberg Kristensen
2016-07-08aubdump: Support softpin bosKristian Høgsberg Kristensen
2016-02-13aubdump: Add a get_bo() lookup functionKristian Høgsberg Kristensen
We'll use this instead of accessing the bo array directly and add a few sanity checks.
2016-02-13aubdump: Don't use .so constructors for initializingKristian Høgsberg Kristensen
This doesn't seem to work when mixed with constructors in other shared objects or other creative uses of the linker. Let's stick with a simpler mechanism, where we look up the libc functions when our hooks are called for the first time.
2016-02-13aubdump: Raise SIGTRAP on failureKristian Høgsberg Kristensen
2015-11-06igt/intel_aubdump: Use the right ringBen Widawsky
This prevents the simulator from barfing when it sees commands from another ring. I've been using this locally for a very long time. Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2015-09-11tools/aubdump: remove void pointer arithmeticThomas Wood
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-08-12aubdump: Write header after figuring out the genKristian Høgsberg Kristensen
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-12aubdump: Handle 48 bit ppgtt dumpingKristian Høgsberg Kristensen
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-07tools/aubdump: Get PCI ID from getparam ioctl when we canKristian Høgsberg
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-07tools/aubdump: Don't rely on open for discovering the drm fdKristian Høgsberg
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-05tools: Use right #include path for i915_drm.hKristian Høgsberg Kristensen
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-04tools/aubdump: Add --device option for overriding device IDKristian Høgsberg Kristensen
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-04tools/aubdump.c: Also define struct drm_i915_gem_userptr for compatibilityKristian Høgsberg Kristensen
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-07-31tools/aubdump: #define DRM_IOCTL_I915_GEM_USERPTR if kernel headers don'tKristian Høgsberg Kristensen
Fix compile error on older kernels. Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-07-31tools: Add LD_PRELOAD-based AUB dumper toolKristian Høgsberg Kristensen
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>