Some tools usage to measure edk2 build performance - shijunjing/edk2 GitHub Wiki
-
Windows Performance Recorder (WPR) and Windows Performance Analyzer (WPA)
- Download and install the the Windows ADK from https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install
- Launch the Windows Performance Recorder as below:
- Start the recording and begin build a edk2 module, e.g. UsbBusDxe as below, at the same time.
- D:\Project\Edk2Git\workspace\edk2>build -t VS2015x86 -p OvmfPkg\OvmfPkgIa32X64.dsc -a IA32 -a X64 -b DEBUG -m MdeModulePkg\Bus\Usb\UsbBusDxe\UsbBusDxe.inf
-
Stop the WPR recording after the module build finish. After WPR saving the tracing info, click the Open in WPA button:
-
In the Windows Performance Analyzer (WPA) window, there are many different metrics info about the edk2 module building. A useful metric is the System Activity->Processes Lifetime By Process. Right click the "Processes Lifetime By Process" metric item and select "Add graph to New Analysis View":
-
In the New Analysis, click the Processes View Editor, and select the Process Name, Process Tree, Command Line, and others you are interested:
-
In the "Process", "Process Tree", "Duration(s)" and "Command Line" column, you can see how the different build command or tools are invoked and how fast or slow they are:
Below is a example for llvm linker invoked by windows clang.exe in the process tree and running duration:
-
Vtune
Vtune can also profiles the system-level process/threads. You need configure Vtune as "Local Host" and "Profile System":