]> git.cworth.org Git - apitrace/blob - README
Describe glretrace -db and --help options; and how to start the GUI.
[apitrace] / README
1                               API Trace & Retrace
2
3
4 = Copyright =
5
6 Copyright 2011 Jose Fonseca, Zack Rusin
7 Copyright 2008-2010 VMware, Inc.
8 All Rights Reserved.
9
10 Permission is hereby granted, free of charge, to any person obtaining a copy
11 of this software and associated documentation files (the "Software"), to deal
12 in the Software without restriction, including without limitation the rights
13 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 copies of the Software, and to permit persons to whom the Software is
15 furnished to do so, subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26 THE SOFTWARE.
27
28
29 = About =
30
31 This includes a set of tools for:
32 - trace OpenGL, D3D8, and D3D9 APIs calls to a file;
33 - retrace OpenGL calls from a file;
34 - visualize trace files, and inspect state.
35
36
37 = Status =
38
39 * It has not been tested with many applications. Bugs in less used features may
40   cause application crashes.
41 * Direct3D 8 support is currently broken.
42 * No Direct3D retrace support
43
44
45 = Building from source =
46
47 Requirements common for all platforms:
48 * Python (requires version 2.6)
49 * CMake (tested with version 2.8)
50
51 Requirements to build the GUI (optional):
52 * Qt (tested with version 4.7)
53 * QJSON (tested with version 0.7.1)
54
55
56 == Linux ==
57
58 Build as:
59
60  cmake -H. -Bbuild
61  make -C build
62
63 You can also build the 32bit GL wrapper on 64bit distro with a multilib gcc by
64 doing:
65
66  cmake -H. -Bbuild32 -DCMAKE_C_FLAGS=-m32 -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_LINK_FLAGS=-m32
67  make -C build32 glxtrace
68
69
70 == Windows ==
71
72 Requirements:
73
74 * Microsoft Visual Studio (tested with 2008 version) or MinGW (tested with gcc version 4.4)
75
76 * Microsoft DirectX SDK (tested with August 2007 release)
77
78 To build with Visual Studio invoke CMake as:
79
80  cmake -G "Visual Studio 9 2008" -H. -Bbuild
81  cmake --build build --config MinSizeRel
82  
83 It's also possible to build on Linux with MinGW cross compilers.  See
84 http://www.cmake.org/Wiki/CmakeMingw for detailed instructions.
85
86
87 = Usage =
88
89
90 == Linux ==
91
92 Run the application you want to trace as
93
94  LD_PRELOAD=/path/to/glxtrace.so /path/to/application
95
96 and it will generate a trace named "application.trace" in the current
97 directory.  You can specify the written trace filename by setting the
98 TRACE_FILE envirnment variable before running.
99
100 View the trace with
101
102  /path/to/tracedump application.trace | less -R
103
104 Replay the trace with
105
106  /path/to/glretrace application.trace
107
108 Pass the -db option to use a double buffered visual.  Pass --help to glretrace
109 for more options.
110
111 Start the GUI as
112
113   /path/to/qapitrace application.trace
114
115
116 The LD_PRELOAD mechanism should work with most applications.  There are some
117 applications, e.g., Unigine Heaven, which global function pointers with the
118 same name as GL entrypoints, living in a shared object that wasn't linked with
119 -Bsymbolic flag, so relocations to those globals function pointers get
120 overwritten with the address to our wrapper library, and the application will
121 segfault when trying to write to them.  For these applications it is possible
122 to trace by using glxtrace.so as an ordinary libGL.so and injecting into
123 LD_LIBRARY_PATH:
124
125   ln -s glxtrace.so libGL.so
126   ln -s glxtrace.so libGL.so.1
127   ln -s glxtrace.so libGL.so.1.2
128   export LD_LIBRARY_PATH=/path/to/directory/where/glxtrace/is:$LD_LIBRARY_PATH
129   export TRACE_LIBGL=/path/to/real/libGL.so.1
130   /path/to/application
131
132
133 == Windows ==
134
135 * Copy opengl32.dll, d3d8.dll, or d3d9.dll from build/wrappers directory to the
136   directory with the application you want to trace.
137
138 * Run the application.
139
140 * View the trace with
141
142  /path/to/tracedump application.trace
143
144 * Replay the trace with
145
146  /path/to/glretrace application.trace
147
148
149 = Links =
150
151 * http://jrfonseca.blogspot.com/2008/07/tracing-d3d-applications.html
152
153
154 == Direct3D ==
155
156  * [http://www.mikoweb.eu/index.php?node=21 Proxy DLL]
157    * [http://www.codeguru.com/cpp/g-m/directx/directx8/article.php/c11453/ Intercept Calls to DirectX with a Proxy DLL]
158  * [http://doc.51windows.net/Directx9_SDK/?url=/directx9_sdk/graphics/programmingguide/TutorialsAndSamplesAndToolsAndTips/Tools/D3DSpy.htm D3DSpy]
159  * [http://msdn.microsoft.com/en-us/library/ee417062.aspx PIX]
160
161
162 == OpenGL ==
163
164  * [http://www.opengl.org/sdk/tools/BuGLe/ BuGLe]
165  * [http://glintercept.nutty.org/ GLIntercept]
166  * [http://www.gremedy.com/products.php gDEBugger]