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`
valYprofileDestination:Setting[String] =StringSetting(ForkSetting, "Yprofile-destination", "file", "Where to send profiling output - specify a file, default is to the console.", "")
valYprofileExternalTool:Setting[List[String]] =PhasesSetting(ForkSetting, "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(ForkSetting, "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(ForkSetting, "Yprofile-destination", "file", "Where to send profiling output - specify a file, default is to the console.", "", depends =List(YprofileEnabled->true))
445
+
valYprofileExternalTool:Setting[List[String]] =PhasesSetting(ForkSetting, "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))
446
+
valYprofileRunGcBetweenPhases:Setting[List[String]] =PhasesSetting(ForkSetting, "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))
447
+
valYprofileTrace:Setting[String] =StringSetting(ForkSetting, "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))
450
448
451
449
valYbestEffort:Setting[Boolean] =BooleanSetting(ForkSetting, "Ybest-effort", "Enable best-effort compilation attempting to produce betasty to the META-INF/best-effort directory, regardless of errors, as part of the pickler phase.")
452
450
valYwithBestEffortTasty:Setting[Boolean] =BooleanSetting(ForkSetting, "Ywith-best-effort-tasty", "Allow to compile using best-effort tasty files. If such file is used, the compiler will stop after the pickler phase.")
// 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