gecko-dev/toolkit
Anthony Zhang 2e1e076345 Bug 1242777 - Expose child process hang stats to Javascript. r=chutten
What it does:

Adds a new function, TelemetrySession.getChildThreadHangs(), which returns a promise resolving to an array of threadHangStats [1], one per process.

Note that processes that spawn or die while the function's promise is created but not resolved may be excluded from the final result.

How we do this:

1. Parent sends a MESSAGE_TELEMETRY_GET_CHILD_PAYLOAD message to each child, promising the results of these messages.
2. Child processes respond to parent with a MESSAGE_TELEMETRY_THREAD_HANGS, which contains BHR stats in the payload.
3. Parent combines all the child responses together and resolves the promise.

Plus a bunch of synchronization stuff and handling of edge cases since the number of child processes can change at any time.

Also, there is a 200ms timeout since we can't handle all of these cases. Specifically, when a child dies without responding, after all other child processes have responded.

Why we do this:

* We can technically get thread hang stats by retrieving Telemetry pings (see requestChildPayloads() in TelemetrySession for details), but this is very slow and can only be done for one process at a time.
* TelemetrySession is responsible for various Telemetry IPC-related tasks, and so is a natural place to expose this function (i.e., the function blends in well with the rest of the API).
* Statuser [2] uses this for quickly obtaining child process BHR stats. This allows us to get realtime hang monitoring for child processes.

[1]: https://dxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/nsITelemetry.idl#146
[2]: https://github.com/chutten/statuser

--HG--
extra : rebase_source : d323afc3de716e5c978f1120f43af77f193f0b8a
2016-01-28 13:52:07 -05:00
..
components Bug 1242777 - Expose child process hang stats to Javascript. r=chutten 2016-01-28 13:52:07 -05:00
content Bug 1209252: add buttons to clear session and signaling logs. r=jib, r=sicking 2016-01-27 16:05:10 -08:00
crashreporter Bug 1142944 - Don't use PTRACE_GETFPREGS when getting crash trace on Android/ARM r=ted 2016-01-26 11:49:59 -06:00
forgetaboutsite Bug 1189998, Part 2 - Migrate Push service callers. r=mt 2015-12-08 15:41:48 -05:00
identity Backed out 5161ded671e0 for causing Mulet failures 2015-12-03 20:01:43 -08:00
library Bug 1234092: P1. Remove GStreamer support. r=kentuckyfriedtakahe 2015-12-23 01:14:22 +11:00
locales Bug 1209252: add buttons to clear session and signaling logs. r=jib, r=sicking 2016-01-27 16:05:10 -08:00
modules Bug 1242450 - Do not display hidden <option> elements in e10s r=mconley 2016-01-27 12:45:32 -05:00
mozapps Bug 1237820: Track whether a user has been offered a sideloaded add-on or not. r=rhelmer 2016-01-26 14:31:33 -08:00
obsolete Bug 1240660 - Remove "+" prefixes in jar manifests. r=gps 2016-01-20 07:24:40 +09:00
pluginproblem Bug 1195162 - Move mozapps/plugins into pluginproblem (r=sicking,bsmedberg) 2015-09-14 19:08:06 -07:00
profile Bug 1239848 - Revert ProfileManager changes until a better UX/UI is ready, r=ehsan 2016-01-20 09:16:49 +00:00
system Backed out 2 changesets (bug 1224374) for Windows bustage. r=bustage on a CLOSED TREE 2016-01-19 21:30:41 +01:00
themes Bug 1181237 - Update the Field Clear icon for Hi-DPI r=dao 2016-01-28 11:08:31 -08:00
webapps Bug 1220564 - Update chrome code uses of genexprs and legacy comprehensions. (r=billm) 2016-01-06 16:02:16 -08:00
xre Bug 1165818: Remove temporary Nightly only MozTemp-* clean-up code. r=jimm 2016-01-27 11:00:09 +00:00
.eslintrc Bug 1235023 - Relax no-multi-spaces Eslint rule with ObjectExpression. r=Gijs 2015-12-30 16:12:17 +01:00
moz.build Backed out changeset 31c98f5e107b (bug 1069556) 2016-01-26 14:53:02 +01:00
toolkit.mozbuild Bug 1239866 - Remove signaling standalone tests. r=bwc 2016-01-15 12:18:39 -08:00