For automated use (e.g. in CI), use main.py. See its help with main.py --help. Note that metrics collection relies on printproto and jq tools being on $PATH.
The most basic invocation, e.g. ./incremental_build.py libc, is logically equivalent to
m --skip-soong-tests libc and then$OUTDIR/soong_metrics and $OUTDIR/bp2build_metrics.pb filesout/timing_logs/summary.csvThere are a number of CUJs set up in cuj_catalog.py and they are run sequentially, such that each row in summary.csv are the timings of various " events" during an incremental build.
You may also add rows to summary.csv after a manual run, using perf_metrics.py script. This is particularly useful when you don't want to modify cuj_catalog.py for one-off tests.
Currently:
For CI, we should: