]> git.cworth.org Git - apitrace/blob - README
Mention tracy, reformat links.
[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 Additional 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 If you are building with GUI support (i.e, with QT and QJSON), it should detect
84 the official QT sdk automatically, but you will need to build QJSON yourself
85 and also set the QJSON_INCLUDE_DIR and QJSON_LIBRARIES variables in the
86 generated CMakeCache.txt when building apitrace and repeat the above sequence.
87  
88 It's also possible to build for Windows on Linux with MinGW cross compilers.
89 See http://www.cmake.org/Wiki/CmakeMingw for detailed instructions.
90
91
92 = Usage =
93
94
95 == Linux ==
96
97 Run the application you want to trace as
98
99  LD_PRELOAD=/path/to/glxtrace.so /path/to/application
100
101 and it will generate a trace named "application.trace" in the current
102 directory.  You can specify the written trace filename by setting the
103 TRACE_FILE envirnment variable before running.
104
105 View the trace with
106
107  /path/to/tracedump application.trace | less -R
108
109 Replay the trace with
110
111  /path/to/glretrace application.trace
112
113 Pass the -db option to use a double buffered visual.  Pass --help to glretrace
114 for more options.
115
116 Start the GUI as
117
118   /path/to/qapitrace application.trace
119
120
121 The LD_PRELOAD mechanism should work with most applications.  There are some
122 applications, e.g., Unigine Heaven, which global function pointers with the
123 same name as GL entrypoints, living in a shared object that wasn't linked with
124 -Bsymbolic flag, so relocations to those globals function pointers get
125 overwritten with the address to our wrapper library, and the application will
126 segfault when trying to write to them.  For these applications it is possible
127 to trace by using glxtrace.so as an ordinary libGL.so and injecting into
128 LD_LIBRARY_PATH:
129
130   ln -s glxtrace.so libGL.so
131   ln -s glxtrace.so libGL.so.1
132   ln -s glxtrace.so libGL.so.1.2
133   export LD_LIBRARY_PATH=/path/to/directory/where/glxtrace/is:$LD_LIBRARY_PATH
134   export TRACE_LIBGL=/path/to/real/libGL.so.1
135   /path/to/application
136
137
138 == Windows ==
139
140 * Copy opengl32.dll, d3d8.dll, or d3d9.dll from build/wrappers directory to the
141   directory with the application you want to trace.
142
143 * Run the application.
144
145 * View the trace with
146
147  /path/to/tracedump application.trace
148
149 * Replay the trace with
150
151  /path/to/glretrace application.trace
152
153
154 = Links =
155
156 * http://zrusin.blogspot.com/2011/04/apitrace.html
157 * http://jrfonseca.blogspot.com/2008/07/tracing-d3d-applications.html
158
159
160 == Direct3D ==
161
162 Open-source:
163  * [http://www.mikoweb.eu/index.php?node=21 Proxy DLL]
164    * [http://www.codeguru.com/cpp/g-m/directx/directx8/article.php/c11453/ Intercept Calls to DirectX with a Proxy DLL]
165  * [http://graphics.stanford.edu/~mdfisher/D3D9Interceptor.html Direct3D 9 API Interceptor]
166
167 Closed-source:
168  * [http://msdn.microsoft.com/en-us/library/ee417062.aspx Microsoft PIX]
169    * [http://doc.51windows.net/Directx9_SDK/?url=/directx9_sdk/graphics/programmingguide/TutorialsAndSamplesAndToolsAndTips/Tools/D3DSpy.htm D3DSpy]: the predecessor of PIX
170  * [http://developer.amd.com/gpu/PerfStudio/pages/APITraceWindow.aspx AMD GPU PerfStudio]
171
172
173 == OpenGL ==
174
175 Open-source:
176  * [http://www.opengl.org/sdk/tools/BuGLe/ BuGLe]
177  * [http://code.google.com/p/glintercept/ GLIntercept]
178  * [https://gitorious.org/tracy tracy]: OpenGL ES and OpenVG trace, retrace, and state inspection
179
180 Closed-source:
181  * [http://www.gremedy.com/products.php gDEBugger]
182  * [http://cumbia.informatik.uni-stuttgart.de/glsldevil/index.html glslDevil]
183  * [http://developer.amd.com/gpu/PerfStudio/pages/APITraceWindow.aspx AMD GPU PerfStudio]
184