Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: [b2g] Porting apitrace to android

153 views
Skip to first unread message

Kan-Ru Chen

unread,
Nov 17, 2011, 3:07:29 AM11/17/11
to Chris Jones, mozilla-de...@lists.mozilla.org, mozilla...@lists.mozilla.org, James Ho, Jeff Muizelaar, Benoit Girard
Hi,

Here is an update.

Currently I have built three wrappers for apitrace and there are many
ways you can plug the wrappers into the chain:

1. LD_PRELOAD

If it's a native app that uses FramebufferNativeWindow then you can use
LD_PRELOAD to load the wrappers, *from the commandline.*

2. As an EGL driver

Modify /system/lib/egl/egl.cfg so Android's libEGL.so will load apitrace
wrappers; arrows below mean "load library X":

app--> libEGL.so --> libEGL_apitrace.so --> egltrace.so --> libEGL_mali.so
`-> libGLESv2.so`-> libGLESv2_apitrace.so `-> libGLESv2_mali.so

I get a full screen composition trace of fennec by this combination, but
I'm not sure whether it's rendered by fennec or lower level surface.

3. Directly load from GLContextProviderEGL

Attached patch will check the existence of "gfx.apitrace.path"
preference and load egltrace.so from the path. Then when
EGL_APITRACE_enable_tracing extension exists you can use the function
eglEnableTracingAPITRACE to control the tracing.

I don't know many portions are rendered by GL in fennec now, but I only
see calls from WebGL.

Now the question is how do we want to integrate apitrace.

James Ho

unread,
Nov 21, 2011, 9:28:21 PM11/21/11
to Chris Jones, Benoit Girard, mozilla-de...@lists.mozilla.org, mozilla...@lists.mozilla.org, Kan-Ru Chen, Jeff Muizelaar
Hi Chris and Benoit,

Do you guys have any suggestions of Kan-Ru's question? If there's no
other comment, we tend to take option 3 "Directly load from
GLContextProviderEGL" and add apitrace in the debug build of b2g.

Regards,
James

於 11/17/11 4:07 PM, Kan-Ru Chen 提到:

Joe Drew

unread,
Nov 21, 2011, 9:40:39 PM11/21/11
to James Ho, Ali Juma, Benoit Girard, mozilla...@lists.mozilla.org, Chris Jones, Kan-Ru Chen, Jeff Muizelaar, mozilla-de...@lists.mozilla.org
On 2011-11-21 9:28 PM, James Ho wrote:
> Do you guys have any suggestions of Kan-Ru's question? If there's no
> other comment, we tend to take option 3 "Directly load from
> GLContextProviderEGL" and add apitrace in the debug build of b2g.

Both Benoit and Jeff Muizelaar are off this week; I've CC'd Ali Juma,
who has recently been working with Benoit on the GLES implementation,
and may have more substantive comments.

As an only sometimes-developer on Gecko's GLES support, I don't have a
huge vested interest, but I'd certainly prefer something that lets me
only change a preference vs. LD_PRELOADing, etc.

joe

> 於 11/17/11 4:07 PM, Kan-Ru Chen 提到:
>> Hi,
>>
>> Here is an update.
>>
>> Currently I have built three wrappers for apitrace and there are many
>> ways you can plug the wrappers into the chain:
>>
>> 1. LD_PRELOAD
>>
>> If it's a native app that uses FramebufferNativeWindow then you can use
>> LD_PRELOAD to load the wrappers, *from the commandline.*
>>
>> 2. As an EGL driver
>>
>> Modify /system/lib/egl/egl.cfg so Android's libEGL.so will load apitrace
>> wrappers; arrows below mean "load library X":
>>
>> app--> libEGL.so --> libEGL_apitrace.so --> egltrace.so --> libEGL_mali.so
>> `-> libGLESv2.so`-> libGLESv2_apitrace.so `-> libGLESv2_mali.so
>>
>> I get a full screen composition trace of fennec by this combination, but
>> I'm not sure whether it's rendered by fennec or lower level surface.
>>
>> 3. Directly load from GLContextProviderEGL
>>
>> Attached patch will check the existence of "gfx.apitrace.path"
>> preference and load egltrace.so from the path. Then when
>> EGL_APITRACE_enable_tracing extension exists you can use the function
>> eglEnableTracingAPITRACE to control the tracing.
>>
>> I don't know many portions are rendered by GL in fennec now, but I only
>> see calls from WebGL.
>>
>> Now the question is how do we want to integrate apitrace.
>>
> _______________________________________________
> dev-platform mailing list
> dev-pl...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform

Benoit Girard

unread,
Nov 22, 2011, 1:06:07 AM11/22/11
to Kan-Ru Chen, mozilla-de...@lists.mozilla.org, mozilla...@lists.mozilla.org, James Ho, Jeff Muizelaar, Chris Jones
I'm not sure about the details of number 1) but in any case I think the
best option is number 3. I'd love to have simple instructions to give to
users. Personally I'd go for something along the lines of:
'gfx.apitrace.path' defaults to something like '/data/apitrace.so' and
'gfx.apitrace.enabled' defaults to false. We could then ask users to copy
the library to their sdcard and flip 'gfx.apitrace.enabled'.

Ali Juma

unread,
Nov 22, 2011, 10:10:46 AM11/22/11
to Benoit Girard, mozilla...@lists.mozilla.org, James Ho, Kan-Ru Chen, Jeff Muizelaar, Chris Jones, mozilla-de...@lists.mozilla.org
Ideally, this should work even on non-rooted devices, which seems to rule out option 2. So I'd suggest going with option 3, and letting gfx.apitrace.path default to something like '/data/local/apitrace.so' or '/mnt/sdcard/apitrace.so'.

Ali
> _______________________________________________
> dev-b2g mailing list
> dev...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-b2g

Kan-Ru Chen

unread,
Nov 24, 2011, 5:11:57 AM11/24/11
to Chris Jones, mozilla-de...@lists.mozilla.org, mozilla...@lists.mozilla.org, Benoit Girard, Jeff Muizelaar, James Ho
Hi,

This is what it looks right now:

https://www.youtube.com/watch?v=rDQK4UF1q8M

Kanru

Kan-Ru Chen

unread,
Nov 24, 2011, 5:32:57 AM11/24/11
to Chris Jones, mozilla-de...@lists.mozilla.org, mozilla...@lists.mozilla.org, James Ho, Jeff Muizelaar, Benoit Girard
Oops.. the video was all messed up.

Hope this version will work:

https://www.youtube.com/watch?v=1bFTrVo5lKw

Kanru
0 new messages