Skip to contentSkip to conversation

bootstage: Dont print reset entry separately

PATCH New Michal Simek 2 participants 5 messages May 30, 2017 – Jun 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 bootstage: Dont print reset entry separately

From: Siva Durga Prasad Paladugu <[email protected]>

Printing the first entry reset separately is no longer needed as it now prints the entries with valid name and timestamp zero. This removes duplicate printing of the reset record.

---

 common/bootstage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/bootstage.c +1 -1
index 35bce3d881a5..c8080dcab5d7 100644
@@ -271,7 +271,7 @@ void bootstage_report(void)
 	/* Fake the first record - we could get it from early boot */
 	rec->name = "reset";
 	rec->time_us = 0;
-	prev = print_time_record(BOOTSTAGE_ID_AWAKE, rec, 0);
+	prev = 0;
 
 	/* Sort records by increasing time */
 	qsort(record, ARRAY_SIZE(record), sizeof(*rec), h_compare_record);
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/3 bootstage: print all entries even if recorded time is zero

From: Siva Durga Prasad Paladugu <[email protected]>

Print all entries in boot stage report even if the recorded time stamp is zero. This lets the user to know all the recorded entries that are made into. This helps user to know if something went wrong with timestamp for that entry.

---

 common/bootstage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/bootstage.c +1 -1
index c8080dcab5d7..bca74cd207fc 100644
@@ -277,7 +277,7 @@ void bootstage_report(void)
 	qsort(record, ARRAY_SIZE(record), sizeof(*rec), h_compare_record);
 
 	for (id = 0; id < BOOTSTAGE_ID_COUNT; id++, rec++) {
-		if (rec->time_us != 0 && !rec->start_us)
+		if ((rec->time_us != 0 && !rec->start_us) || rec->name)
 			prev = print_time_record(rec->id, rec, prev);
 	}
 	if (next_id > BOOTSTAGE_ID_COUNT)
Signature · 1 line
1.9.1
#2 lore raw

PATCH 3/3 bootstage: Modify routine timer_get_boot_us()

In reply to Michal Simek

From: Siva Durga Prasad Paladugu <[email protected]>

Modify routine timer_get_boot_us(), as the base_time will be stored in bss if initialized to zero(observed for arm compilers, arm and arm64) and for most of the boards bss was not initialized to zero before relocation and hence causing a junk timestamp value in boot record if there is an entry record before relocation(example would be board_init_f entry). Also, as it is in bss which will be intialized to zero after relocation, it causes the first entry after relocation to be missed while printing bootstage report as the timer_get_boot_us() returns zero if bss_time is zero. This patch fixes the same by initialzing bss_time to 1 and also returning current timestamp if bss_time is 1. Intializing it to 1 causes it to be placed in data section and hence no issues.

Before this patch:
ZynqMP> bootstage report
Timer summary in microseconds:

       Mark    Elapsed  Stage
          0          0  reset
    491,000    491,000  id=64
    516,000     25,000  id=65
    522,000      6,000  main_loop

112,092,989,575,347,436,48112,092,989,575,342,216,48 board_init_f

After this patch:
ZynqMP> bootstage report
Timer summary in microseconds:

       Mark    Elapsed  Stage
          0          0  reset
      9,969      9,969  board_init_f
  1,227,000  1,217,031  board_init_r
  1,713,000    486,000  id=64
  1,733,000     20,000  id=65
  1,735,000      2,000  main_loop

---

 common/bootstage.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
common/bootstage.c +6 -4
index bca74cd207fc..b65345c28105 100644
@@ -294,16 +294,18 @@ void bootstage_report(void)
 
 ulong __timer_get_boot_us(void)
 {
-	static ulong base_time;
+	static ulong base_time = 1;
 
 	/*
 	 * We can't implement this properly. Return 0 on the first call and
 	 * larger values after that.
 	 */
-	if (base_time)
+	if (base_time != 1)
 		return get_timer(base_time) * 1000;
-	base_time = get_timer(0);
-	return 0;
+	else
+		base_time = get_timer(0);
+
+	return base_time;
 }
 
 ulong timer_get_boot_us(void)
Signature · 1 line
1.9.1
#3 lore raw

PATCH 1/3 bootstage: Dont print reset entry separately

In reply to Michal Simek
Quoted 9 lines · Michal Simek

From: Siva Durga Prasad Paladugu <[email protected]>

Printing the first entry reset separately is no longer needed as it now prints the entries with valid name and timestamp zero. This removes duplicate printing of the reset record.

Can you please rebase this and the rest of the series on top of master again? And please cc Simon when you repost, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170608/b5a4f827/attachment.sig>
#4 lore raw

PATCH 1/3 bootstage: Dont print reset entry separately

Quoted 9 lines · Tom Rini
Quoted 7 lines · Michal Simek

From: Siva Durga Prasad Paladugu <[email protected]>

Printing the first entry reset separately is no longer needed as it now prints the entries with valid name and timestamp zero. This removes duplicate printing of the reset record.

Quoted 6 lines
Quoted 2 lines

Can you please rebase this and the rest of the series on top of master again? And please cc Simon when you repost, thanks!

There are new patches from Simon. Siva will look at it and try to validate them on our platforms.

Thanks,
Michal