Skip to content

Commit

Permalink
Include Bazel version information in profile metadata. (bazelbuild#17616
Browse files Browse the repository at this point in the history
)

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
  • Loading branch information
meisterT authored Feb 28, 2023
1 parent 546e9e2 commit 7e328bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/com/google/devtools/build/lib/profiler/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 7e328bb

Please sign in to comment.