You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Scala 2 tracing profiler backport from
scala/scala#7364 extended with more Scala 3
idiomatic syntax based on inlined methods
* Fixes the `context.profiler` which could have been `null`, now it's
initially a NoOp Profiler
* Check dependencies of `-Yprofile-enabled` dependent tasks, now we get
an error if `-Yprofile-trace` is set without `-Yprofile-enabled`
valYfromTastyIgnoreList:Setting[List[String]] =MultiStringSetting("-Yfrom-tasty-ignore-list", "file", "List of `tasty` files in jar files that will not be loaded when using -from-tasty.")
423
423
valYnoExperimental:Setting[Boolean] =BooleanSetting("-Yno-experimental", "Disable experimental language features.")
424
424
valYlegacyLazyVals:Setting[Boolean] =BooleanSetting("-Ylegacy-lazy-vals", "Use legacy (pre 3.3.0) implementation of lazy vals.")
valYprofileDestination:Setting[String] =StringSetting("-Yprofile-destination", "file", "Where to send profiling output - specify a file, default is to the console.", "")
valYprofileExternalTool:Setting[List[String]] =PhasesSetting("-Yprofile-external-tool", "Enable profiling for a phase using an external tool hook. Generally only useful for a single phase.", "typer")
valYprofileRunGcBetweenPhases:Setting[List[String]] =PhasesSetting("-Yprofile-run-gc", "Run a GC between phases - this allows heap size to be accurate at the expense of more time. Specify a list of phases, or *", "_")
valYprofileDestination:Setting[String] =StringSetting("-Yprofile-destination", "file", "Where to send profiling output - specify a file, default is to the console.", "", depends =List(YprofileEnabled->true))
427
+
valYprofileExternalTool:Setting[List[String]] =PhasesSetting("-Yprofile-external-tool", "Enable profiling for a phase using an external tool hook. Generally only useful for a single phase.", "typer", depends =List(YprofileEnabled->true))
428
+
valYprofileRunGcBetweenPhases:Setting[List[String]] =PhasesSetting("-Yprofile-run-gc", "Run a GC between phases - this allows heap size to be accurate at the expense of more time. Specify a list of phases, or *", "_", depends =List(YprofileEnabled->true))
429
+
valYprofileTrace:Setting[String] =StringSetting("-Yprofile-trace", "file", s"Capture trace of compilation in JSON Chrome Trace format to the specified file. This option requires ${YprofileEnabled.name}. The output file can be visualized using https://ui.perfetto.dev/.", "", depends =List(YprofileEnabled->true))
// Scala 2 compiler backport of https://github.com/scala/scala/pull/7364
2
+
/*
3
+
* Scala (https://www.scala-lang.org)
4
+
*
5
+
* Copyright EPFL and Lightbend, Inc.
6
+
*
7
+
* Licensed under Apache License 2.0
8
+
* (http://www.apache.org/licenses/LICENSE-2.0).
9
+
*
10
+
* See the NOTICE file distributed with this work for
11
+
* additional information regarding copyright ownership.
12
+
*/
13
+
14
+
packagedotty.tools.dotc.profile
15
+
16
+
importscala.language.unsafeNulls
17
+
18
+
importjava.io.Closeable
19
+
importjava.lang.management.ManagementFactory
20
+
importjava.nio.file.{Files, Path}
21
+
importjava.util
22
+
importjava.util.concurrent.TimeUnit
23
+
24
+
importscala.collection.mutable
25
+
26
+
objectChromeTrace {
27
+
privateobjectEventType {
28
+
finalvalStart="B"
29
+
finalvalInstant="I"
30
+
finalvalEnd="E"
31
+
finalvalComplete="X"
32
+
33
+
finalvalCounter="C"
34
+
35
+
finalvalAsyncStart="b"
36
+
finalvalAsyncInstant="n"
37
+
finalvalAsyncEnd="e"
38
+
}
39
+
}
40
+
41
+
/** Allows writing a subset of captrue traces based on https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview#
42
+
* Can be visualized using https://ui.perfetto.dev/, Chrome's about://tracing (outdated) or the tooling in https://www.google.com.au/search?q=catapult+tracing&oq=catapult+tracing+&aqs=chrome..69i57.3974j0j4&sourceid=chrome&ie=UTF-8 */
0 commit comments