From bbe9a4a4a9376cd6dd5ca353c628a7329bf5b28c Mon Sep 17 00:00:00 2001 From: Tobias Werth Date: Tue, 28 Feb 2023 13:37:51 +0100 Subject: [PATCH] Include Bazel version information in profile metadata. This is basically the same as https://github.com/bazelbuild/bazel/pull/17562/files before we did the JSON trace profile refactoring. --- src/main/java/com/google/devtools/build/lib/profiler/BUILD | 1 + .../java/com/google/devtools/build/lib/profiler/Profiler.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/main/java/com/google/devtools/build/lib/profiler/BUILD b/src/main/java/com/google/devtools/build/lib/profiler/BUILD index a4e809d91c7b05..f96f7c368c1da8 100644 --- a/src/main/java/com/google/devtools/build/lib/profiler/BUILD +++ b/src/main/java/com/google/devtools/build/lib/profiler/BUILD @@ -27,6 +27,7 @@ java_library( ], deps = [ ":network_metrics_collector", + "//src/main/java/com/google/devtools/build/lib/analysis:blaze_version_info", "//src/main/java/com/google/devtools/build/lib/bugreport", "//src/main/java/com/google/devtools/build/lib/clock", "//src/main/java/com/google/devtools/build/lib/collect:extrema", diff --git a/src/main/java/com/google/devtools/build/lib/profiler/Profiler.java b/src/main/java/com/google/devtools/build/lib/profiler/Profiler.java index 6de964f514ed24..a99ed7e4bc93f2 100644 --- a/src/main/java/com/google/devtools/build/lib/profiler/Profiler.java +++ b/src/main/java/com/google/devtools/build/lib/profiler/Profiler.java @@ -21,6 +21,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; +import com.google.devtools.build.lib.analysis.BlazeVersionInfo; import com.google.devtools.build.lib.bugreport.BugReporter; import com.google.devtools.build.lib.clock.Clock; import com.google.devtools.build.lib.collect.Extrema; @@ -1088,6 +1089,7 @@ public void run() { writer.beginObject(); writer.name("otherData"); writer.beginObject(); + writer.name("bazel_version").value(BlazeVersionInfo.instance().getReleaseName()); writer.name("build_id").value(buildID.toString()); writer.name("output_base").value(outputBase); writer.name("date").value(new Date().toString());