Add task profiler, which works by instrumenting each task runtime when enabled.

This commit is contained in:
Glenn Watson 2014-10-29 07:24:34 +10:00
parent 3aad350a64
commit 90d793cdc8
7 changed files with 241 additions and 10 deletions

View file

@ -87,6 +87,11 @@ pub struct Opts {
/// and render.
pub trace_layout: bool,
/// If true, instrument the runtime for each task created and dump
/// that information to a JSON file that can be viewed in the task
/// profile viewer.
pub profile_tasks: bool,
/// `None` to disable devtools or `Some` with a port number to start a server to listen to
/// remote Firefox devtools connections.
pub devtools_port: Option<u16>,
@ -148,6 +153,7 @@ fn default_opts() -> Opts {
user_agent: None,
dump_flow_tree: false,
validate_display_list_geometry: false,
profile_tasks: false,
}
}
@ -173,6 +179,7 @@ pub fn from_cmdline_args(args: &[String]) -> bool {
getopts::optflag("b", "bubble-widths", "Bubble intrinsic widths separately like other engines"),
getopts::optflag("", "show-debug-borders", "Show debugging borders on layers and tiles."),
getopts::optflag("", "show-debug-fragment-borders", "Show debugging borders on fragments."),
getopts::optflag("", "profile-tasks", "Instrument each task, writing the output to a file."),
getopts::optflag("", "disable-text-aa", "Disable antialiasing for text rendering."),
getopts::optflag("", "trace-layout", "Write layout trace to external file for debugging."),
getopts::optflagopt("", "devtools", "Start remote devtools server on port", "6000"),
@ -277,6 +284,7 @@ pub fn from_cmdline_args(args: &[String]) -> bool {
show_debug_borders: opt_match.opt_present("show-debug-borders"),
show_debug_fragment_borders: opt_match.opt_present("show-debug-fragment-borders"),
enable_text_antialiasing: !opt_match.opt_present("disable-text-aa"),
profile_tasks: opt_match.opt_present("profile-tasks"),
trace_layout: trace_layout,
devtools_port: devtools_port,
initial_window_size: initial_window_size,