Boot Profiler Utility

Boot Profiler is a group of utilities that capture timing information at predefined profiling points from the beginning of the boot loader, through kernel loading, initialization, and startup. Profiling points can be defined in subsequent scripts.
Boot Profile timing information is taken from the monotonic microsecond counter in the CPU.
Boot Profiler includes these utilities:
io-nvbootprofiler
bootprofiler
bootprofiler_get_results
These utilities are located on the host at:
<top>/drive-t186ref-qnx/nvidia-bsp
Prerequisites
Boot loaders must be built with the correct flags to enable Boot Profiler. The bootloader is built with the flags on, by default.
The io-nvbootprofiler module must be loaded for bootprofiler and bootprofiler_get_results utilities to function correctly. io‑nvbootprofiler is a resource manager, similar to a Linux daemon. The bootprofiler and bootprofiler_get_results utilities communicate with the daemon to share information.

Enabling Boot Profiler

By default, boot profiler is disabled in the PCT.
To enable Tegra Boot Profiler
1. Change the PCT configuration.
In platform_config.h for the given PCT, in the struct
platform_conf plat_cfg, add:
.enable_boot_profiler = 1

Launching the Boot Profiler Daemon

The io-nvbootprofiler is the daemon that collects the boot timestamps from the bootloaders. It allows the software, that is running on QNX, to add more profile points. The io-nvbootprofiler daemon is loaded during the early stages of QNX boot, in the default IFS.
To start the boot profiler daemon
Execute the command:
# io-nvbootprofiler -u <uid:gid>
Where <uid:gid> are non-zero user and group IDs.

Obtaining Boot Profiler Results

Once the system is running, use bootprofiler_get_results to see the captured profiling points. The syntax is:
bootprofiler_get_results <filename>
If <filename> is NOT provided, the io-nvbootprofiler prints the boot profiler result on the console.
If <filename> is provided:
If the file does NOT exist, the bootprofiler_get_results creates the file so that all users and groups can read and write to it and pass the name to the io-nvbootprofiler which then prints the bootprofiler data on the file.
If the file exists, it must allow users and groups to read and write from it or explicitly allow the user and group ID of the io-nvbootprofiler to read and write to it. Users and group IDs of io-nvbootprofiler can be identified using the pidin utility.
The bootprofiler_get_results utility produces output similar to the following example:
# bootprofiler_get_results
-------------------------------------------------------------
Profiling Point - Name Profile time Del_prv Del_st
-------------------------------------------------------------
 
pl: EL1 Init TS 1933071 -- --
pl: CacheFlush 1933192 121 --
pl: PreMMUInit 1933330 138 --
pl: MMU Init 1933715 385 --
pl: Driver Init 1933831 116 --
pl: DT Init 1949312 15481 --
pl: PT Init 1952002 2690 --
pl: Kernel Handoff 1954849 2847 --
osl: EL1 Init TS 1954947 98 --
osl: CacheFlush 1955025 78 --
osl: PreMMUInit 1955614 589 --
osl: MMU Init 1956122 508 --
osl: Driver Init 1956252 130 --
osl: DT Init 1957096 844 --
osl: PT Init 1959461 2365 --
osl: LoadKernel 2041552 82091 --
osl: LoadDTB 2043162 1610 --
osl: KernelEnv Setup 2061748 18586 --
osl: Kernel Handoff 2061846 98 --
Start_Profiler 2405441 343595 --
+StartupIFS 2410894 5453 --
NvSplash ready 8669924 6259030 --
-StartupIFS 10272990 1603066 7862096
#
 
The columns in the Boot Profiler report are as follows:
Column Name
Description
Profiling Point - Name
Name of the profiling point.
Profile time
Microsecond counter at the profiling point. The counter starts when the CPU leaves reset state.
Del_prv
Delay from the previous profiling point.
Del_st
Delay from the start of the profiling section. A profiling section starts when a "+" is prefixed to the profiling point name, and ends when the same name is used, prefixed with "-".
The example output reports the following information:
MB1 starts 15,404 microseconds after the CPU leaves reset state. This is the time it takes to load and execute MB1.
BPMP firmware is loaded at 907,705 microseconds.
Kernel loading begins at 1,401,885 microseconds.
Total time spent in the IFS startup script is 7,862,096 microseconds.

Adding Profiling Points to bootprofiler

To create an additional profiling point, add the bootprofiler command to a script. The syntax is:
$ bootprofiler <profiling_point_name>
bootprofiler tells io-nvbootprofiler to capture a new profiling point and associate it with the specified profiling point name.