summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-03-15 08:11:16 +0300
committerSimon Glass <sjg@chromium.org>2021-03-27 05:04:31 +0300
commiteb26d88d55e6ed92214d98b81457ddcc743347a0 (patch)
tree897a8fb8e29bfd554e330ab1adfdc38c43f019be /common
parent05e3a0d64833763990303eaab117d8902c38470f (diff)
downloadu-boot-eb26d88d55e6ed92214d98b81457ddcc743347a0.tar.xz
bootstage: Warning if space is exhausted
At present bootstage silently ignores new records if it runs out of space. It is sometimes obvious by looking at the report, but the IDs are not contiguous, so it is easy to miss. Aad a message so that action can be taken. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/bootstage.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/common/bootstage.c b/common/bootstage.c
index 2c0110c263..4621105682 100644
--- a/common/bootstage.c
+++ b/common/bootstage.c
@@ -9,6 +9,8 @@
* permits accurate timestamping of each.
*/
+#define LOG_CATEGORY LOGC_BOOT
+
#include <common.h>
#include <bootstage.h>
#include <hang.h>
@@ -127,12 +129,16 @@ ulong bootstage_add_record(enum bootstage_id id, const char *name,
/* Only record the first event for each */
rec = find_id(data, id);
- if (!rec && data->rec_count < RECORD_COUNT) {
- rec = &data->record[data->rec_count++];
- rec->time_us = mark;
- rec->name = name;
- rec->flags = flags;
- rec->id = id;
+ if (!rec) {
+ if (data->rec_count < RECORD_COUNT) {
+ rec = &data->record[data->rec_count++];
+ rec->time_us = mark;
+ rec->name = name;
+ rec->flags = flags;
+ rec->id = id;
+ } else {
+ log_warning("Bootstage space exhasuted\n");
+ }
}
/* Tell the board about this progress */