[PATCH] egltrace/android: Fix tracing Zygote processes (v2)

Chad Versace chad.versace at linux.intel.com
Tue Jun 11 13:06:23 PDT 2013


On 06/11/2013 12:57 PM, Alexander Monakov wrote:
> On Wed, Jun 12, 2013 at 3:33 AM, Chad Versace
> <chad.versace at linux.intel.com> wrote:
>> I've instrumented some logging around the call to trimDirectory in the
>> troublesome location. Here's the code context:
>>
>> ----
>>      proc_name = getZygoteProcessName();
>>      os::log("apitrace[%d]:%s: proc_name=\"%s\"\n", pid, __PRETTY_FUNCTION__,
>> proc_name.str());
>>      proc_name.trimDirectory();
>>      os::log("apitrace[%d]:%s: proc_name=\"%s\"\n", pid, __PRETTY_FUNCTION__,
>> proc_name.str());
>> ----
>>
>> And here's the log:
>>
>> ----
>> D/apitrace( 3747): apitrace:void os::String::trimDirectory():
>> buffer="com.forthblue.pool"
>> D/apitrace( 3747): apitrace:void os::String::trimDirectory(): buffer="bin"
>> ----
>
>
> Hm, the log you're showing does not match the printf format above at all.

The actual log and printfs included extra stuff that concerned no one here, and
so would just be noise. I deleted that out in the email, and may have
deleted too much.

However, the meaningful content doesn't change: trimDirectory() here transforms
"com.forthblue.pool" to "bin".

> Isn't the VM changing the process name from/to "bin" to/from
> "com.bla.bla" at some point?

Every Dalvik application begins as an instantiation of /system/bin/app_process,
which rewrites it's argv[0] to be the Java package name of the Dalvik application.
See ``frameworks/base/cmds/app_process/app_main.cpp:setArgv0()``.


More information about the apitrace mailing list