Changes

Jump to: navigation, search

B2G/Debugging OpenGL

301 bytes added, 15:20, 6 November 2013
bug 849276, reflect the fact tha apitrace was integrated in the build system
===Get a copy of apitrace===
 
You'll need to follow this step if you want to build the '''qapitrace''' graphical tool for analyzing traces. If your distribution already provides such tool or if you're content with the command-line based '''apitrace''' tool you can skip the steps needed for building the host version.
The first thing to do is to grab a copy of apitrace.
git clone https://github.com/apitrace/apitrace.git
</pre>
 The INSTALL.markdown file contains instructions for building. I'll summarize what I did (I was running Linux Mint 13 at the time). ===Install the Android NDK===<pre>cd /home/workwget http://dl.google.com/android/ndk/android-ndk-r8-linux-x86.tar.bz2tar xf android-ndk-r8-linux-x86.tar.bz2</pre>
===Install cmake and needed Qt packages===
You will need cmake to build apitrace, additional packages may be required to inspect the traces later. This example should work on most Debian-based distributions
<pre>
sudo apt-get install cmake libqjson-dev libqtwebkit-dev
</pre>
===Build for the phoneRebuild B2G===<pre>export ANDROID_NDK=/home/work/android-ndk-r8cmake -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain/android.toolchain.cmake -DANDROID_API_LEVEL=9 -H. -Bbuild-b2gmake -C apitrace is now integrated in the B2G build-b2g</pre> The egltrace.system so for the ARM will be found in <tt>libs/armeabionly thing you need to do is to re-v7a/egltrace.so</tt> ===Install egltrace.so onto build your B2G checkout after having installed cmake and then push everything to the phone===
<pre>
adb push build-b2gcd /where/you/keep/wrappersB2G./egltracebuild.sh.so /dataflash.sh
</pre>
ADB=adb
B2G_DIR=/system/b2g
B2G_BIN=/system/b2g/b2g
B2G_PID=`$ADB shell toolbox ps b2g |
grep "b2g" | awk '{ print \$2; }'`
$ADB shell kill $B2G_PID
$ADB shell stop b2g
$ADB shell TRACE_FILE=/data/egl.trace \ GRE_HOME=\"${B2G_DIR}\" \ LD_PRELOAD=\"/system/b2g/libmozglue.so /datasystem/lib/apitrace/wrappers/egltrace.so\" \ LD_LIBRARY_PATH=\"/vendor/lib:/system/b2g lib:${B2G_DIR}\" \ ${B2G_BIN}
</pre>
Confirm
390
edits

Navigation menu