Template:Glsdk soc performance boot time build and measure

Boot time measurement
To collect boot time benchmark information for use with the visualization tool, kernel and u-boot need to be patched. The patches include changes to timestamp u-boot and  execution at various points and supply the information via the device tree.

Please apply the below patches in ascending order on kernel and u-boot.

Once the kernel and u-boot are built and the file system is updated, the EVM needs to be setup for single stage boot. In single stage boot,  directly loads kernel instead of loading u-boot. This speeds up the boot process by at least a second and allows passing benchmarking information from  to kernel via device tree.

To get started with single stage boot, create a  file from   using the below or appropriate command.

host $ mkimage -A arm -O linux -C none -T kernel -a 0x80008000 -e 0x80008000 -n 'Linux uImage' -d zImage uImage Choose the right device tree for your platform based on the hardware setup. Please refer to Choosing the right device tree for more details. Update the location of the root filesystem in the bootargs field in the device tree. This can be done from the  build or post the build by using the   tool as below.

host $ fdtput dra7-evm-lcd10.dtb &quot;/chosen&quot; &quot;bootargs&quot; \ console=ttyS0,115200n8 elevator=noop root=/dev/mmcblk0p2 rw rootwait fixrtc \ omapdrm.num_crtc=2 consoleblank=0 cma=64M rootfstype=ext4 loglevel=0 For SD boot, place the,  ,   and the device tree on the FAT partition of the SD card. When copying the device tree, please save it as  on the FAT partition of the SD card. only looks for the device tree file by this name in single stage boot irrespective of the processor variant or EVM setup.

For eMMC boot, place the,  ,   and the device tree on the FAT partition of the eMMC card. When copying the device tree, please save it as  on the FAT partition of the eMMC. only looks for the device tree file by this name in single stage boot irrespective of the processor variant or EVM setup.

For QSPI boot, follow the flashing instructions as specified in Using QSPI Boot.

After flashing the binaries, switch the EVM to single stage boot mode by changing the SYSBOOT settings.

Reboot the EVM. You will notice  skipping U-Boot and loading   directly. After the boot is complete, the following nodes are visible in the  directory on the target.

root@dra7xx-evm:/proc/device-tree/chosen# ls bootargs                m-dsp1start-time         m-spi-init-dur k-cust-machine-dur      m-dsp2start-time         mmc1_pinctl4_iodelay k-hwmod-dur             m-entry-time             mmc1_pinctl5_iodelay k-mm-init-dur           m-heap-init-dur          mmc2_pinctl2_iodelay k-rest-init-time        m-image-load-dur         mmc2_pinctl3_iodelay k-start-time            m-ipu1start-time         mmc4_pinctl0_iodelay k-user-space-entry-time m-ipu2start-time         mmc4_pinctl1_iodelay m-boardinit-time        m-kernelstart-time       name m-display-time          m-mmc-init-dur The prefix of the node names indicates the stage of execution at which the measurement was made.

The suffix indicates whether the measurement is a time stamp or a duration measurement.

All the measurements are reported in ticks of the 32 KHz timer. One tick is equal to 30.5 us. The value assigned to the device tree node can be read as a 32 bit big endian integer.

To convert the measurements to milliseconds, please run the  utility included in the filesystem. This reads each measurement in the device tree nodes, converts it into milliseconds and stores the output in a text file of the same name under. The script  included in the target file system can be used to easily print these times. Please see the example below.

target # readproc;list-boot-times.sh m-entry-time,339 m-boardinit-time,440 m-heap-init-dur,0 m-image-load-dur,272 m-mmc-init-dur,85 m-kernelstart-time,802

k-start-time,1009 k-cust-machine-dur,86 k-hwmod-dur,202 k-mm-init-dur,203 k-rest-init-time,1317 k-user-space-entry-time,5619

The above shows  entry at 339 ms, MLO calling the   entry point at 800 ms. execution starts at 1009 ms after it decompresses itself. mounts file system and jumps to user space at 5619 ms. MMC initialization in  takes 85 ms.

The script  only prints the measurements on the terminal. The measurements can be displayed in the performance monitor tool using the sample script.

target # readproc;sh send_boot_times_to_monitor.sh