Confirmed users
417
edits
(PRELOAD mozglue to make sure we get the right allocator) |
(bug 849276, reflect the fact tha apitrace was integrated in the build system) |
||
Line 4: | Line 4: | ||
===Get a copy of apitrace=== | ===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. | The first thing to do is to grab a copy of apitrace. | ||
Line 9: | Line 11: | ||
git clone https://github.com/apitrace/apitrace.git | git clone https://github.com/apitrace/apitrace.git | ||
</pre> | </pre> | ||
The INSTALL.markdown file contains instructions for building. I'll summarize what I did (I was running Linux Mint 13 at the time). | |||
The INSTALL.markdown file contains instructions for building. I'll summarize what I did (I was running Linux Mint 13 at the time). | |||
===Install cmake and needed Qt packages=== | ===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> | <pre> | ||
sudo apt-get install cmake libqjson-dev libqtwebkit-dev | sudo apt-get install cmake libqjson-dev libqtwebkit-dev | ||
Line 30: | Line 25: | ||
</pre> | </pre> | ||
=== | ===Rebuild B2G=== | ||
apitrace is now integrated in the B2G build-system so the only thing you need to do is to re-build your B2G checkout after having installed cmake and then push everything to the phone | |||
<pre> | <pre> | ||
cd /where/you/keep/B2G | |||
./build.sh | |||
./flash.sh | |||
</pre> | </pre> | ||
Line 53: | Line 42: | ||
ADB=adb | ADB=adb | ||
B2G_DIR=/system/b2g | |||
B2G_BIN=/system/b2g/b2g | B2G_BIN=/system/b2g/b2g | ||
B2G_PID=`$ADB shell toolbox ps | | B2G_PID=`$ADB shell toolbox ps b2g | | ||
grep "b2g" | awk '{ print \$2; }'` | grep "b2g" | awk '{ print \$2; }'` | ||
$ADB shell kill $B2G_PID | $ADB shell kill $B2G_PID | ||
$ADB shell stop b2g | $ADB shell stop b2g | ||
$ADB shell TRACE_FILE=/data/egl.trace LD_PRELOAD=\"/system/b2g/libmozglue.so / | $ADB shell TRACE_FILE=/data/egl.trace \ | ||
GRE_HOME=\"${B2G_DIR}\" \ | |||
LD_PRELOAD=\"/system/b2g/libmozglue.so /system/lib/apitrace/wrappers/egltrace.so\" \ | |||
LD_LIBRARY_PATH=\"/vendor/lib:/system/lib:${B2G_DIR}\" \ | |||
${B2G_BIN} | |||
</pre> | </pre> | ||