diff options
Diffstat (limited to 'components/util/opts.rs')
-rw-r--r-- | components/util/opts.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/components/util/opts.rs b/components/util/opts.rs index 659ead8b4c5..8cc67c1d217 100644 --- a/components/util/opts.rs +++ b/components/util/opts.rs @@ -217,6 +217,10 @@ pub struct Opts { // don't skip any backtraces on panic pub full_backtraces: bool, + /// True to use OS native signposting facilities. This makes profiling events (script activity, + /// reflow, compositing, etc.) appear in Instruments.app on macOS. + pub signpost: bool, + /// Print the version and exit. pub is_printing_version: bool, } @@ -322,6 +326,10 @@ pub struct DebugOptions { /// useful when modifying the shaders, to ensure they all compile /// after each change is made. pub precache_shaders: bool, + + /// True to use OS native signposting facilities. This makes profiling events (script activity, + /// reflow, compositing, etc.) appear in Instruments.app on macOS. + pub signpost: bool, } @@ -361,6 +369,7 @@ impl DebugOptions { "msaa" => debug_options.use_msaa = true, "full-backtraces" => debug_options.full_backtraces = true, "precache-shaders" => debug_options.precache_shaders = true, + "signpost" => debug_options.signpost = true, "" => {}, _ => return Err(option) }; @@ -411,6 +420,7 @@ pub fn print_debug_usage(app: &str) -> ! { print_option("full-backtraces", "Print full backtraces for all errors"); print_option("wr-debug", "Display webrender tile borders. Must be used with -w option."); print_option("precache-shaders", "Compile all shaders during init. Must be used with -w option."); + print_option("signpost", "Emit native OS signposts for profile events (currently macOS only)"); println!(""); @@ -549,6 +559,7 @@ pub fn default_opts() -> Opts { is_printing_version: false, webrender_debug: false, precache_shaders: false, + signpost: false, } } @@ -860,6 +871,7 @@ pub fn from_cmdline_args(args: &[String]) -> ArgumentParsingResult { is_printing_version: is_printing_version, webrender_debug: debug_options.webrender_debug, precache_shaders: debug_options.precache_shaders, + signpost: debug_options.signpost, }; set_defaults(opts); |