Profiler markers showing stacks of thread creations happening off main thread would be useful
Categories
(Core :: XPCOM, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox84 | --- | fixed |
People
(Reporter: florian, Assigned: florian)
References
Details
Attachments
(1 file)
In bug 1670786 I added a marker showing the stacks of new threads created on the main thread. I was also interested in stacks of threads created off main thread but couldn't record them easily because the new marker API didn't support that yet. This has been fixed in bug 1670954.
I think
PROFILER_MARKER_TEXT(
"NewThread (non-main thread)", OTHER,
MarkerOptions({MarkerStack::Capture(),
MarkerThreadId::MainThread(),
MarkerTiming::IntervalUntilNowFrom(startTime)}),
aName);
is the correct code to add this marker, but when I do this, the markers don't have a stack. Example profile: https://share.firefox.dev/3lXGUsO
If instead I use the old API and do this:
profiler_add_marker_for_mainthread(
JS::ProfilingCategoryPair::OTHER, "NewThread (non-main thread)",
TextMarkerPayload(aName, startTime, TimeStamp::Now(),
mozilla::Nothing(), profiler_get_backtrace()));
the markers have stacks. Example profile: https://share.firefox.dev/2IQ1PzN
Assignee | ||
Comment 1•5 years ago
|
||
What you've written should work (there is no special treatment around capturing stacks, depending on a given thread id), so it's a bug if that doesn't work. I will have a look, and file a bug as needed...
Profile with bug 1672310 (WIP) applied: https://share.firefox.dev/3kiGmxh
Assignee | ||
Comment 4•5 years ago
|
||
(In reply to Gerald Squelart [:gerald] (he/him) from comment #3)
Profile with bug 1672310 (WIP) applied: https://share.firefox.dev/3kiGmxh
The native stack frames in this profile (both in marker stacks and in the call tree) don't seem to have a library or file name associated with them, and the front-end treat them all as label frames (they are displayed in grey). Is this a side effect of using MOZ_PROFILER_SYMBOLICATE?
(In reply to Florian Quèze [:florian] from comment #4)
The native stack frames in this profile (both in marker stacks and in the call tree) don't seem to have a library or file name associated with them, and the front-end treat them all as label frames (they are displayed in grey). Is this a side effect of using MOZ_PROFILER_SYMBOLICATE?
That's very possible! It's that, or no symbols on my local builds. 😢
Comment 7•5 years ago
|
||
bugherder |
Description
•