Closed Bug 968237 Opened 12 years ago Closed 12 years ago

We should be able to dynamically set the threshold of the event loop lag tracker

Categories

(Core :: Widget, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: paul, Assigned: vingtetun)

References

Details

Attachments

(1 file, 2 obsolete files)

No description provided.
Depends on: 962511
What's the use case here?
Bug 962044 introduces a notification when an operation in the event loop takes too long to end. Today, the threshold come from a environment variable: http://mxr.mozilla.org/mozilla-central/source/toolkit/xre/EventTracer.cpp#112 We want to be able to change this value from the developer tools.
Right, but my question is *why*?
Gaia developers want to be notified when the event loop gets stuck for a long time. The duration of what we consider a lag will vary. For some devices, it will be 200ms, on other it will be 100ms. Also, first we want to find the longest operations (200ms for example), fix the problems, then find the operation taking more than 150ms, then 100ms. Does this answer your question?
Attached patch jank.threshold.patch (obsolete) — Splinter Review
Something as simple as a pref should be enough.
Attachment #8372813 - Flags: review?(ted)
Comment on attachment 8372813 [details] [diff] [review] jank.threshold.patch Review of attachment 8372813 [details] [diff] [review]: ----------------------------------------------------------------- ::: toolkit/xre/EventTracer.cpp @@ +132,3 @@ > #ifdef MOZ_WIDGET_GONK > + nsresult rv = NS_ERROR_FAILURE; > + rv = Preferences::GetInt("devtools.janks.threshold", &thresholdInterval); You're not supposed to access preferences off the main thread. This will eventually become a fatal assertion. You'll need to do this in InitEventTracer and pass it through TracerStartClosure. @@ +132,5 @@ > #ifdef MOZ_WIDGET_GONK > + nsresult rv = NS_ERROR_FAILURE; > + rv = Preferences::GetInt("devtools.janks.threshold", &thresholdInterval); > + if (!NS_SUCCEEDED(rv)) { > + thresholdInterval = 100; If you're going to do this, do it on every platform, not just gonk. Also, I'm not wild about the fact that gonk has a different default.
Attachment #8372813 - Flags: review?(ted) → review-
Attached patch jank.threshold.patch (obsolete) — Splinter Review
Removed the special default value for gonk and stop reading the pref outside of the main thread (sorry about that).
Attachment #8372813 - Attachment is obsolete: true
Attachment #8375924 - Flags: review?(ted)
Same patch but with Preferences.h out of the #ifdef gonk since Try was complaining.
Attachment #8375924 - Attachment is obsolete: true
Attachment #8375924 - Flags: review?(ted)
Attachment #8376160 - Flags: review?(ted)
Attachment #8376160 - Flags: review?(ted) → review+
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
Depends on: 973232
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: