mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-31 22:25:30 +00:00
0571a2708a
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 |
||
---|---|---|
.. | ||
components | ||
content | ||
crashreporter | ||
forgetaboutsite | ||
identity | ||
library | ||
locales | ||
modules | ||
mozapps | ||
obsolete | ||
pluginproblem | ||
profile | ||
system | ||
themes | ||
webapps | ||
xre | ||
.eslintrc | ||
moz.build | ||
toolkit.mozbuild |