blob: 42bda5aee93a1d1bf07bd40c2b993b39cc6f7db1 [file] [log] [blame]
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +01001Debugging
2=========
3
4Debugging utilities in gallium.
5
6Debug Variables
7^^^^^^^^^^^^^^^
8
Corbin Simpson2d53dc82010-08-15 03:26:58 -07009All drivers respond to a set of common debug environment variables, as well as
10some driver-specific variables. Set them as normal environment variables for
11the platform or operating system you are running. For example, for Linux this
12can be done by typing "export var=value" into a console and then running the
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010013program from that console.
14
15Common
16""""""
17
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070018.. envvar:: GALLIUM_PRINT_OPTIONS <bool> (false)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010019
Corbin Simpson2d53dc82010-08-15 03:26:58 -070020This option controls if the debug variables should be printed to stderr. This
21is probably the most useful variable, since it allows you to find which
22variables a driver uses.
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010023
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070024.. envvar:: GALLIUM_RBUG <bool> (false)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010025
26Controls if the :ref:`rbug` should be used.
27
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070028.. envvar:: GALLIUM_TRACE <string> ("")
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010029
Corbin Simpson2d53dc82010-08-15 03:26:58 -070030If set, this variable will cause the :ref:`Trace` output to be written to the
31specified file. Paths may be relative or absolute; relative paths are relative
32to the working directory. For example, setting it to "trace.xml" will cause
33the trace to be written to a file of the same name in the working directory.
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010034
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070035.. envvar:: GALLIUM_DUMP_CPU <bool> (false)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010036
Corbin Simpson2d53dc82010-08-15 03:26:58 -070037Dump information about the current CPU that the driver is running on.
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010038
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070039.. envvar:: TGSI_PRINT_SANITY <bool> (false)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010040
Corbin Simpson2d53dc82010-08-15 03:26:58 -070041Gallium has a built-in shader sanity checker. This option controls whether
42the shader sanity checker prints its warnings and errors to stderr.
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010043
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070044.. envvar:: DRAW_USE_LLVM <bool> (false)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010045
Corbin Simpson2d53dc82010-08-15 03:26:58 -070046Whether the :ref:`Draw` module will attempt to use LLVM for vertex and geometry shaders.
47
48
49State tracker-specific
50""""""""""""""""""""""
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010051
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070052.. envvar:: ST_DEBUG <flags> (0x0)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010053
54Debug :ref:`flags` for the GL state tracker.
55
56
Corbin Simpson2d53dc82010-08-15 03:26:58 -070057Driver-specific
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010058"""""""""""""""
59
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070060.. envvar:: I915_DEBUG <flags> (0x0)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010061
62Debug :ref:`flags` for the i915 driver.
63
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070064.. envvar:: I915_NO_HW <bool> (false)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010065
66Stop the i915 driver from submitting commands to the hardware.
67
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070068.. envvar:: I915_DUMP_CMD <bool> (false)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010069
70Dump all commands going to the hardware.
71
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070072.. envvar:: LP_DEBUG <flags> (0x0)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010073
74Debug :ref:`flags` for the llvmpipe driver.
75
Corbin Simpson2d53dc82010-08-15 03:26:58 -070076.. envvar:: LP_NUM_THREADS <int> (number of CPUs)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010077
78Number of threads that the llvmpipe driver should use.
79
80
81.. _flags:
82
83Flags
84"""""
85
Corbin Simpson2d53dc82010-08-15 03:26:58 -070086The variables of type "flags" all take a string with comma-separated flags to
87enable different debugging for different parts of the drivers or state
88tracker. If set to "help", the driver will print a list of flags which the
89variable accepts. Order does not matter.
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010090
91
92.. _rbug:
93
94Remote Debugger
95^^^^^^^^^^^^^^^
96
Corbin Simpson2d53dc82010-08-15 03:26:58 -070097The remote debugger, commonly known as rbug, allows for runtime inspections of
98:ref:`Context`, :ref:`Screen`, :ref:`Resource` and :ref:`Shader` objects; and
99pausing and stepping of :ref:`Draw` calls. Is used with rbug-gui which is
100hosted outside of the main mesa repository. rbug is can be used over a network
101connection, so the debugger does not need to be on the same machine.