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 -->
This commit is contained in:
bors-servo 2016-04-28 02:47:35 -07:00
commit b8e2fa58d6
17 changed files with 758 additions and 11 deletions

View file

@ -7,7 +7,7 @@ use profile_traits::time::ProfilerMsg;
#[test]
fn time_profiler_smoke_test() {
let chan = time::Profiler::create(None);
let chan = time::Profiler::create(None, None);
assert!(true, "Can create the profiler thread");
chan.send(ProfilerMsg::Exit);