[PATCH] egltrace/android: Fix tracing Zygote processes

Chad Versace chad.versace at linux.intel.com
Thu Jun 6 15:22:37 PDT 2013


Fixes egltrace.so on Android 4.2 x86.

Do not call trimDirectory() on the proc_name of Zygote processes, because
proc_name never contain a path separator. The proc_name of a Zygote
process is the application's package name (such as com.exampe.myapp)
because ActivityManager rewrites argv[0].

Not only is the call to trimDirectory() unnecessary, it also returns
garbage when there is no path separator. The garbage caused the comparison
against system property "apitrace.debug.procname" == proc_name to
incorrectly fail.

Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 wrappers/trace.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/wrappers/trace.cpp b/wrappers/trace.cpp
index eb68934..d79b11b 100644
--- a/wrappers/trace.cpp
+++ b/wrappers/trace.cpp
@@ -98,7 +98,6 @@ isTracingEnabled(void)
     os::String proc_name;
 
     proc_name = getZygoteProcessName();
-    proc_name.trimDirectory();
 
     __system_property_get("debug.apitrace.procname", target_proc_name);
     enabled = !strcmp(target_proc_name, proc_name);
-- 
1.8.1.4



More information about the apitrace mailing list