From 03ecac314988c01c3df0c935afaacc8fce229224 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 22 May 2017 05:05:27 -0600 Subject: bootstage: Use rec_count as the array index At present bootstage has a large array with all possible bootstage IDs recorded. It adds times to the array element indexed by the ID. This is inefficient because many IDs are not used during boot. We can save space by only recording those IDs which actually have timestamps. Update the array to use a record count, which increments with each addition of a new timestamp. This takes longer to record a time, since it may involve an array search. Such a search may be particularly expensive before relocation when the CPU is running slowly or the cache is off. But at that stage there should be very few records. Signed-off-by: Simon Glass --- common/Kconfig | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'common/Kconfig') diff --git a/common/Kconfig b/common/Kconfig index 3b85bf49a8..a3094d984f 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -46,6 +46,13 @@ config BOOTSTAGE_USER_COUNT a new ID will be allocated from this stash. If you exceed the limit, recording will stop. +config BOOTSTAGE_RECORD_COUNT + int "Number of boot stage records to store" + default 30 + help + This is the size of the bootstage record list and is the maximum + number of bootstage records that can be recorded. + config BOOTSTAGE_FDT bool "Store boot timing information in the OS device tree" depends on BOOTSTAGE -- cgit v1.2.3