Profiling with MOZ_PROFILER_STARTUP shows the main thread of the main process unresponsive for the whole profile

RESOLVED FIXED in Firefox 55

Status

()

Core
Gecko Profiler
RESOLVED FIXED
6 months ago
6 months ago

People

(Reporter: florian, Assigned: mstange)

Tracking

(Blocks: 1 bug)

unspecified
mozilla55
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

6 months ago
For an example, see the big red bar at the top of https://perfht.ml/2p03rJ0
(Assignee)

Comment 1

6 months ago
ThreadResponsiveness is probably trying to dispatch an event to the main thread before the main thread's event loop has been set up.
Blocks: 1348023
OS: Unspecified → All
Hardware: Unspecified → All
(Assignee)

Updated

6 months ago
Assignee: nobody → mstange
Status: NEW → ASSIGNED
Comment hidden (mozreview-request)

Comment 3

6 months ago
mozreview-review
Comment on attachment 8866013 [details]
Bug 1358583 - Handle NS_DispatchToMainThread failures gracefully.

https://reviewboard.mozilla.org/r/137608/#review140790

::: tools/profiler/gecko/ThreadResponsiveness.cpp:24
(Diff revision 1)
>  public:
>    CheckResponsivenessTask()
>      : mLastTracerTime(TimeStamp::Now())
>      , mMonitor("CheckResponsivenessTask")
>      , mTimer(nullptr)
> +    , mHasEverBeenDispatched(false)

mHasEverBeenSuccessfullyDispatched would be clearer, but that might be too long. I'll let you decide.

::: tools/profiler/gecko/ThreadResponsiveness.cpp:46
(Diff revision 1)
> +    if (mHasEverBeenDispatched) {
> +      return;
> +    }
> +
> +    nsresult rv = NS_DispatchToMainThread(this);
> +    // Dispatching can fail early during startup.

Add "particularly when MOZ_PROFILER_STARTUP is used"?
Attachment #8866013 - Flags: review?(n.nethercote) → review+
Comment hidden (mozreview-request)

Comment 5

6 months ago
Pushed by mstange@themasta.com:
https://hg.mozilla.org/integration/autoland/rev/e0d7b3f048cd
Handle NS_DispatchToMainThread failures gracefully. r=njn
https://hg.mozilla.org/mozilla-central/rev/e0d7b3f048cd
Status: ASSIGNED → RESOLVED
Last Resolved: 6 months ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.