1af69d88dSmrgThese directory contains tools for manipulating traces produced by the trace
2af69d88dSmrgpipe driver.
3af69d88dSmrg
4af69d88dSmrg
57ec681f3SmrgMost debug builds of gallium frontends already load the trace driver by default.
6af69d88dSmrgTo produce a trace do
7af69d88dSmrg
8af69d88dSmrg  export GALLIUM_TRACE=foo.gtrace
9af69d88dSmrg
10af69d88dSmrgand run the application.  You can choose any name, but the .gtrace is
11af69d88dSmrgrecommended to avoid confusion with the .trace produced by apitrace.
12af69d88dSmrg
13af69d88dSmrg
14af69d88dSmrgYou can dump a trace by doing
15af69d88dSmrg
16af69d88dSmrg  ./dump.py foo.gtrace | less
17af69d88dSmrg
18af69d88dSmrg
19af69d88dSmrgYou can dump a JSON file describing the static state at any given draw call
20af69d88dSmrg(e.g., 12345) by
21af69d88dSmrgdoing
22af69d88dSmrg
23af69d88dSmrg  ./dump_state.py -v -c 12345 foo.gtrace > foo.json
24af69d88dSmrg
25af69d88dSmrgor by specifying the n-th (e.g, 1st) draw call by doing
26af69d88dSmrg
27af69d88dSmrg  ./dump_state.py -v -d 1 foo.gtrace > foo.json
28af69d88dSmrg
29af69d88dSmrgThe state is derived from the call sequence in the trace file, so no dynamic
30af69d88dSmrg(eg. rendered textures) is included.
31af69d88dSmrg
32af69d88dSmrg
33af69d88dSmrgYou can compare two JSON files by doing
34af69d88dSmrg
35af69d88dSmrg  ./diff_state.py foo.json boo.json | less
36af69d88dSmrg
377ec681f3SmrgIf you're investigating a regression in an gallium frontend, you can obtain a good
38af69d88dSmrgand bad trace, dump respective state in JSON, and then compare the states to
39af69d88dSmrgidentify the problem.
40