Introduction

Understanding the call graph of a build or a function call within a build can be a bit difficult. Even if you have a CacheIndex and PrimaryKey to start with, finding the call graph relationships between different entries requires searching through the GraphLog. While this can be done with the output of PrintGraphLog, it's time-consuming and difficult to understand because the graph log contains no human-readable information about what a cache entry represents.

PrintCallGraph is a new utility that makes searching through the call graph stored in the cache easier. (It's not yet in official but can be found in the branch cache/64.PrintCallGraph.) There are three ways it allows you to search the graph log:

Unfortunately, PrintCallGraph can use a lot of memory. It needs to essentially read the entire graph log into memory (unlike PrintGraphLog which simply prints each entry after reading it). For that reason it provides a feature to tell you how much memory it used. Just add "--mem" to the command line.

Examples

Searching by top-level model, showing an incomplete build:

Searching by cache index:

Searching by derived file: