commit | 631e467325a191a92d2e9454dc9b0fe6e3f21f80 | [log] [tgz] |
---|---|---|
author | lberki <[email protected]> | Tue Jul 14 20:41:18 2020 +0200 |
committer | GitHub <[email protected]> | Tue Jul 14 11:41:18 2020 -0700 |
tree | c66c4d5b4859272d785064e8fa7e30e3f734e746 | |
parent | 06a798c4db92ec3a3a6b3a4b52026f002002affa [diff] |
Implement Makefile inclusion and variable assignment tracing (#203) Introduce value assignment tracing and include tracing. The `--dump_variable_assignment_trace <path>` command line option dumps the following data for every variable reference: * The stack trace of the variable reference * The stack trace where the value was assigned The `--dump_include_json <path>` option dumps the Makefile inclusion graph. If `<path>` is `-`, the output is dumped to stderr. If tracing is disabled, its CPU/RAM overhead is negligible according to rudimentary measurements. When enabled, it incurs a ~2x increase in memory use and a ~15x increase in execution time (dominated by I/O, since the output is quite wordy; without I/O it's ~10%) The variable assignment trace correctly reports: * Simply and recursively expanded variables * Regular and rule-specific variables * Automatic variables (although the call stack where their value is set is currently not indicated; this is fixable) Some example `jq` commands for the include graph: List of Makefiles including a specific one: ``` jq '.nodes[] | select((.includes | index("$MAKEFILE") != null)) | .file' ``` List of Makefiles included by a Makefile: ``` jq '.nodes[] | select(.file == "$MAKEFILE")' ``` List of all seen Makefiles: ``` jq '.nodes[].file' ```
kati is an experimental GNU make clone. The main goal of this tool is to speed-up incremental build of Android.
Currently, kati does not offer a faster build by itself. It instead converts your Makefile to a ninja file.
For Android-N+, ckati and ninja is used automatically. There is a prebuilt checked in under prebuilts/build-tools that is used.
All Android's build commands (m, mmm, mmma, etc.) should just work.