The BuildXL build engine generates massive amounts of diagnostics data during the build and this data can be written to a BuildXL Execution Log. Thereafter, the data in the execution log can be used to gain insights into the build's internal structure and workings. You can use tools such as the Execution Analyzer to do a deeper analysis of the BuildXL run.
The BuildXL Execution Log is a binary file that stores the build execution data in a highly optimized disk space-efficient format. However, the amount of data stored in BuildXL execution logs for some larger builds can reach well into the GB, or even tens of GB range.
The BuildXL Execution Log is generated by the BuildXL build engine in the same folder as other BuildXL logs. It consists of two parts: one file with the extension XLG (i.e. BuildXL.1.xlg or BuildXL.xlg) and one folder in the same directory as the XLG file with the same as the name of the XLG file, but without the extension. The latter contains the graph files needed to load the execution logs.
The XLG file contains various events that have been captured during the build. These events include:
Event Type | Description |
---|---|
ExtraEventDataReported | Reports various build parameters. |
FileArtifactContentDecided | Reports the size and the content hash of the files that have been accessed during the build |
DirectoryMembershipHashed | Reports the list of files that were present in various directories that the build enumerated and the hash value that was generated based on the content of the files. |
ObservedInputs | Reports files that the build accessed where those files were not explicitly declared as a dependency.
PipExecutionPerformance | Reports various pip execution performance metrics. ProcessExecutionMonitoringReported | Reports performance data for all processes launched during the build, including process arguments and reported file accesses.
- The execution log folder contains:
- Pip data extracted from BuildXL spec files
- Build graph
- String table and path table with all strings/paths referenced by the build
There are several BuildXL command line arguments that control what is captured in the execution log and your build configuration may have one or more of these defaulted on.
BuildXL command line argument | Description |
---|---|
/logExecution | Instructs BuildXL to generate an execution log with the build. It is enabled by default. |
/logProcesses | Instructs BuildXL to include process details for all processes launched during the build. This option is required when ExecutionLogLoadOptions::LoadProcessMonitoringData is set. |
/logProcessData | Instructs BuildXL to include execution timings and IO operation details for all processes launched during the build. This option requires /logProcesses to also be specified. |
/logObservedFileAccesses | Instructs BuildXL to include all file accesses reported during the build. This option is required when ExecutionLogLoadOptions::LoadReportedFileAccesses is set. |
Specifying /logProcesses and especially /logObservedFileAccesses adds significant overhead to the build. /logProcesses logs the process Id and command line arguments for every process launched during the build. /logObservedFileAccesses logs every attempted file access and for larger builds there will be tens of millions of file accesses to log. When these options are enabled the size of the execution log will grow considerably and the larger size will affect the performance in load times and memory usage.
BuildXL execution logs are binary files that store serialized object data. It very is important that the same BuildXL binaries that generated the execution log are used to load data from it. The use of incompatible BuildXL binaries will result in an exception being thrown by the analyzer.