diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-04-28 02:47:35 -0700 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-04-28 02:47:35 -0700 |
commit | b8e2fa58d61a4d77b67efa09a437ba6beb68e30e (patch) | |
tree | 4de0a747668242f031fc1429031305c5895008c8 /components/servo/lib.rs | |
parent | 78e23f4c9b54c51012c672839545682b38455d67 (diff) | |
parent | 9fbb5c720eb89947720fa745aa08fa4fed7143b4 (diff) | |
download | servo-b8e2fa58d61a4d77b67efa09a437ba6beb68e30e.tar.gz servo-b8e2fa58d61a4d77b67efa09a437ba6beb68e30e.zip |
Auto merge of #10694 - fitzgen:profile-traces-to-file, r=SimonSapin
Add a method for dumping profiles as self-contained HTML w/ timeline visualization
This commit adds the `--profiler-trace-path` flag. When combined with `-p` to
enable profiling, it dumps a profile as a self-contained HTML file to the given
path. The profile visualizes the traced operations as a Gantt-chart style
timeline.
Example output HTML file: http://media.fitzgeraldnick.com/dumping-grounds/trace-reddit.html
Mostly I made this because I wanted to see what kind of data the profiler has, and thought that this might be useful for others as well. I'm happy to add tests if we can figure out how to integrate them into CI, but I'm not sure how that would work.
Thoughts?
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10694)
<!-- Reviewable:end -->
Diffstat (limited to 'components/servo/lib.rs')
-rw-r--r-- | components/servo/lib.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 47c66b97590..42e6706500c 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -116,7 +116,8 @@ impl Browser { let (compositor_proxy, compositor_receiver) = window.create_compositor_channel(); let supports_clipboard = window.supports_clipboard(); - let time_profiler_chan = profile_time::Profiler::create(opts.time_profiler_period); + let time_profiler_chan = profile_time::Profiler::create(opts.time_profiler_period, + opts.time_profiler_trace_path.clone()); let mem_profiler_chan = profile_mem::Profiler::create(opts.mem_profiler_period); let devtools_chan = opts.devtools_port.map(|port| { devtools::start_server(port) |