1848b8605SmrgThese directory contains tools for manipulating traces produced by the trace 2848b8605Smrgpipe driver. 3848b8605Smrg 4848b8605Smrg 5848b8605SmrgMost debug builds of state trackers already load the trace driver by default. 6848b8605SmrgTo produce a trace do 7848b8605Smrg 8848b8605Smrg export GALLIUM_TRACE=foo.gtrace 9848b8605Smrg 10848b8605Smrgand run the application. You can choose any name, but the .gtrace is 11848b8605Smrgrecommended to avoid confusion with the .trace produced by apitrace. 12848b8605Smrg 13848b8605Smrg 14848b8605SmrgYou can dump a trace by doing 15848b8605Smrg 16848b8605Smrg ./dump.py foo.gtrace | less 17848b8605Smrg 18848b8605Smrg 19848b8605SmrgYou can dump a JSON file describing the static state at any given draw call 20848b8605Smrg(e.g., 12345) by 21848b8605Smrgdoing 22848b8605Smrg 23848b8605Smrg ./dump_state.py -v -c 12345 foo.gtrace > foo.json 24848b8605Smrg 25848b8605Smrgor by specifying the n-th (e.g, 1st) draw call by doing 26848b8605Smrg 27848b8605Smrg ./dump_state.py -v -d 1 foo.gtrace > foo.json 28848b8605Smrg 29848b8605SmrgThe state is derived from the call sequence in the trace file, so no dynamic 30848b8605Smrg(eg. rendered textures) is included. 31848b8605Smrg 32848b8605Smrg 33848b8605SmrgYou can compare two JSON files by doing 34848b8605Smrg 35848b8605Smrg ./diff_state.py foo.json boo.json | less 36848b8605Smrg 37848b8605SmrgIf you're investigating a regression in a state tracker, you can obtain a good 38848b8605Smrgand bad trace, dump respective state in JSON, and then compare the states to 39848b8605Smrgidentify the problem. 40