Mobile/Fennec/Android: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 614: Line 614:
Apitrace is a tool for tracing GL/EGL calls for debugging purposes. It basically uses an interim shared library called libapitrace that contains shadow gl* and egl* functions, which then get logged and then passed through to the real driver.
Apitrace is a tool for tracing GL/EGL calls for debugging purposes. It basically uses an interim shared library called libapitrace that contains shadow gl* and egl* functions, which then get logged and then passed through to the real driver.


In order to use apitrace you will need to grab the apitrace branch of mozilla-central maintained by gw280 at https://github.com/gw280/mozilla-central/commits/apitrace. This is current based off of the maple branch.


Ensure you are using android-9 instead of android-5 for building in your mozconfig:
Use apitrace from https://github.com/gw280/apitrace (branch android) to build for desktop and android.
<pre>
ac_add_options --with-android-version=9
</pre>
 
This is because the EGL headers don't exist in android-5, which are needed to build apitrace.
 
After it's built, upload it to device then set the following prefs:
 
<pre>
gfx.apitrace.enabled = true
gfx.apitrace.log_path = apitrace_log
</pre>
 
Then you can restart fennec and the apitrace log will be saved to /data/data/org.mozilla.fennec_username/apitrace_log.trace
 
You can then adb pull /data/data/org.mozilla.fennec_username/apitrace_log.trace and analyse it on your desktop.
 
Use apitrace from https://github.com/gw280/apitrace (branch android) on your desktop to analyse with.


<pre>
<pre>
Line 640: Line 621:
git clone https://github.com/gw280/apitrace.git
git clone https://github.com/gw280/apitrace.git
cd apitrace
cd apitrace
# Build for Android
export ANDROID_NDK=/path/to/your/ndk
cmake -DCMAKE_TOOLCHAIN_FILE=android/android.toolchain.cmake -DANDROID_API_LEVEL=9 -Bbuild-android -H.
make -C build-android -j8
# Build for desktop
cmake -H. -Bbuild
cmake -H. -Bbuild
make -C build -j8
make -C build -j8
export EGL_SOFTWARE=true
export EGL_SOFTWARE=true
./build/eglretrace -v /path/to/your/apitrace_log.trace
./build/eglretrace -v /path/to/your/apitrace_log.trace
</pre>
</pre>
The Android build will create egltrace.so in build-android/wrappers, which you can then push to your device to /data/local:
<pre>
adb push build-android/wrappers/egltrace.so /data/local
</pre>
Restarting Fennec will cause it to load the apitrace library and the apitrace log will be saved to /data/data/org.mozilla.fennec_username/firefox.trace
You can then adb pull /data/data/org.mozilla.fennec_username/firefox.trace and analyse it on your desktop.


You can also use qapitrace as a GUI to inspect your trace files.
You can also use qapitrace as a GUI to inspect your trace files.
53

edits

Navigation menu