Closed Bug 1071165 Opened 10 years ago Closed 7 years ago

Add a way to profile unregistered threads on b2g

Categories

(Core :: Gecko Profiler, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: BenWa, Unassigned)

References

Details

On b2g (linux) if we could get a list of all pthread handles we could monitor non gecko native threads. For more advanced graphics issue this would let us monitor GL driver threads which are not controlled or owned by us.

'/proc/<pid>' can list the tid but we don't have a way to map them to pthread unfortunately. We could maybe interpose pthread_create.
Would be it possible to hook pthread_create on b2g to build a list of the pthread handles that gecko could track?
Flags: needinfo?(mh+mozilla)
(In reply to Benoit Girard (:BenWa) from comment #1)
> Would be it possible to hook pthread_create on b2g to build a list of the
> pthread handles that gecko could track?

Nuwa already hooks pthread_create, so I'd expect the answer to be "yes".

But is there anything where we actually need the pthread_t and not the tid?
Flags: needinfo?(mh+mozilla)
(In reply to Jed Davis [:jld] from comment #2)
> But is there anything where we actually need the pthread_t and not the tid?

pthread_get_stackaddr_np, although I guess that could be replaced by something using the tid.
Err no, that's OSX only. I was thinking of something else, that gets the thread name.
This bug was about B2G. We may want to do the same thing on other platforms but I don't know how much we're interested in threads that aren't launched by Gecko. I'm going to close this bug for now, we can open a new bug about the other platforms if it comes up again.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.