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

José Fonseca jose.r.fonseca at gmail.com
Tue Jun 11 12:23:01 PDT 2013


On Tue, Jun 11, 2013 at 7:33 PM, Chad Versace
<chad.versace at linux.intel.com>wrote:

> On 06/07/2013 02:37 AM, Alexander Monakov wrote:
>
>>
>>
>> On Thu, 6 Jun 2013, Chad Versace wrote:
>>
>>> Not only is the call to trimDirectory() unnecessary,
>>>
>>
>> Agreed, but ...
>>
>>  it also returns garbage when there is no path separator.
>>>
>>
>> no, this doesn't sound right.  Inspection of os::String::trimDirectory
>> does
>> not suggest anything like that might be possible: if there is no path
>> separator in the string, rfindSep() returns end() and trimDirectory
>> leaves the
>> string untouched.  FWIW, previous Android users have not seen this
>> problem.
>>
>> I guess the patch is fine, but it would be papering over a bigger issue.
>>
>
> 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"
> ----
>
> I agree with you that there exists an undiagnosed problem with
> trimDirectory, but I have
> been unsuccessful diagnosing it. On the other hand, the call to
> trimDirectory isn't
> needed and its removal fixes the bug's symptoms.


I pushed this, though I replaced your last paragraph with this one.

I can't see what's wrong with trimDirectory. It has been working and
handling paths without separators without issues. I replicated the above
case and it works fine too. It worries me that something as basic as this
is not working reliably.

Jose
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/apitrace/attachments/20130611/955a992b/attachment.html>


More information about the apitrace mailing list