mesa/src/intel/tools
Paulo Zanoni a268f79ce1 intel/tools: fix stall_csv_filename maybe-unitialized error
On Release builds, I get this:

../../src/intel/tools/intel_eu_stall_viewer.cpp: In function ‘int main(int, char**)’:
../../src/intel/tools/intel_eu_stall_viewer.cpp:269:27: warning: ‘stall_csv_filename’ may be used uninitialized [-Wmaybe-uninitialized]
  269 |    if (!shaders_directory || !stall_csv_filename) {
      |        ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
../../src/intel/tools/intel_eu_stall_viewer.cpp:244:43: note: ‘stall_csv_filename’ was declared here
  244 |    const char *shaders_directory = NULL, *stall_csv_filename;

We can't expect gcc to understand that it's a required argument.

This "fixes" b795a1a20c ("intel/tools: add eu stall viewer").

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41946>
2026-06-02 22:01:01 +00:00
..
imgui
aub_mem.c
aub_mem.h
aub_read.c
aub_read.h
aub_write.c
aub_write.h
aubinator.c
aubinator_error_decode.c
aubinator_error_decode_lib.c
aubinator_error_decode_lib.h
aubinator_error_decode_xe.c intel/decoder: Convert to use gen module 2026-05-30 00:54:00 +00:00
aubinator_error_decode_xe.h
aubinator_viewer.cpp
aubinator_viewer.h intel/tools: Use gen_print instead of brw_disasm 2026-05-30 00:54:00 +00:00
aubinator_viewer_decoder.cpp
aubinator_viewer_urb.h
error2aub.c
error2hangdump.c
error2hangdump_lib.c
error2hangdump_lib.h
error2hangdump_xe.c
error2hangdump_xe.h
error2hangdump_xe_lib.c
error2hangdump_xe_lib.h
error_decode_lib.c
error_decode_lib.h
error_decode_xe_lib.c
error_decode_xe_lib.h
gfx8_context.h
gfx10_context.h
intel_aub.h
intel_context.h
intel_dev_info.c
intel_dump_gpu.c
intel_dump_gpu.in
intel_eu_stall_viewer.cpp intel/tools: fix stall_csv_filename maybe-unitialized error 2026-06-02 22:01:01 +00:00
intel_hang_replay.c intel_hang_replay: Don't force scratch page on Xe KMD unless explicitly requested 2026-05-01 19:51:41 +00:00
intel_hang_replay_lib.c
intel_hang_replay_lib.h
intel_hang_replay_xe.c intel_hang_replay: Don't force scratch page on Xe KMD unless explicitly requested 2026-05-01 19:51:41 +00:00
intel_hang_replay_xe.h intel_hang_replay: Don't force scratch page on Xe KMD unless explicitly requested 2026-05-01 19:51:41 +00:00
intel_hang_viewer.cpp
intel_measure.py
intel_monitor.c
intel_monitor_eustall.c
intel_monitor_eustall.h
intel_noop_drm_shim.c
intel_sanitize_gpu.c
intel_sanitize_gpu.in
intel_stub_gpu.in
intel_tools.c intel/tools: Use gen_print instead of brw_disasm 2026-05-30 00:54:00 +00:00
intel_tools.h
meson.build intel/decoder: Convert to use gen module 2026-05-30 00:54:00 +00:00
README.md

aubinator_error_decode

This tool allows decode an error state dump generated by the kernel driver.

Make a copy of the error state file (i915) :

$ sudo cp /sys/devices/pci0000:00/0000:00:02.0/drm/card0/error /tmp/error
$ sudo chmod go+rw /tmp/error

Make a copy of the error state file (Xe) :

$ sudo cp /sys/class/drm/card0/device/devcoredump/data /tmp/error
$ sudo chmod go+rw /tmp/error

Then visualize the error state (from the mesa build directory) :

$ ./src/intel/tools/aubinator_error_decode /tmp/error

intel_stub_gpu

This tool allows faking a particular device at the ioctl level. This is useful to test compiler changes (using shader-db/fossils-db replays) across a number of device you don't necessarily have access too.

Faking a DG2 device :

$ intel_stub_gpu -p dg2 fossilize-replay /path/to/fossilize.foz --enable-pipeline-stats /tmp/dg2.csv

Faking a ICL device :

$ intel_stub_gpu -p icl fossilize-replay /path/to/fossilize.foz --enable-pipeline-stats /tmp/icl.csv

intel_error2hangdump

This tool converts an error state dump into an uncompressed/easy-to-modify binary file (format described in src/intel/common/intel_hang_dump.h).

Capture the error state (i915) :

$ sudo cp /sys/devices/pci0000:00/0000:00:02.0/drm/card0/error /tmp/error
$ sudo chmod go+rw /tmp/error

Capture the error state (Xe) :

$ sudo cp /sys/class/drm/card0/device/devcoredump/data /tmp/error
$ sudo chmod go+rw /tmp/error

Convert an error state (from the mesa build directory) :

$ ./src/intel/tools/intel_error2hang /tmp/error

A resulting error.dmp file will be created

intel_hang_replay

This tool replays a binary file generated by intel_error2hangdump.

From the mesa build directory :

$ ./src/intel/tools/intel_hang_replay -d /tmp/error.dmp

intel_hang_viewer

This tool is a editor/visualizer for the file generated by intel_error2hangdump. When replaying on simulation a few tweaks might be needed in order for the simulator to accept the input commands (this is due to divergences between the simulation & HW implementations).

To visualize a file generated from a DG2 error state (from the mesa build directory) :

./src/intel/tools/intel_hang_viewer -p dg2 /tmp/error.dmp

To visualize and edit a file generated from a DG2 error state (from the mesa build directory) :

./src/intel/tools/intel_hang_viewer -e -p dg2 /tmp/error.dmp