gecko-dev/toolkit
Anthony Zhang 0571a2708a 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
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 Merge f-t to m-c, a=merge 2016-01-31 17:52:17 -08:00
crashreporter Backout 24dbe7da7370:a319694b46d5 (bug 1069556) for build bustage on various platforms on a CLOSED TREE 2016-01-29 11:55:43 -05: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 Backed out changeset e8148cda7d85 (bug 989960) for xpcshell bustage 2016-02-01 08:25:19 -08:00
mozapps Backed out changeset e8148cda7d85 (bug 989960) for xpcshell bustage 2016-02-01 08:25:19 -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 Back out 7 changesets (bug 1235261) for cpptest failures in TestTArray 2016-01-31 10:10:57 -08: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 1242073 - Tweaks to about:networking. r=jaws 2016-02-01 19:55:07 +01:00
webapps Bug 1220564 - Update chrome code uses of genexprs and legacy comprehensions. (r=billm) 2016-01-06 16:02:16 -08:00
xre Back out e8d8faa25955 (bug 1241111) for breaking platform.ini, a=bustage 2016-01-31 10:01:22 -08:00
.eslintrc Bug 1235023 - Relax no-multi-spaces Eslint rule with ObjectExpression. r=Gijs 2015-12-30 16:12:17 +01:00
moz.build Backout 24dbe7da7370:a319694b46d5 (bug 1069556) for build bustage on various platforms on a CLOSED TREE 2016-01-29 11:55:43 -05:00
toolkit.mozbuild Bug 1239866 - Remove signaling standalone tests. r=bwc 2016-01-15 12:18:39 -08:00