servo/components
bors-servo 2e0191b839
Auto merge of #23080 - jdm:sampling-profiler, r=gterzian
Add a sampling profiler

This uses the code already built for the background hang monitor and adds the ability to repeatedly sample all monitored threads. This sampling allows us to generate profiles that we can translate into the format used by https://perf-html.io/, allowing us to benefit from modern Gecko performance tooling.

You can run Servo with `PROFILE_OUTPUT=foo.json` and `SAMPLING_RATE=50` (for example), otherwise these values will default to `samples.json` and 10ms, respectively. To activate the profiler, press cmd+p, and to stop profiling, press cmd+p again. This will the captured samples to be symbolicated, which will take a very long time, and eventually there will be a new JSON profile in the output location.

To create a profile for use by Gecko's tools, run `python etc/profilicate.py path/to/profile.json >gecko_profile.json`, and load `gecko_profile.json` in the https://perf-html.io/ to see something like [this](https://profiler.firefox.com/public/8137e2b11fbb92afb80090bc534fd83015c87ee6/calltree/?globalTrackOrder=0-1&thread=1&v=3);

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #13103
- [x] These changes do not require tests because way too many pieces to automate

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23080)
<!-- Reviewable:end -->
2019-03-26 16:36:19 -04:00
..
allocator Make Servo components use winapi 0.3 2019-01-16 14:29:53 +01:00
atoms Add SignalingState to RTCPeerConnection 2019-03-25 09:04:13 -07:00
background_hang_monitor Add unit test for sampling profiler. 2019-03-26 16:35:52 -04:00
bluetooth #23065 removed unnecessary headless checking 2019-03-22 16:31:18 +03:00
bluetooth_traits Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
canvas WR update: new viewport semantic 2019-03-22 15:41:48 +08:00
canvas_traits Remove offscreen_gl_context dependency from canvas_traits and script. 2019-03-07 09:27:36 -05:00
compositing Auto merge of #23080 - jdm:sampling-profiler, r=gterzian 2019-03-26 16:36:19 -04:00
config #8539 Config preferences backend restructure 2019-03-20 15:01:26 +00:00
config_plugins #8539 Config preferences backend restructure 2019-03-20 15:01:26 +00:00
constellation Auto merge of #23080 - jdm:sampling-profiler, r=gterzian 2019-03-26 16:36:19 -04:00
debugger Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
deny_public_fields Update syn and related dependencies 2018-11-30 17:48:41 +01:00
devtools Remove redundant .clone()s 2018-12-11 10:43:51 +09:00
devtools_traits Update references to malloc_size_of_derive, which is in crates.io now. 2019-01-13 21:59:31 +01:00
dom_struct Update syn and related dependencies 2018-11-30 17:48:41 +01:00
domobject_derive Update syn and related dependencies 2018-11-30 17:48:41 +01:00
embedder_traits Add a sampling profiler and a script to generate profiles for use with Gecko tooling. 2019-03-26 16:35:08 -04:00
fallible Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
geometry WR update: new viewport semantic 2019-03-22 15:41:48 +08:00
gfx WR update: APIs update 2019-03-22 15:41:48 +08:00
gfx_traits Fix deprecation warnings 2019-01-28 11:32:40 +01:00
hashglobe cargo fix --edition 2018-11-10 17:47:28 +01:00
jstraceable_derive Update syn and related dependencies 2018-11-30 17:48:41 +01:00
layout WR update: APIs update 2019-03-22 15:41:48 +08:00
layout_thread #8539 Config preferences backend restructure 2019-03-20 15:01:26 +00:00
layout_traits style: Make Servo use a single thread-pool for layout-related tasks per-process. 2018-12-23 13:00:56 +01:00
malloc_size_of Update webrender. 2019-01-17 17:52:35 -05:00
metrics Update references to malloc_size_of_derive, which is in crates.io now. 2019-01-13 21:59:31 +01:00
msg Support multiprocess in sampling profiler. 2019-03-26 16:35:10 -04:00
net Auto merge of #23045 - miller-time:promote-memory-blob, r=jdm 2019-03-20 20:14:34 -04:00
net_traits Auto merge of #22973 - paulrouget:wrupdate, r=emilio 2019-03-22 08:48:16 -04:00
pixels Update references to malloc_size_of_derive, which is in crates.io now. 2019-01-13 21:59:31 +01:00
profile Fix deprecation warnings 2019-01-28 11:32:40 +01:00
profile_traits Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
rand Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
range Update references to malloc_size_of_derive, which is in crates.io now. 2019-01-13 21:59:31 +01:00
remutex Rustfmt has changed its default style :/ 2018-12-28 13:17:47 +01:00
script Auto merge of #23095 - jdm:mozjsprofiling, r=jdm 2019-03-26 14:00:56 -04:00
script_layout_interface Move CSSReporter from script_layout_interface to script 2019-01-14 10:26:26 +01:00
script_plugins Upgrade to rustc 1.34.0-nightly (0ea22717a 2019-03-02) 2019-03-03 19:32:42 +01:00
script_traits Support multiprocess in sampling profiler. 2019-03-26 16:35:10 -04:00
selectors Reformat 2019-02-26 08:18:33 +01:00
servo Auto merge of #23080 - jdm:sampling-profiler, r=gterzian 2019-03-26 16:36:19 -04:00
servo_arc cargo fix --edition 2018-11-10 17:47:28 +01:00
size_of_test Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
std_test_override Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
style #8539 Config preferences backend restructure 2019-03-20 15:01:26 +00:00
style_derive style: Add two commas to appease tidy. 2019-03-13 15:08:41 +01:00
style_traits style: Implement a version of #[css(skip_if)] that takes more context. 2019-03-13 15:08:19 +01:00
url Auto merge of #22740 - Hyperion101010:master, r=jdm 2019-01-28 15:56:29 -05:00
webdriver_server WR update: dependencies update 2019-03-21 09:34:42 +08:00
webvr #8539 Config preferences backend restructure 2019-03-20 15:01:26 +00:00
webvr_traits Use a test VRDisplay that renders to a GL window 2019-03-05 12:54:12 -06:00