17ec681f3SmrgDebugging 27ec681f3Smrg========= 37ec681f3Smrg 47ec681f3SmrgDebugging utilities in gallium. 57ec681f3Smrg 67ec681f3SmrgDebug Variables 77ec681f3Smrg^^^^^^^^^^^^^^^ 87ec681f3Smrg 97ec681f3SmrgAll drivers respond to a set of common debug environment variables, as well as 107ec681f3Smrgsome driver-specific variables. Set them as normal environment variables for 117ec681f3Smrgthe platform or operating system you are running. For example, for Linux this 127ec681f3Smrgcan be done by typing "export var=value" into a console and then running the 137ec681f3Smrgprogram from that console. 147ec681f3Smrg 157ec681f3SmrgCommon 167ec681f3Smrg"""""" 177ec681f3Smrg 187ec681f3Smrg.. envvar:: GALLIUM_PRINT_OPTIONS <bool> (false) 197ec681f3Smrg 207ec681f3SmrgThis option controls if the debug variables should be printed to stderr. This 217ec681f3Smrgis probably the most useful variable, since it allows you to find which 227ec681f3Smrgvariables a driver uses. 237ec681f3Smrg 247ec681f3Smrg.. envvar:: GALLIUM_RBUG <bool> (false) 257ec681f3Smrg 267ec681f3SmrgControls if the :ref:`rbug` should be used. 277ec681f3Smrg 287ec681f3Smrg.. envvar:: GALLIUM_TRACE <string> ("") 297ec681f3Smrg 307ec681f3SmrgIf set, this variable will cause the :ref:`trace` output to be written to the 317ec681f3Smrgspecified file. Paths may be relative or absolute; relative paths are relative 327ec681f3Smrgto the working directory. For example, setting it to "trace.xml" will cause 337ec681f3Smrgthe trace to be written to a file of the same name in the working directory. 347ec681f3Smrg 357ec681f3Smrg.. envvar:: GALLIUM_TRACE_TC <bool> (false) 367ec681f3Smrg 377ec681f3SmrgIf enabled while :ref:`trace` is active, this variable specifies that the threaded context 387ec681f3Smrgshould be traced for drivers which implement it. By default, the driver thread is traced, 397ec681f3Smrgwhich will include any reordering of the command stream from threaded context. 407ec681f3Smrg 417ec681f3Smrg.. envvar:: GALLIUM_TRACE_TRIGGER <string> ("") 427ec681f3Smrg 437ec681f3SmrgIf set while :ref:`trace` is active, this variable specifies a filename to monitor. 447ec681f3SmrgOnce the file exists (e.g., from the user running 'touch /path/to/file'), a single 457ec681f3Smrgframe will be recorded into the trace output. 467ec681f3SmrgPaths may be relative or absolute; relative paths are relative to the working directory. 477ec681f3Smrg 487ec681f3Smrg.. envvar:: GALLIUM_DUMP_CPU <bool> (false) 497ec681f3Smrg 507ec681f3SmrgDump information about the current CPU that the driver is running on. 517ec681f3Smrg 527ec681f3Smrg.. envvar:: TGSI_PRINT_SANITY <bool> (false) 537ec681f3Smrg 547ec681f3SmrgGallium has a built-in shader sanity checker. This option controls whether 557ec681f3Smrgthe shader sanity checker prints its warnings and errors to stderr. 567ec681f3Smrg 577ec681f3Smrg.. envvar:: DRAW_USE_LLVM <bool> (false) 587ec681f3Smrg 597ec681f3SmrgWhether the :ref:`Draw` module will attempt to use LLVM for vertex and geometry shaders. 607ec681f3Smrg 617ec681f3Smrg 627ec681f3SmrgGL State tracker-specific 637ec681f3Smrg""""""""""""""""""""""""" 647ec681f3Smrg 657ec681f3Smrg.. envvar:: ST_DEBUG <flags> (0x0) 667ec681f3Smrg 677ec681f3SmrgDebug :ref:`flags` for the GL state tracker. 687ec681f3Smrg 697ec681f3Smrg 707ec681f3SmrgDriver-specific 717ec681f3Smrg""""""""""""""" 727ec681f3Smrg 737ec681f3Smrg.. envvar:: I915_DEBUG <flags> (0x0) 747ec681f3Smrg 757ec681f3SmrgDebug :ref:`flags` for the i915 driver. 767ec681f3Smrg 777ec681f3Smrg.. envvar:: I915_NO_HW <bool> (false) 787ec681f3Smrg 797ec681f3SmrgStop the i915 driver from submitting commands to the hardware. 807ec681f3Smrg 817ec681f3Smrg.. envvar:: I915_DUMP_CMD <bool> (false) 827ec681f3Smrg 837ec681f3SmrgDump all commands going to the hardware. 847ec681f3Smrg 857ec681f3Smrg.. envvar:: LP_DEBUG <flags> (0x0) 867ec681f3Smrg 877ec681f3SmrgDebug :ref:`flags` for the llvmpipe driver. 887ec681f3Smrg 897ec681f3Smrg.. envvar:: LP_NUM_THREADS <int> (number of CPUs) 907ec681f3Smrg 917ec681f3SmrgNumber of threads that the llvmpipe driver should use. 927ec681f3Smrg 937ec681f3Smrg.. envvar:: FD_MESA_DEBUG <flags> (0x0) 947ec681f3Smrg 957ec681f3SmrgDebug :ref:`flags` for the freedreno driver. 967ec681f3Smrg 977ec681f3Smrg 987ec681f3Smrg.. _flags: 997ec681f3Smrg 1007ec681f3SmrgFlags 1017ec681f3Smrg""""" 1027ec681f3Smrg 1037ec681f3SmrgThe variables of type "flags" all take a string with comma-separated flags to 1047ec681f3Smrgenable different debugging for different parts of the drivers or state 1057ec681f3Smrgtracker. If set to "help", the driver will print a list of flags which the 1067ec681f3Smrgvariable accepts. Order does not matter. 1077ec681f3Smrg 1087ec681f3Smrg 1097ec681f3Smrg.. _rbug: 1107ec681f3Smrg 1117ec681f3SmrgRemote Debugger 1127ec681f3Smrg^^^^^^^^^^^^^^^ 1137ec681f3Smrg 1147ec681f3SmrgThe remote debugger, commonly known as rbug, allows for runtime inspections of 1157ec681f3Smrg:ref:`Context`, :ref:`Screen`, :ref:`Resource` and :ref:`Shader` objects; and 1167ec681f3Smrgpausing and stepping of :ref:`Draw` calls. Is used with rbug-gui which is 1177ec681f3Smrghosted outside of the main mesa repository. rbug is can be used over a network 1187ec681f3Smrgconnection, so the debugger does not need to be on the same machine. 119