All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 0/21] Add tracing functionality to U-Boot
@ 2013-06-11 18:14 Simon Glass
  2013-06-11 18:14 ` [U-Boot] [PATCH v2 01/21] pci: Convert extern inline functions to static inline Simon Glass
                   ` (21 more replies)
  0 siblings, 22 replies; 41+ messages in thread
From: Simon Glass @ 2013-06-11 18:14 UTC (permalink / raw)
  To: u-boot

This series adds a tracing feature to U-Boot which is useful for
profiling boot time and other purposes.

The core trace library relies on standard gcc function instrumentation
and a microsecond timer which should work correctly on almost any
architecture. Generic board is used to avoid the need to add the same
code in multiple places (CONFIG_SYS_GENERIC_BOARD).

Tracing must be built into the U-Boot image at build time, but can be
paused and resumed while running. A trace buffer is used to collect
trace information. This buffer can then be transmitted to a host for
processing. A host-based processing tool is provided which converts the
data to the same format used by Linux, and that can be read by the
pytimechart GUI tool.

A U-Boot 'trace' command provides access to the trace information,
including support for writing it to memory in a few forms.

Support is provided for stopping tracing at the last possible moment in
the bootm process (just before U-Boot jumps to the OS). This is done with
a new 'fake go' command, which allows bootm to go through the motions of
an OS boot without actually committing to it. Once the 'fake go' is
complete, U-Boot can stop tracing and continue execution to transmit the
trace information to the host, before jumping to the OS for real.

The system is tested on sandbox, x86 and smdk5250/snow. It may work
correctly on Tegra and other machines but unfortunately has not been
tested. A simple test script is provided for sandbox, along with
documentation on how to use the feature.

This feature has been successfully used alongside bootstage to locate
bottlenecks and reduce overall boot time.

Changes in v2:
- Add cast to clarfy argument type on sandbox and x86
- Add new patch to convert PCI inline functions to static inline
- Add new patch to enable tracing on Exynos5
- Add new patch to enable tracing on coreboot
- Add new patch to fix FIT compile error for x86
- Add new patch to fix compiler warning in do_mem_loop()
- Add new patch to support tracing on x86
- Add notification that the trace test has passed
- Adjust printf() type to avoid warning on x86
- Change init sequence so that mon_len is set up before trace
- Fix bracket typo
- Fix missing BOOTM_STATE_OS_PREP in do_bootm()
- Fix tag to use : instead of ;
- Rebase on top of mainline
- Remove unneeded debug printf()s for non RFC version
- Update board_f support for new mainline relocaddr use

Simon Glass (21):
  pci: Convert extern inline functions to static inline
  x86: Correct missing local variable in bootm
  Fix missing return in do_mem_loop()
  Show stdout on error in fit-test
  bootstage: Correct printf types
  Add function to print a number with grouped digits
  Add trace library
  Add a trace command
  Support tracing in config.mk when enabled
  Add trace support to generic board
  Add proftool to decode profile data
  sandbox: Support trace feature
  Add a simple test for sandbox trace
  Clarify bootm OS arguments
  Refactor the bootm command to reduce code duplication
  Add a 'fake' go command to the bootm command
  arm: Implement the 'fake' go command
  exynos: Avoid function instrumentation for microsecond timer
  exynos: config: Add tracing options
  x86: Support tracing function
  x86: config: Add tracing options

 Makefile                               |   3 +-
 arch/arm/cpu/armv7/s5p-common/timer.c  |   2 +-
 arch/arm/include/asm/arch-exynos/cpu.h |  10 +-
 arch/arm/lib/bootm.c                   |  33 +-
 arch/microblaze/lib/bootm.c            |   4 +-
 arch/nios2/lib/bootm.c                 |   4 +-
 arch/openrisc/lib/bootm.c              |   4 +-
 arch/sandbox/cpu/cpu.c                 |   2 +-
 arch/sandbox/cpu/os.c                  |   2 +-
 arch/x86/include/asm/global_data.h     |   2 +-
 arch/x86/include/asm/msr.h             |   3 +-
 arch/x86/include/asm/u-boot-x86.h      |   2 +-
 arch/x86/lib/bootm.c                   |   2 +
 arch/x86/lib/gcc.c                     |   4 +-
 arch/x86/lib/tsc_timer.c               |   6 +-
 common/Makefile                        |   1 +
 common/board_f.c                       |  17 +-
 common/board_r.c                       |  11 +
 common/bootstage.c                     |  26 +-
 common/cmd_bootm.c                     | 514 ++++++++++++++-------------
 common/cmd_mem.c                       |   2 +
 common/cmd_trace.c                     | 133 +++++++
 common/image-fdt.c                     |  13 +-
 common/image.c                         |  22 +-
 config.mk                              |  11 +-
 doc/README.trace                       | 361 +++++++++++++++++++
 include/asm-generic/global_data.h      |   3 +
 include/common.h                       |   4 +
 include/configs/coreboot.h             |   7 +
 include/configs/exynos5250-dt.h        |   8 +
 include/configs/sandbox.h              |  13 +
 include/image.h                        |  17 +-
 include/pci.h                          |   4 +-
 include/trace.h                        | 125 +++++++
 include/vsprintf.h                     |  11 +
 lib/Makefile                           |   1 +
 lib/trace.c                            | 379 ++++++++++++++++++++
 lib/vsprintf.c                         |  16 +
 test/image/test-fit.py                 |  19 +-
 test/trace/test-trace.sh               |  89 +++++
 tools/.gitignore                       |   1 +
 tools/Makefile                         |   6 +
 tools/proftool.c                       | 611 +++++++++++++++++++++++++++++++++
 43 files changed, 2164 insertions(+), 344 deletions(-)
 create mode 100644 common/cmd_trace.c
 create mode 100644 doc/README.trace
 create mode 100644 include/trace.h
 create mode 100644 lib/trace.c
 create mode 100755 test/trace/test-trace.sh
 create mode 100644 tools/proftool.c

