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