Add --ninja_weight_source option
It has 3 options for now.
* ninja_log: uses ninja log file for data source
* evenly_distributed: pass empty list for ninja to consider every work as the same
* not_used: do not use critical path logic in ninja
In addition, I added the option in the metrics to track
Bug: 271527305
Test: m --ninja_weight_source=ninja_log|empty|not_used
Change-Id: Ib4c812c20606a34b17d3f0edb71057b477c4f90e
diff --git a/ui/build/config_test.go b/ui/build/config_test.go
index 1749cd4..bedb181 100644
--- a/ui/build/config_test.go
+++ b/ui/build/config_test.go
@@ -1032,6 +1032,7 @@
UseRbe: proto.Bool(false),
BazelMixedBuild: proto.Bool(false),
ForceDisableBazelMixedBuild: proto.Bool(false),
+ NinjaWeightListSource: smpb.NinjaWeightListSource_NOT_USED.Enum(),
},
},
{
@@ -1043,6 +1044,7 @@
UseRbe: proto.Bool(false),
BazelMixedBuild: proto.Bool(false),
ForceDisableBazelMixedBuild: proto.Bool(false),
+ NinjaWeightListSource: smpb.NinjaWeightListSource_NOT_USED.Enum(),
},
},
{
@@ -1054,6 +1056,7 @@
UseRbe: proto.Bool(false),
BazelMixedBuild: proto.Bool(false),
ForceDisableBazelMixedBuild: proto.Bool(false),
+ NinjaWeightListSource: smpb.NinjaWeightListSource_NOT_USED.Enum(),
},
},
{
@@ -1065,6 +1068,7 @@
UseRbe: proto.Bool(true),
BazelMixedBuild: proto.Bool(false),
ForceDisableBazelMixedBuild: proto.Bool(false),
+ NinjaWeightListSource: smpb.NinjaWeightListSource_NOT_USED.Enum(),
},
},
{
@@ -1076,6 +1080,7 @@
UseRbe: proto.Bool(false),
BazelMixedBuild: proto.Bool(false),
ForceDisableBazelMixedBuild: proto.Bool(true),
+ NinjaWeightListSource: smpb.NinjaWeightListSource_NOT_USED.Enum(),
},
},
{
@@ -1088,6 +1093,7 @@
UseRbe: proto.Bool(false),
BazelMixedBuild: proto.Bool(false),
ForceDisableBazelMixedBuild: proto.Bool(false),
+ NinjaWeightListSource: smpb.NinjaWeightListSource_NOT_USED.Enum(),
},
},
{
@@ -1100,6 +1106,7 @@
UseRbe: proto.Bool(false),
BazelMixedBuild: proto.Bool(true),
ForceDisableBazelMixedBuild: proto.Bool(false),
+ NinjaWeightListSource: smpb.NinjaWeightListSource_NOT_USED.Enum(),
},
},
{
@@ -1112,6 +1119,7 @@
UseRbe: proto.Bool(false),
BazelMixedBuild: proto.Bool(true),
ForceDisableBazelMixedBuild: proto.Bool(false),
+ NinjaWeightListSource: smpb.NinjaWeightListSource_NOT_USED.Enum(),
},
},
{
@@ -1124,6 +1132,7 @@
UseRbe: proto.Bool(false),
BazelMixedBuild: proto.Bool(true),
ForceDisableBazelMixedBuild: proto.Bool(false),
+ NinjaWeightListSource: smpb.NinjaWeightListSource_NOT_USED.Enum(),
},
},
{
@@ -1138,6 +1147,7 @@
BazelMixedBuild: proto.Bool(false),
Targets: []string{"droid", "dist"},
ForceDisableBazelMixedBuild: proto.Bool(false),
+ NinjaWeightListSource: smpb.NinjaWeightListSource_NOT_USED.Enum(),
},
},
{
@@ -1156,6 +1166,7 @@
UseRbe: proto.Bool(true),
BazelMixedBuild: proto.Bool(true),
ForceDisableBazelMixedBuild: proto.Bool(true),
+ NinjaWeightListSource: smpb.NinjaWeightListSource_NOT_USED.Enum(),
},
},
}