-- 
1.8.3

^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2013-06-28  7:57 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-11 18:14 [U-Boot] [PATCH v2 0/21] Add tracing functionality to U-Boot Simon Glass
2013-06-11 18:14 ` [U-Boot] [PATCH v2 01/21] pci: Convert extern inline functions to static inline Simon Glass
2013-06-11 18:14 ` [U-Boot] [PATCH v2 02/21] x86: Correct missing local variable in bootm Simon Glass
2013-06-11 18:14 ` [U-Boot] [PATCH v2 03/21] Fix missing return in do_mem_loop() Simon Glass
2013-06-11 18:14 ` [U-Boot] [PATCH v2 04/21] Show stdout on error in fit-test Simon Glass
2013-06-11 18:14 ` [U-Boot] [PATCH v2 05/21] bootstage: Correct printf types Simon Glass
2013-06-11 18:14 ` [U-Boot] [PATCH v2 06/21] Add function to print a number with grouped digits Simon Glass
2013-06-11 18:14 ` [U-Boot] [PATCH v2 07/21] Add trace library Simon Glass
2013-06-11 18:14 ` [U-Boot] [PATCH v2 08/21] Add a trace command Simon Glass
2013-06-11 18:14 ` [U-Boot] [PATCH v2 09/21] Support tracing in config.mk when enabled Simon Glass
2013-06-11 18:14 ` [U-Boot] [PATCH v2 10/21] Add trace support to generic board Simon Glass
2013-06-11 18:14 ` [U-Boot] [PATCH v2 11/21] Add proftool to decode profile data Simon Glass
2013-06-11 18:14 ` [U-Boot] [PATCH v2 12/21] sandbox: Support trace feature Simon Glass
2013-06-11 18:14 ` [U-Boot] [PATCH v2 13/21] Add a simple test for sandbox trace Simon Glass
2013-06-11 18:14 ` [U-Boot] [PATCH v2 14/21] Clarify bootm OS arguments Simon Glass
2013-06-11 18:14 ` [U-Boot] [PATCH v2 15/21] Refactor the bootm command to reduce code duplication Simon Glass
2013-06-27 13:40   ` Stefan Roese
2013-06-27 14:40     ` Tom Rini
2013-06-27 15:39     ` Simon Glass
2013-06-27 19:51     ` Simon Glass
2013-06-27 20:07       ` Tom Rini
2013-06-28  2:14       ` Simon Glass
2013-06-28  4:12         ` Stefan Roese
2013-06-28  5:44           ` Simon Glass
2013-06-28  6:58           ` Simon Glass
2013-06-28  7:04             ` Stefan Roese
2013-06-28  7:12               ` Simon Glass
2013-06-28  7:57                 ` Simon Glass
2013-06-11 18:14 ` [U-Boot] [PATCH v2 16/21] Add a 'fake' go command to the bootm command Simon Glass
2013-06-11 18:14 ` [U-Boot] [PATCH v2 17/21] arm: Implement the 'fake' go command Simon Glass
2013-06-11 19:59   ` Albert ARIBAUD
2013-06-11 20:02     ` Simon Glass
2013-06-11 20:21       ` Albert ARIBAUD
2013-06-11 21:17         ` Simon Glass
2013-06-11 21:36           ` Albert ARIBAUD
2013-06-20  4:16             ` Simon Glass
2013-06-11 18:14 ` [U-Boot] [PATCH v2 18/21] exynos: Avoid function instrumentation for microsecond timer Simon Glass
2013-06-11 18:14 ` [U-Boot] [PATCH v2 19/21] exynos: config: Add tracing options Simon Glass
2013-06-11 18:14 ` [U-Boot] [PATCH v2 20/21] x86: Support tracing function Simon Glass
2013-06-11 18:14 ` [U-Boot] [PATCH v2 21/21] x86: config: Add tracing options Simon Glass
2013-06-26 20:24 ` [U-Boot] [PATCH v2 0/21] Add tracing functionality to U-Boot Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.