Add benchmark for full analysis.
Instead of touching an Android.bp file, delete the ninja files. The
other 'android_bp' benchmark adds a comment to the ninja file, which
hits the opimization that doesn't make kati rerun.
Bug: 399467514
Test: build/make/tools/perf/benchmarks --benchmark full_analysis
Change-Id: I47d852add5d714d7edea7ba5e7dbbeac75b07a74
diff --git a/tools/perf/benchmarks b/tools/perf/benchmarks
index 8cb26c8..38715ea 100755
--- a/tools/perf/benchmarks
+++ b/tools/perf/benchmarks
@@ -202,6 +202,16 @@
return Change(label="Remove out", change=remove_out, undo=lambda: None)
+def CleanNinja():
+ """Remove the out directory, and then run lunch to initialize soong"""
+ def clean_ninja():
+ returncode = subprocess.call("rm out/*.ninja out/soong/*.ninja", shell=True)
+ if returncode != 0:
+ report_error(f"Build failed: {' '.join(cmd)}")
+ raise FatalError()
+ return Change(label="Remove ninja files", change=clean_ninja, undo=lambda: None)
+
+
def NoChange():
"""No change to the source tree."""
return Change(label="No change", change=lambda: None, undo=lambda: None)
@@ -416,7 +426,7 @@
"""Builds the modules. Saves interesting log files to log_dir. Raises FatalError
if the build fails.
"""
- sys.stderr.write(f"STARTING BUILD {benchmark.build_description()}\n")
+ sys.stderr.write(f"STARTING BUILD {benchmark.build_description()} Logs to: {build_log_dir}\n")
before_ns = time.perf_counter_ns()
if not self._options.DryRun():
@@ -713,6 +723,13 @@
preroll=1,
postroll=3,
),
+ Benchmark(id="full_analysis",
+ title="Full Analysis",
+ change=CleanNinja(),
+ modules=["nothing"],
+ preroll=1,
+ postroll=3,
+ ),
Benchmark(id="modify_stdio",
title="Modify stdio.cpp",
change=Modify("bionic/libc/stdio/stdio.cpp", Comment("//")),