[PATCH 0/9] support for tracing Android Dalvik applications

José Fonseca jose.r.fonseca at gmail.com
Sun Apr 15 05:28:20 PDT 2012


Imre,

Thanks for these changes.

I've already merged all which seemed riskless.

These need a bit more care:

>  Android: add support for dynamically enable/disable tracing
>  Android: add usage instructions for tracing zygote applications

Is it possible to do this only only on zygote and its children? I'd
prefer that for non-zygote processes apitrace worked in a similar
fashion for other platforms, i.e., without requiring any additional
settings.

Also, how does this work exactly? apitrace_enabled() caches the
enable/disable property in a static variable. Won't this static
property be forked too (and its value preserved), or does this assume
that the zygote process never calls any GL entrypoint? Perhaps we
should keep track of PID, and recheck when PID changes.

>  optionally track the GL state manually
>  egl: enable manual state tracking

Have you tried the latest (and reportedly improved) Android GLES
emulator to see if the issues persist? If they do, then please file
bugs with Gogle if you haven't, as I really want to limit the amount
of workarounds for buggy OGL implementations as much as possible.

Anyway, as you say, there are issues due to GLES limitations, so we'll
need to cache some state, in order to get fully replayable traces. But
this should only be enabled on GLES -- on EGL + full GL it should
still rely on the implementation, as there is less likely things will
go wrong

Also, before we can do this, we need to track multiple contexts
properly --. Essentially we need to intercept eglMakeCurrent, and
maintain a per-context in a TLS pointer, respect shared state, etc.
Otherwise we'll introduce race conditions, and risk cause crashes
while tracing (which is way more important than having traces that can
be replayed properly).

Jose

On Wed, Apr 11, 2012 at 4:19 PM, Imre Deak <imre.deak at intel.com> wrote:
> this patchset will enable tracing Android applications started from the
> main Dalvik VM process (zygote/app_process). Here we can't use the
> LD_PRELOAD method if we want to restrict the tracing to a specific
> application: this main process is started during booting and never
> stopped afterwards, akin to init on standard distributions. Applications
> will be then forked off of the main process. So in addition to
> preloading the apitrace wrapper library before the main process this
> patchset will make it possible to enable tracing during _runtime_. The
> enabling is done based on a user configurable Android property setting
> that apitrace will match against the current process name.
>
> In addition there are a couple of fixes, mostly related to the need to
> track the GL state manually in certain cases. In particular these are
> needed on Android or other EGL platforms. See PATCH 8/9 for an explanation
> for this.
>
> I have tested this so far with a couple of Android applications,
> replaying the trace with egltrace on the host.
>
> Please consider this for merging. Also any questions or feedback
> regarding this patchset is welcome.
>
> Thanks,
> Imre
>
> Imre Deak (9):
>  gles: don't call unsupported glGetHandleARB
>  gles: fix lookup for GLESv1 functions
>  gles: fix GLES version string matching
>  gles: sanity check GL_COMBINED_TEXTURE_IMAGE_UNITS
>  Android: hard code the trace file path to be under /data
>  Android: add support for dynamically enable/disable tracing
>  Android: add usage instructions for tracing zygote applications
>  optionally track the GL state manually
>  egl: enable manual state tracking
>
>  README.markdown               |   61 ++++++++++
>  common/trace_writer_local.cpp |    6 +-
>  egltrace.py                   |    3 +
>  glproc_egl.cpp                |   15 ++-
>  glsize.hpp                    |   14 ++-
>  glstate.cpp                   |    2 +-
>  glstate_images.cpp            |    3 +
>  glstate_shaders.cpp           |   10 ++-
>  gltrace.hpp                   |   13 ++-
>  gltrace.py                    |  258 +++++++++++++++++++++++++++++++++++++++--
>  trace.py                      |   56 +++++++++-
>  11 files changed, 422 insertions(+), 19 deletions(-)
>
> --
> 1.7.5.4
>


More information about the apitrace mailing list