Add a method for dumping self-contained HTML timeline profiles

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 gant-chart style
timeline.
This commit is contained in:
Nick Fitzgerald 2016-04-16 11:48:23 -07:00
parent 311dd0f930
commit 9fbb5c720e
17 changed files with 758 additions and 11 deletions

View file

@ -8,7 +8,7 @@ use energy::read_energy_uj;
use ipc_channel::ipc::IpcSender;
use self::std_time::precise_time_ns;
#[derive(PartialEq, Clone, PartialOrd, Eq, Ord, Deserialize, Serialize)]
#[derive(PartialEq, Clone, PartialOrd, Eq, Ord, Debug, Deserialize, Serialize)]
pub struct TimerMetadata {
pub url: String,
pub iframe: TimerMetadataFrameType,
@ -35,7 +35,7 @@ pub enum ProfilerMsg {
}
#[repr(u32)]
#[derive(PartialEq, Clone, PartialOrd, Eq, Ord, Deserialize, Serialize, Debug, Hash)]
#[derive(PartialEq, Clone, Copy, PartialOrd, Eq, Ord, Deserialize, Serialize, Debug, Hash)]
pub enum ProfilerCategory {
Compositing,
LayoutPerform,
@ -78,13 +78,13 @@ pub enum ProfilerCategory {
ApplicationHeartbeat,
}
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize)]
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Deserialize, Serialize)]
pub enum TimerMetadataFrameType {
RootWindow,
IFrame,
}
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize)]
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Deserialize, Serialize)]
pub enum TimerMetadataReflowType {
Incremental,
FirstReflow,
@ -123,4 +123,3 @@ pub fn send_profile_data(category: ProfilerCategory,
(start_time, end_time),
(start_energy, end_energy)));
}