Jakob Bornecrantz | d62b29f | 2010-08-15 00:59:57 +0100 | [diff] [blame] | 1 | Debugging |
| 2 | ========= |
| 3 | |
| 4 | Debugging utilities in gallium. |
| 5 | |
| 6 | Debug Variables |
| 7 | ^^^^^^^^^^^^^^^ |
| 8 | |
Corbin Simpson | 2d53dc8 | 2010-08-15 03:26:58 -0700 | [diff] [blame^] | 9 | All drivers respond to a set of common debug environment variables, as well as |
| 10 | some driver-specific variables. Set them as normal environment variables for |
| 11 | the platform or operating system you are running. For example, for Linux this |
| 12 | can be done by typing "export var=value" into a console and then running the |
Jakob Bornecrantz | d62b29f | 2010-08-15 00:59:57 +0100 | [diff] [blame] | 13 | program from that console. |
| 14 | |
| 15 | Common |
| 16 | """""" |
| 17 | |
Corbin Simpson | bf357ae | 2010-08-15 03:05:18 -0700 | [diff] [blame] | 18 | .. envvar:: GALLIUM_PRINT_OPTIONS <bool> (false) |
Jakob Bornecrantz | d62b29f | 2010-08-15 00:59:57 +0100 | [diff] [blame] | 19 | |
Corbin Simpson | 2d53dc8 | 2010-08-15 03:26:58 -0700 | [diff] [blame^] | 20 | This option controls if the debug variables should be printed to stderr. This |
| 21 | is probably the most useful variable, since it allows you to find which |
| 22 | variables a driver uses. |
Jakob Bornecrantz | d62b29f | 2010-08-15 00:59:57 +0100 | [diff] [blame] | 23 | |
Corbin Simpson | bf357ae | 2010-08-15 03:05:18 -0700 | [diff] [blame] | 24 | .. envvar:: GALLIUM_RBUG <bool> (false) |
Jakob Bornecrantz | d62b29f | 2010-08-15 00:59:57 +0100 | [diff] [blame] | 25 | |
| 26 | Controls if the :ref:`rbug` should be used. |
| 27 | |
Corbin Simpson | bf357ae | 2010-08-15 03:05:18 -0700 | [diff] [blame] | 28 | .. envvar:: GALLIUM_TRACE <string> ("") |
Jakob Bornecrantz | d62b29f | 2010-08-15 00:59:57 +0100 | [diff] [blame] | 29 | |
Corbin Simpson | 2d53dc8 | 2010-08-15 03:26:58 -0700 | [diff] [blame^] | 30 | If set, this variable will cause the :ref:`Trace` output to be written to the |
| 31 | specified file. Paths may be relative or absolute; relative paths are relative |
| 32 | to the working directory. For example, setting it to "trace.xml" will cause |
| 33 | the trace to be written to a file of the same name in the working directory. |
Jakob Bornecrantz | d62b29f | 2010-08-15 00:59:57 +0100 | [diff] [blame] | 34 | |
Corbin Simpson | bf357ae | 2010-08-15 03:05:18 -0700 | [diff] [blame] | 35 | .. envvar:: GALLIUM_DUMP_CPU <bool> (false) |
Jakob Bornecrantz | d62b29f | 2010-08-15 00:59:57 +0100 | [diff] [blame] | 36 | |
Corbin Simpson | 2d53dc8 | 2010-08-15 03:26:58 -0700 | [diff] [blame^] | 37 | Dump information about the current CPU that the driver is running on. |
Jakob Bornecrantz | d62b29f | 2010-08-15 00:59:57 +0100 | [diff] [blame] | 38 | |
Corbin Simpson | bf357ae | 2010-08-15 03:05:18 -0700 | [diff] [blame] | 39 | .. envvar:: TGSI_PRINT_SANITY <bool> (false) |
Jakob Bornecrantz | d62b29f | 2010-08-15 00:59:57 +0100 | [diff] [blame] | 40 | |
Corbin Simpson | 2d53dc8 | 2010-08-15 03:26:58 -0700 | [diff] [blame^] | 41 | Gallium has a built-in shader sanity checker. This option controls whether |
| 42 | the shader sanity checker prints its warnings and errors to stderr. |
Jakob Bornecrantz | d62b29f | 2010-08-15 00:59:57 +0100 | [diff] [blame] | 43 | |
Corbin Simpson | bf357ae | 2010-08-15 03:05:18 -0700 | [diff] [blame] | 44 | .. envvar:: DRAW_USE_LLVM <bool> (false) |
Jakob Bornecrantz | d62b29f | 2010-08-15 00:59:57 +0100 | [diff] [blame] | 45 | |
Corbin Simpson | 2d53dc8 | 2010-08-15 03:26:58 -0700 | [diff] [blame^] | 46 | Whether the :ref:`Draw` module will attempt to use LLVM for vertex and geometry shaders. |
| 47 | |
| 48 | |
| 49 | State tracker-specific |
| 50 | """""""""""""""""""""" |
Jakob Bornecrantz | d62b29f | 2010-08-15 00:59:57 +0100 | [diff] [blame] | 51 | |
Corbin Simpson | bf357ae | 2010-08-15 03:05:18 -0700 | [diff] [blame] | 52 | .. envvar:: ST_DEBUG <flags> (0x0) |
Jakob Bornecrantz | d62b29f | 2010-08-15 00:59:57 +0100 | [diff] [blame] | 53 | |
| 54 | Debug :ref:`flags` for the GL state tracker. |
| 55 | |
| 56 | |
Corbin Simpson | 2d53dc8 | 2010-08-15 03:26:58 -0700 | [diff] [blame^] | 57 | Driver-specific |
Jakob Bornecrantz | d62b29f | 2010-08-15 00:59:57 +0100 | [diff] [blame] | 58 | """"""""""""""" |
| 59 | |
Corbin Simpson | bf357ae | 2010-08-15 03:05:18 -0700 | [diff] [blame] | 60 | .. envvar:: I915_DEBUG <flags> (0x0) |
Jakob Bornecrantz | d62b29f | 2010-08-15 00:59:57 +0100 | [diff] [blame] | 61 | |
| 62 | Debug :ref:`flags` for the i915 driver. |
| 63 | |
Corbin Simpson | bf357ae | 2010-08-15 03:05:18 -0700 | [diff] [blame] | 64 | .. envvar:: I915_NO_HW <bool> (false) |
Jakob Bornecrantz | d62b29f | 2010-08-15 00:59:57 +0100 | [diff] [blame] | 65 | |
| 66 | Stop the i915 driver from submitting commands to the hardware. |
| 67 | |
Corbin Simpson | bf357ae | 2010-08-15 03:05:18 -0700 | [diff] [blame] | 68 | .. envvar:: I915_DUMP_CMD <bool> (false) |
Jakob Bornecrantz | d62b29f | 2010-08-15 00:59:57 +0100 | [diff] [blame] | 69 | |
| 70 | Dump all commands going to the hardware. |
| 71 | |
Corbin Simpson | bf357ae | 2010-08-15 03:05:18 -0700 | [diff] [blame] | 72 | .. envvar:: LP_DEBUG <flags> (0x0) |
Jakob Bornecrantz | d62b29f | 2010-08-15 00:59:57 +0100 | [diff] [blame] | 73 | |
| 74 | Debug :ref:`flags` for the llvmpipe driver. |
| 75 | |
Corbin Simpson | 2d53dc8 | 2010-08-15 03:26:58 -0700 | [diff] [blame^] | 76 | .. envvar:: LP_NUM_THREADS <int> (number of CPUs) |
Jakob Bornecrantz | d62b29f | 2010-08-15 00:59:57 +0100 | [diff] [blame] | 77 | |
| 78 | Number of threads that the llvmpipe driver should use. |
| 79 | |
| 80 | |
| 81 | .. _flags: |
| 82 | |
| 83 | Flags |
| 84 | """"" |
| 85 | |
Corbin Simpson | 2d53dc8 | 2010-08-15 03:26:58 -0700 | [diff] [blame^] | 86 | The variables of type "flags" all take a string with comma-separated flags to |
| 87 | enable different debugging for different parts of the drivers or state |
| 88 | tracker. If set to "help", the driver will print a list of flags which the |
| 89 | variable accepts. Order does not matter. |
Jakob Bornecrantz | d62b29f | 2010-08-15 00:59:57 +0100 | [diff] [blame] | 90 | |
| 91 | |
| 92 | .. _rbug: |
| 93 | |
| 94 | Remote Debugger |
| 95 | ^^^^^^^^^^^^^^^ |
| 96 | |
Corbin Simpson | 2d53dc8 | 2010-08-15 03:26:58 -0700 | [diff] [blame^] | 97 | The remote debugger, commonly known as rbug, allows for runtime inspections of |
| 98 | :ref:`Context`, :ref:`Screen`, :ref:`Resource` and :ref:`Shader` objects; and |
| 99 | pausing and stepping of :ref:`Draw` calls. Is used with rbug-gui which is |
| 100 | hosted outside of the main mesa repository. rbug is can be used over a network |
| 101 | connection, so the debugger does not need to be on the same machine. |