Closed Bug 1527135 Opened 5 years ago Closed 5 years ago

Incorrect stacks in profiler for webrender on geckoview

Categories

(Core :: Gecko Profiler, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: jnicol, Assigned: mstange)

Details

Attachments

(2 files)

I've been trying to profile webrender using a local build of the geckoview example android app. Attached is a profile I captured. In the Renderer thread, you can see a whole bunch of functions as direct children of MessagePumpDefault::Run(), when lots of these should actually be descendants of rust code elsewhere in the profile. Interestingly all these functions seem to be from libs other than libxul.so, such as libGLESv2_adreno.so.

Device is a Oneplus 6 running Android P, but was seeing the same issue on my Pixel 2.

Markus told me on irc this is a stackwalking issue. Is there any more information I can provide?

Jed, this is the problem I mentioned to you in Orlando. I can provide two libESXGLESv2_adreno.so files, one from before an Android update on Nov 18, 2018, and one from after the update. The "before" version had working unwinding, the "after" version the profiler is not able to unwind anymore.

Would that be enough information for you to take a look?

Flags: needinfo?(jld)

This is currently interfering with work to get WebRender running on Android, so it would be great if we could fix it.

Comparing the two libraries, the unwind tables and program headers look reasonable for both of them, but while looking at the code that reads the file header, I noticed an important difference.

Before (output from readelf -h):

  OS/ABI:                            UNIX - System V

After:

  OS/ABI:                            UNIX - GNU

I think the EI_OSABI and EI_ABIVERSION checks can just be deleted; I don't think there's any value of those fields that would change the format of the unwind tables.

Flags: needinfo?(jld)

Thanks!! Removing those checks indeed gives me working stackwalking for the GL driver!

Here are two profiles, focused on the glTexSubImage2D function on the compositor thread.
Before: https://perfht.ml/2Ecnmhp
After: https://perfht.ml/2EcnlKn

Jamie, can you check whether this patch improves the situation for you?
(I still don't get working unwinding out of libc.so, but I think that's a separate problem and I will file a new bug for it.)

Flags: needinfo?(jnicol)
Assignee: nobody → mstange
Status: NEW → ASSIGNED

Yes, it definitely improves it, thanks Jed and Markus! There are still some functions which look in the wrong place, but the ones I'm interested in are correct.

Here's a profile with the patch applied: https://perf-html.io/public/52a09cfbe9194e76598932e431f0ada65a0240b8/calltree/?globalTrackOrder=0-1&thread=1&v=3

Flags: needinfo?(jnicol)
Pushed by mstange@themasta.com:
https://hg.mozilla.org/integration/autoland/rev/2302287136a3
Remove unnecessary EI_OSABI and EI_ABIVERSION checks. r=jld
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: