Android tracing

José Fonseca jose.r.fonseca at gmail.com
Tue Oct 30 03:41:08 PDT 2012


Forewarning: I have almost zero experience with Android, and below is
just what I understand from other people's comments.

On Tue, Oct 30, 2012 at 7:53 AM, Anthony Lombardi
<tonyjlombardi at gmail.com> wrote:
> What is the correct command to get a trace of an application on android?
> Below is a command I put into the adb shell.  It runs the application, but I
> didn't find a trace file in /data.  I have egltrace.so in /data on the
> device.  The device is also rooted.
>
> LD_PRELOAD=/data/egltrace.so am start -n
> com.rovio.angrybirds/com.rovio.ka3d.App

I suspect that angry bird is not a standalone application therefore
the "For standalone applications the instructions above for Linux
should work" comment does not apply.  Instead, you probably need to
follow the extensive instructions right after that sentence,
describing how to trace zygote applications.

> The readme mentioned that the method for linux should work, and in the Linux
> section there's this:
>
> LD_PRELOAD=/path/to/apitrace/wrappers/glxtrace.so /path/to/application
>
> I'm probably doing something wrong here... am I supposed to use glxtrace.so
> or egltrace.so?

You'll always need to use egltrace.so. glxtrace is for X, which
Android doesn't have.

> If someone has used apitrace on android and can give an example for an
> actual app that would be great.  Thanks.

Kanru on its initial effort to port Apitrace to Android wrote an example on
https://github.com/kanru/apitrace/commit/5948e72a25b1d2df07299db0d49f91677827478b

  adb push /path/to/apitrace/build/wrappers/egltrace.so /data
  adb shell
  # cd /data/local/tmp
  # LD_PRELOAD=/data/egltrace.so test-opengl-gl2_basic

  adb pull /data/local/tmp/test-opengl-gl2_basic.trace
  eglretrace test-opengl-gl2_basic.trace

Paths probably need some tweaking, but If otherwise the example still
works I can add this to the README.

Jose


More information about the apitrace mailing list