1848b8605SmrgDebugging
2848b8605Smrg=========
3848b8605Smrg
4848b8605SmrgDebugging utilities in gallium.
5848b8605Smrg
6848b8605SmrgDebug Variables
7848b8605Smrg^^^^^^^^^^^^^^^
8848b8605Smrg
9848b8605SmrgAll drivers respond to a set of common debug environment variables, as well as
10848b8605Smrgsome driver-specific variables. Set them as normal environment variables for
11848b8605Smrgthe platform or operating system you are running. For example, for Linux this
12848b8605Smrgcan be done by typing "export var=value" into a console and then running the
13848b8605Smrgprogram from that console.
14848b8605Smrg
15848b8605SmrgCommon
16848b8605Smrg""""""
17848b8605Smrg
18848b8605Smrg.. envvar:: GALLIUM_PRINT_OPTIONS <bool> (false)
19848b8605Smrg
20848b8605SmrgThis option controls if the debug variables should be printed to stderr. This
21848b8605Smrgis probably the most useful variable, since it allows you to find which
22848b8605Smrgvariables a driver uses.
23848b8605Smrg
24848b8605Smrg.. envvar:: GALLIUM_RBUG <bool> (false)
25848b8605Smrg
26848b8605SmrgControls if the :ref:`rbug` should be used.
27848b8605Smrg
28848b8605Smrg.. envvar:: GALLIUM_TRACE <string> ("")
29848b8605Smrg
30848b8605SmrgIf set, this variable will cause the :ref:`trace` output to be written to the
31848b8605Smrgspecified file. Paths may be relative or absolute; relative paths are relative
32848b8605Smrgto the working directory.  For example, setting it to "trace.xml" will cause
33848b8605Smrgthe trace to be written to a file of the same name in the working directory.
34848b8605Smrg
35848b8605Smrg.. envvar:: GALLIUM_DUMP_CPU <bool> (false)
36848b8605Smrg
37848b8605SmrgDump information about the current CPU that the driver is running on.
38848b8605Smrg
39848b8605Smrg.. envvar:: TGSI_PRINT_SANITY <bool> (false)
40848b8605Smrg
41848b8605SmrgGallium has a built-in shader sanity checker.  This option controls whether
42848b8605Smrgthe shader sanity checker prints its warnings and errors to stderr.
43848b8605Smrg
44848b8605Smrg.. envvar:: DRAW_USE_LLVM <bool> (false)
45848b8605Smrg
46848b8605SmrgWhether the :ref:`Draw` module will attempt to use LLVM for vertex and geometry shaders.
47848b8605Smrg
48848b8605Smrg
49848b8605SmrgState tracker-specific
50848b8605Smrg""""""""""""""""""""""
51848b8605Smrg
52848b8605Smrg.. envvar:: ST_DEBUG <flags> (0x0)
53848b8605Smrg
54848b8605SmrgDebug :ref:`flags` for the GL state tracker.
55848b8605Smrg
56848b8605Smrg
57848b8605SmrgDriver-specific
58848b8605Smrg"""""""""""""""
59848b8605Smrg
60848b8605Smrg.. envvar:: I915_DEBUG <flags> (0x0)
61848b8605Smrg
62848b8605SmrgDebug :ref:`flags` for the i915 driver.
63848b8605Smrg
64848b8605Smrg.. envvar:: I915_NO_HW <bool> (false)
65848b8605Smrg
66848b8605SmrgStop the i915 driver from submitting commands to the hardware.
67848b8605Smrg
68848b8605Smrg.. envvar:: I915_DUMP_CMD <bool> (false)
69848b8605Smrg
70848b8605SmrgDump all commands going to the hardware.
71848b8605Smrg
72848b8605Smrg.. envvar:: LP_DEBUG <flags> (0x0)
73848b8605Smrg
74848b8605SmrgDebug :ref:`flags` for the llvmpipe driver.
75848b8605Smrg
76848b8605Smrg.. envvar:: LP_NUM_THREADS <int> (number of CPUs)
77848b8605Smrg
78848b8605SmrgNumber of threads that the llvmpipe driver should use.
79848b8605Smrg
80848b8605Smrg.. envvar:: FD_MESA_DEBUG <flags> (0x0)
81848b8605Smrg
82848b8605SmrgDebug :ref:`flags` for the freedreno driver.
83848b8605Smrg
84848b8605Smrg
85848b8605Smrg.. _flags:
86848b8605Smrg
87848b8605SmrgFlags
88848b8605Smrg"""""
89848b8605Smrg
90848b8605SmrgThe variables of type "flags" all take a string with comma-separated flags to
91848b8605Smrgenable different debugging for different parts of the drivers or state
92848b8605Smrgtracker. If set to "help", the driver will print a list of flags which the
93848b8605Smrgvariable accepts. Order does not matter.
94848b8605Smrg
95848b8605Smrg
96848b8605Smrg.. _rbug:
97848b8605Smrg
98848b8605SmrgRemote Debugger
99848b8605Smrg^^^^^^^^^^^^^^^
100848b8605Smrg
101848b8605SmrgThe remote debugger, commonly known as rbug, allows for runtime inspections of
102848b8605Smrg:ref:`Context`, :ref:`Screen`, :ref:`Resource` and :ref:`Shader` objects; and
103848b8605Smrgpausing and stepping of :ref:`Draw` calls. Is used with rbug-gui which is
104848b8605Smrghosted outside of the main mesa repository. rbug is can be used over a network
105848b8605Smrgconnection, so the debugger does not need to be on the same machine.
106