Add option to add metadata to the JSON profile.
This will currently add the build ID, the output base and a date. This data is
accessible by clicking on the button labeled with 'M' in the Chrome Trace
Viewer.
The side effect is that the format of the profile changes from JSON array to
JSON object. See
https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview#
RELNOTES: None
PiperOrigin-RevId: 243071398
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java b/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java
index 0a1dccf..fb6c606 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/CommonCommandOptions.java
@@ -243,6 +243,16 @@
public boolean enableJsonProfileDiet;
@Option(
+ name = "experimental_json_profile_metadata",
+ defaultValue = "false",
+ documentationCategory = OptionDocumentationCategory.LOGGING,
+ effectTags = {OptionEffectTag.AFFECTS_OUTPUTS, OptionEffectTag.BAZEL_MONITORING},
+ help =
+ "Adds some metadata (e.g. build ID) to the JSON profile."
+ + " Changes output from JSON array to JSON object format.")
+ public boolean enableJsonMetadata;
+
+ @Option(
name = "profile",
defaultValue = "null",
documentationCategory = OptionDocumentationCategory.LOGGING,