Skip to content

Commit

Permalink
Include Bazel version information in profile metadata.
Browse files Browse the repository at this point in the history
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 #17562.

PiperOrigin-RevId: 511761823
Change-Id: I9c31494bfc07be898250d75821dd080e5b68b6db
  • Loading branch information
meisterT authored and copybara-github committed Feb 23, 2023
1 parent 88346f1 commit 7569b0d
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 @@ -34,6 +34,7 @@ java_library(
deps = [
":network_metrics_collector",
"//src/main/java/com/google/devtools/build/lib/actions:resource_estimator",
"//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 @@ -15,6 +15,7 @@


import com.google.common.base.Preconditions;
import com.google.devtools.build.lib.analysis.BlazeVersionInfo;
import com.google.devtools.build.lib.profiler.Profiler.TaskData;
import com.google.gson.stream.JsonWriter;
import java.io.BufferedOutputStream;
Expand Down Expand Up @@ -174,6 +175,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 7569b0d

Please sign in to comment.