summaryrefslogtreecommitdiff
path: root/tools/aubdump.c
AgeCommit message (Collapse)Author
2018-09-11Fix 32bit gcc warningsVille Syrjälä
../tests/eviction_common.c:158:13: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=] etc. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-04-11tools/aubdump: Fix ISO C90 forbids mixed declarations and code warningTvrtko Ursulin
Back to a clean build with no warnings, at least for me. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Scott D Phillips <scott.d.phillips@intel.com> Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
2018-03-19tools/aubdump: For gen10+ support addresses up to 4GBJordan Justen
For gen10, we now add mappings for buffers as they are needed. Instead of doing this dynamically, we could always map the entire 4GB. With 4KB pages, the tables would take up 8MB in every AUB. AUBs are often quite huge compared to 8MB, but they can also be just a few hundred KB. This should allow the AUB to create up to about 4GB of allocated buffers, whereas before we were limited to about 64MB. While it is unlikely that we'll try to capture AUBs that generate buffers up to 4GB in size, this change also should allow pinned buffers to be used anywhere in the first 4GB. (I tested a pinned buffer at 0xf0000000.) Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
2018-03-19tools/aubdump: Add bitmap to track gtt pages that have been mappedJordan Justen
This will allow us to map ranges as they are used, but prevents remapping already mapped regions. By mapping ranges as they are used, we can support pinned pages without having to map all pages of the first 32-bits. v2: * Make bitmap manipulation functions independent from 4k page size. Maybe will be usable also for 1GB pages with PPGTT. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
2018-03-19tools/aubdump: Add gen8_map_ggtt_rangeJordan Justen
This function should allow us to only write the page table entries that get used. v2: * Use align; deobfuscate start addr calc. (Scott) Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
2018-02-22tools/aubdump: Signal drm sync objects when device override is usedJordan Justen
This prevents an infinite hang with crucible (vulkan) rendering tests when --device is used. Cc: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2018-02-22tools/aubdump: Note pinned BO in verbose outputJordan Justen
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
2018-02-22tools/aubdump: Support alignment of BO in execbuffer2Jordan Justen
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
2018-02-07tools/intel_aubdump: Simulate "enhanced execlist" submission for gen11+Scott D Phillips
gen11 execlist submission is done through the submit queue registers (ELSQ). See kernel patch "drm/i915/icl: Enhanced execution list support" Signed-off-by: Scott D Phillips <scott.d.phillips@intel.com> Tested-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2017-12-07tools/intel_aubdump: Add ability to simulate execlist submissionScott D Phillips
Newer devices do not have the legacy ring buffer submission model, so aub files generated using that model cannot be handled by some internal tools. The execlist submission modeled by this change is pretty simplistic, using GGTT only and synchronizing after every batch. v2: - Move addr_bits init in separate patch (Jordan) - Don't change GTT entries in gen < 10 Signed-off-by: Scott D Phillips <scott.d.phillips@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2017-12-07tools/intel_aubdump: Set addr_bits before write_headerScott D Phillips
write_header() uses addr_bits, so do the initialization earlier. Also set the gen to a non-zero value in case of unknown device, for use by a later patch. Signed-off-by: Scott D Phillips <scott.d.phillips@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2017-11-06tools/aubdump: Avoid ISO C90 warningThierry Reding
GCC will warn about ISO C90 forbidding to mix declarations and code. Declare the variable at the beginning of the function to suppress the warning. Signed-off-by: Thierry Reding <treding@nvidia.com>
2017-10-10intel_aubdump: Default to 48-bit AUBs when the gen is unknownJordan Justen
v2: * Use 48-bit rather than 64-bit (Ken) * Use 'addr_bits' rather than 'use_64bit' Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-10-04Fix compilation on some distrosAusmus, James
Some distros (such as Gentoo) are removing the include of sys/sysmacros.h from sys/types.h. Explicitly include sysmacros.h in files where we use the minor() and major() functions. Signed-off-by: James Ausmus <james.ausmus@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-09-21intel_aubdump: Support I915_EXEC_BATCH_FIRST.Kenneth Graunke
The batch is now on the other end of the list. Fixes issues where modern Mesa and modern kernels together start putting the batch at the front of the list, and intel_aubdump looks for it at the end of the list, causing it to interpret some other buffer as the batch. Then AubLoad or aubinator see bogus data like 1.0 float as a GPU command and get grumpy.
2017-09-08build: remove _GNU_SOURCE from source filesDaniel Vetter
We are, the build system takes care of that. Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-08-24aubdump: Log some information about the execbuf callsJason Ekstrand
Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com>
2017-08-24aubdump: Use write_reloc for filling out the ringbufferJason Ekstrand
Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-08-24aubdump: Reject execbuffer2 calls with bad BOsJason Ekstrand
This is required for the supports_48b_addresses check in the Vulkan driver to work without messing up the resulting aub. Reviewed-by: Scott D Phillips <scott.d.phillips@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-07-11igt: Add LOCAL defines for distro compatibilityArkadiusz Hiler
Each Linux distro takes a different spin on providing kernel's uapi headers (especialy the *drm*.h). You can get them with linux-headers, you can get them with libdrm. Sometime you can even get them twice, from both sources. Sometimes the headers match your kernel version, sometimes you end up stuck with headers matching the kernel that the given release of the distro came out with. This makes things harder for code that does not depend on libdrm, as we cannot have sane ./configure-time checks. So let's define LOCAL_ version for FENCE and EXECBUFFER2_WB defines until all the stable distros catch up (+/- some epsilon). Cc: Petri Latvala <petri.latvala@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
2017-04-14aubdump: Don't bail if a GEM handle of 0 is passed into execbufJason Ekstrand
A gem handle of 0 can be used to check for whether or not 48-bit addressing is available. This keeps aubdump from failing on you if you try to do the check. Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
2017-03-09aubdump: Support EXECBUFFER2_WRJason Ekstrand
2016-11-28aubdump: Add a PCI-ID= entry to the AUB file commentJason Ekstrand
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-11-28aubdump: Set the application nameJason Ekstrand
This will help with identifying aub files Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-11-28Revert "aubdump: Bump the GTT size to 256MB"Jason Ekstrand
This reverts commit c6191a41f6c858cbdd4280e9ffcc91170e87ebeb. It turns out that having a GTT that large causes the simulator massive headaches. Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-11-22aubdump: Bump the GTT size to 256MBJason Ekstrand
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2016-11-22aubdump: Fix GTT setup for Gen8+Francisco Jerez
Gen8+ have 64 bit GTT entries, so we need to allocate twice as much space for the GTT table in order to cover the same number of GTT pages. Fixes sporadic page-fault crashes on the simulator. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-11-22aubdump: Handle 48-bit relocations properlyJason Ekstrand
aubdump was only writing 32-bits regardless of platform. This is fine if the client being dumped leaves the top 32 bits zero since the aubdump GTT is fairly small. However, if the client does store something in the upper 32 bits, this results in an invalid relocation. Cc: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2016-11-09aubdump: add --command option to stream aubdump to another programLionel Landwerlin
This comes handy if you want to look at your application output without having to save it into a file. For example, use this with aubinator from Mesa : $ intel_aubdump -c '/path/to/aubinator --gen=hsw' my_gl_app v2: Fix handling empty command line option v3: Fix command line concatenation (again...) v4: Use execvp (Petri) Indentation (Petri) Allow recording to a file and stream to an external application (Lionel) Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Sirisha Gandikota <Sirisha.Gandikota@intel.com>
2016-11-09tools: intel_aubdump: pass configuration through file descriptorLionel Landwerlin
This makes parsing options less complicated and easier to extend. v2: Fix device id parsing (atoi -> sscanf) (Sirisha) Combine with previous commit moving init function (Sirisha) v3: Fix behavior change between bash 4.3 & 4.4 in <<< with \n characters (Lionel) Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Sirisha Gandikota <Sirisha.Gandikota@intel.com>
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>