Re: [PATCH V6 2/3] soc: qcom: boot_stat: Add Driver Support for Boot Stats

From: Trilok Soni
Date: Thu May 11 2023 - 13:12:18 EST


On 5/11/2023 10:07 AM, Bjorn Andersson wrote:
On Tue, May 09, 2023 at 03:52:22AM -0700, Souradeep Chowdhury wrote:
All of Qualcomm's proprietary Android boot-loaders capture boot time
stats, like the time when the bootloader started execution and at what
point the bootloader handed over control to the kernel etc. in the IMEM
region. This information is captured in a specific format by this driver
by mapping a structure to the IMEM memory region and then accessing the
members of the structure to show the information within debugfs file.
This information is useful in verifying if the existing boot KPIs have
regressed or not. The information is shown in milliseconds, a sample
log from sm8450(waipio) device is as follows:-

/sys/kernel/debug/qcom_boot_stats # cat abl_time
17898 ms
/sys/kernel/debug/qcom_boot_stats # cat pre_abl_time
2879 ms

The Module Power Manager(MPM) sleep counter starts ticking at the PBL
stage and the timestamp generated by the sleep counter is logged by
the Qualcomm proprietary bootloader(ABL) at two points-> First when it
starts execution which is logged here as "pre_abl_time" and the second
when it is about to load the kernel logged as "abl_time". Documentation
details are also added in Documentation/ABI/testing/debugfs-driver-bootstat


I would have preferred some way to implement this without spending
countless kB of RAM to occasionally read out two u32 values...

If this is just for the debug build, why we are caring of it. There are various others kernel features we enable to debug the system crashes which consumes lot of RAM as well. Optimizations are good, but not sure
if we need to overdo it when it is just for debugging.

---Trilok Soni