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)
Core
Widget
Tracking
()
RESOLVED
FIXED
mozilla30
People
(Reporter: paul, Assigned: vingtetun)
References
Details
Attachments
(1 file, 2 obsolete files)
|
2.82 KB,
patch
|
ted
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Comment 1•12 years ago
|
||
What's the use case here?
| Reporter | ||
Comment 2•12 years ago
|
||
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.
Comment 3•12 years ago
|
||
Right, but my question is *why*?
| Reporter | ||
Comment 4•12 years ago
|
||
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?
| Assignee | ||
Comment 5•12 years ago
|
||
Something as simple as a pref should be enough.
Attachment #8372813 -
Flags: review?(ted)
Comment 6•12 years ago
|
||
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-
| Assignee | ||
Comment 7•12 years ago
|
||
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)
| Assignee | ||
Comment 8•12 years ago
|
||
| Assignee | ||
Comment 9•12 years ago
|
||
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)
| Assignee | ||
Comment 10•12 years ago
|
||
Updated•12 years ago
|
Attachment #8376160 -
Flags: review?(ted) → review+
| Assignee | ||
Comment 11•12 years ago
|
||
Status: NEW → ASSIGNED
OS: Windows XP → All
Comment 12•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in
before you can comment on or make changes to this bug.
Description
•