Procházet zdrojové kódy

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>
Simon Glass před 3 roky
rodič
revize
eb26d88d55
1 změnil soubory, kde provedl 12 přidání a 6 odebrání
  1. 12 6
      common/bootstage.c

+ 12 - 6
common/bootstage.c

@@ -9,6 +9,8 @@
  * permits accurate timestamping of each.
  * permits accurate timestamping of each.
  */
  */
 
 
+#define LOG_CATEGORY	LOGC_BOOT
+
 #include <common.h>
 #include <common.h>
 #include <bootstage.h>
 #include <bootstage.h>
 #include <hang.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 */
 	/* Only record the first event for each */
 	rec = find_id(data, id);
 	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 */
 	/* Tell the board about this progress */