Some tools usage to measure edk2 build performance - shijunjing/edk2 GitHub Wiki

  • Windows Performance Recorder (WPR) and Windows Performance Analyzer (WPA)

  1. Download and install the the Windows ADK from https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install
  2. Launch the Windows Performance Recorder as below: Windows Performance Recorder (WPR) picture
  3. 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
  1. Stop the WPR recording after the module build finish. After WPR saving the tracing info, click the Open in WPA button: https://github.com/shijunjing/WikiDoc/blob/master/WindowsADK/WPR2.jpg

  2. 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":

https://github.com/shijunjing/WikiDoc/blob/master/WindowsADK/WPA1.jpg

  1. In the New Analysis, click the Processes View Editor, and select the Process Name, Process Tree, Command Line, and others you are interested: https://github.com/shijunjing/WikiDoc/blob/master/WindowsADK/WPA2.jpg

  2. 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: https://github.com/shijunjing/WikiDoc/blob/master/WindowsADK/WPA3.jpg

Below is a example for llvm linker invoked by windows clang.exe in the process tree and running duration: https://github.com/shijunjing/WikiDoc/blob/master/WindowsADK/WPA4.jpg

  • Vtune

Vtune can also profiles the system-level process/threads. You need configure Vtune as "Local Host" and "Profile System": https://github.com/shijunjing/WikiDoc/blob/master/Vtune/vtune1.jpg