diff options
author | Tom Rini <trini@konsulko.com> | 2023-02-12 10:56:54 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-02-12 10:56:54 -0500 |
commit | 78d1c3949a6f85f64b31ee8ab8240392a67ca30e (patch) | |
tree | 46064add0a5a2418f91cbce8afd997fc2317b965 /common | |
parent | ecff2bc4bd2687b280898c63eecfcc31d13cce22 (diff) | |
parent | 16bf3b6f8f35c295419dab9fc698d50686592f9c (diff) |
Merge branch '2023-02-10-update-trace-feature-to-work-with-trace-cmd'
To quote the author:
Since U-Boot's tracing feature was originally written, quite a few changes
have taken place in this domain. The original text format used by tracing
is still emitted by Linux, but a new trace-cmd tool has invented a binary
format which is now used by new tools, such as kernelshark.
With recent distributions and the move to Python 3, the old pybootchart
tool does not build or run. Unfortunately there is no 1:1 replacement for
the features that were provided by pybootchart, or at least it is not
obvious. Still, it makes sense to keep with the times.
This series updates proftool to use the new binary format, adding support
for function and funcgraph tracing, so that U-Boot's trace records can be
examined by trace-cmd and kernelshark.
This series also adds support for a flamegraph, which provides a visual
way to see which functions are called a lot, as well as which ones consume
the most time.
Some minor updates to the trace implementation within U-Boot are included,
to provide a little more information and to fix a few problems.
No unit tests are provided by proftool, but a functional test ensures that
sandbox can emit traces which can be processed by proftool, then parsed by
trace-cmd and that the timing of the various formats looks consistent.
Diffstat (limited to 'common')
-rw-r--r-- | common/board_f.c | 3 | ||||
-rw-r--r-- | common/board_r.c | 9 |
2 files changed, 12 insertions, 0 deletions
diff --git a/common/board_f.c b/common/board_f.c index 2b4edf30c9..f3c1ab53b1 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -290,7 +290,10 @@ static int setup_mon_len(void) { #if defined(__ARM__) || defined(__MICROBLAZE__) gd->mon_len = (ulong)&__bss_end - (ulong)_start; +#elif defined(CONFIG_SANDBOX) && !defined(__riscv) + gd->mon_len = (ulong)&_end - (ulong)_init; #elif defined(CONFIG_SANDBOX) + /* gcc does not provide _init in crti.o on RISC-V */ gd->mon_len = 0; #elif defined(CONFIG_EFI_APP) gd->mon_len = (ulong)&_end - (ulong)_init; diff --git a/common/board_r.c b/common/board_r.c index c6c0c1ab1d..e45003353f 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -797,6 +797,15 @@ static init_fnc_t init_sequence_r[] = { void board_init_r(gd_t *new_gd, ulong dest_addr) { /* + * The pre-relocation drivers may be using memory that has now gone + * away. Mark serial as unavailable - this will fall back to the debug + * UART if available. + * + * Do the same with log drivers since the memory may not be available. + */ + gd->flags &= ~(GD_FLG_SERIAL_READY | GD_FLG_LOG_READY); + + /* * Set up the new global data pointer. So far only x86 does this * here. * TODO(sjg@chromium.org): Consider doing this for all archs, or |