Skip to content

Create a new DiagnosticsLogging struct as part of Opts #40863

@mrobinson

Description

@mrobinson

Instead of the somewhat fuzzily-defined DebugOpts, let's create a first-class ServoDiagnostics struct for Opts (components/config/opts.rs). This structure would only be responsible for enabling optional log statements in order to help diagnose problems with Servo. It would be controllable via environment variables, like env_logger.

Steps:

  1. Move DebugOpts::disable_share_style_cache to Prefs::layout_style_sharing_cache_enabled and ensure it is enabled by default and the one use of this variable is inverted. The reasoning here is that this is the one member of DebugOpts that isn't about turning on optional print statements.
  2. Rename DebugOpts to DiagnosticsLogging.
  3. Add an environment variable parser that activates as part of the Default implementation for DiagnosticsLogging, but disabled for production builds. This should read an equivalent configuration from SERVO_DIAGNOSTICS configuration variable. When help is in the string, it should print the help and exit the program.
  4. Expose the parser via a helper function and use it to parse the -Z command-line argument.
  5. Add good documentation for each variable and rename them all to make sense together probably getting rid of the dump terminology.
  6. Consider removing profile_script_events for our own trace profiling on the methods in ScriptThread. This is already configurable via Servo logging AFAIK.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions