]> git.cworth.org Git - apitrace/commit
Android: add support for dynamically enable/disable tracing
authorImre Deak <imre.deak@intel.com>
Fri, 30 Mar 2012 12:46:26 +0000 (15:46 +0300)
committerJosé Fonseca <jose.r.fonseca@gmail.com>
Sat, 7 Jul 2012 11:08:07 +0000 (12:08 +0100)
commit1242ab5cbdc409e2fc2d787edc28c6ac2a8439d1
treed7648c8c9847e24ad76094cc023fa1261983676e
parentaf41e568fc908277d84a01ed56bbefe4db334241
Android: add support for dynamically enable/disable tracing

To trace applications started by the Dalvik VM we have to wrap the main
Dalvik process zygote (or app_process) which is started at boot time and
never stopped afterwards. We would still want to restrict tracing to a
single process which will be forked by zygote.

To achieve this we'll use the fact that the forked process image is
contained in the same file as zygote, pointed to by /proc/self/exe. So
if this is 'app_process' we know it's a zygote process. To distinguish
between zygote processes we'll check /proc/self/cmdline which will in
turn be set to a unique application specific string (for example
com.android.settings). The user has to set the debug.apitrace.procname
to this string in order to enable tracing.

For non-zygote processes tracing will be always enabled.

Signed-off-by: Imre Deak <imre.deak@intel.com>
common/os.hpp
common/os_posix.cpp
wrappers/trace.py