Skip to content

Commit 7e328bb

Browse files
authored
Include Bazel version information in profile metadata. (bazelbuild#17616)
This is basically the same as https://github.com/bazelbuild/bazel/pull/17562/files before we did the JSON trace profile refactoring. --- This is helpful when building tools on top of the JSON profile which might to need to distinguish with what Bazel version the profile was written to be able to parse or interpret it correctly. Closes bazelbuild#17562. PiperOrigin-RevId: 511761823 Change-Id: I9c31494bfc07be898250d75821dd080e5b68b6db
1 parent 546e9e2 commit 7e328bb

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/main/java/com/google/devtools/build/lib/profiler/BUILD

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ java_library(
2727
],
2828
deps = [
2929
":network_metrics_collector",
30+
"//src/main/java/com/google/devtools/build/lib/analysis:blaze_version_info",
3031
"//src/main/java/com/google/devtools/build/lib/bugreport",
3132
"//src/main/java/com/google/devtools/build/lib/clock",
3233
"//src/main/java/com/google/devtools/build/lib/collect:extrema",

src/main/java/com/google/devtools/build/lib/profiler/Profiler.java

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.google.common.collect.ImmutableList;
2222
import com.google.common.collect.ImmutableSet;
2323
import com.google.common.collect.Iterables;
24+
import com.google.devtools.build.lib.analysis.BlazeVersionInfo;
2425
import com.google.devtools.build.lib.bugreport.BugReporter;
2526
import com.google.devtools.build.lib.clock.Clock;
2627
import com.google.devtools.build.lib.collect.Extrema;
@@ -1088,6 +1089,7 @@ public void run() {
10881089
writer.beginObject();
10891090
writer.name("otherData");
10901091
writer.beginObject();
1092+
writer.name("bazel_version").value(BlazeVersionInfo.instance().getReleaseName());
10911093
writer.name("build_id").value(buildID.toString());
10921094
writer.name("output_base").value(outputBase);
10931095
writer.name("date").value(new Date().toString());

0 commit comments

Comments
 (0)