[U-Boot] [PATCH 00/15] bootstage: Update to support early malloc() and SPL

Simon Glass sjg at chromium.org
Mon May 22 11:05:21 UTC 2017


The bootstage feature is useful for timing booting of a board, both for
debugging and for production. On ARM devices, detailed timing information
can be passed to Linux (where for example it could be logged or reported
to a connected server).

Bootstage was written before early malloc(). At present bootstage uses the
data section and a large block of memory, which is not ideal. Also it does
not support SPL.

This series revamps bootstage. It allows a full timing trace to be
collected from SPL through to booting Linux, for example:

       Mark    Elapsed  Stage
          0          0  reset
  2,809,110  2,809,110  spl
  2,824,791     15,681  end_spl
  2,879,616     54,825  board_init_f
  3,180,834    301,218  board_init_r
  3,496,057    315,223  id=64
  3,497,957      1,900  id=64
  3,497,959          2  main_loop

Accumulated time:
                   723  dm_r
                 3,763  of_live
                 8,027  dm_spl
               120,731  dm_f
               168,207  lcd


Simon Glass (15):
  bootstage: Provide a default timer function
  bootstage: Require timer_get_boot_us() to be defined
  bootstage: Change CONFIG_BOOTSTAGE_USER_COUNT to an int
  bootstage: Convert to use malloc()
  bootstage: Fix up code style and comments
  bootstage: Use rec_count as the array index
  bootstage: Show records with a zero time
  bootstage: Use debug() for stashing messages
  bootstage: Support relocating boostage data
  bootstage: Init as early as possible
  bootstage: Record the time taken to set up driver model
  bootstage: Tidy up error return values
  bootstage: Adjust to use const * where possible
  bootstage: Support SPL
  bootstage: Record time taken to set up the live device tree

 arch/sandbox/cpu/cpu.c             |  11 ++
 common/Kconfig                     |  18 ++-
 common/Makefile                    |   3 +-
 common/board_f.c                   |  61 ++++++++-
 common/board_r.c                   |  16 ++-
 common/bootstage.c                 | 257 ++++++++++++++++++++++---------------
 common/spl/spl.c                   |  18 +++
 configs/sandbox_defconfig          |   2 +-
 configs/sandbox_flattree_defconfig |   2 +-
 configs/sandbox_noblk_defconfig    |   2 +-
 configs/sandbox_spl_defconfig      |   2 +-
 include/asm-generic/global_data.h  |   4 +
 include/bootstage.h                |  62 +++++++--
 lib/time.c                         |  17 +++
 14 files changed, 349 insertions(+), 126 deletions(-)

-- 
2.13.0.303.g4ebf302169-goog



More information about the U-Boot mailing list