diff options
author | Tom Rini <trini@konsulko.com> | 2023-08-31 15:10:42 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-08-31 15:10:42 -0400 |
commit | b8b512a45358d50bce2e17b5941c5e39b52a0594 (patch) | |
tree | f70b4d2452f8ca45025916cd85f0d1af684902bb /test/py | |
parent | b81a024e4a37097d3dcffccb225850f8f6dc8277 (diff) | |
parent | 91caa3bb89b112a1421ee2ee3661baf67c64bab9 (diff) |
Merge branch '2023-08-31-replace-more-init-hooks-with-events' into next
To quote the author:
This series replaces some more of the init hooks in board_f.c and
board_r.c with events. Notably it converts last_state_init() over.
It also provides a 'simple' event spy, which takes no arguments. It
turns out that this is quite a common case, so it is worth optimising
for this, to reduce code size, before events become too commonly used.
Finally, it introduces a way of emitting an event in an initcall,
instead of calling a function. This is likely to be used at least as
often as the functions, as we convert more of these initcalls.
As part of this, the initcall code is brought back into a C file. Somehow
the compiler has changed or something else, so that this does not confer
any benefits now.
For boards with EVENT enabled, this unfortunately results in small
growth, e.g. for firefly:
aarch64: (for 1/1 boards) all +114.0 data +16.0 rodata +22.0 text +76.0
arm: (for 1/1 boards) all +82.0 rodata +18.0 text +64.0
For boards without EVENT enabled the growth is smaller, e.g. nokia_rx51:
arm: (for 1/1 boards) all +32.0 data +8.0 rodata -8.0 text +32.0
I cannot find a good way to avoid the latter, other than macro magic
with an embedded comma (to completely remove an event entry), which
seems nasty.
Diffstat (limited to 'test/py')
-rw-r--r-- | test/py/tests/test_event_dump.py | 3 | ||||
-rw-r--r-- | test/py/tests/test_trace.py | 11 |
2 files changed, 8 insertions, 6 deletions
diff --git a/test/py/tests/test_event_dump.py b/test/py/tests/test_event_dump.py index da196df4c3..a6df9e10e5 100644 --- a/test/py/tests/test_event_dump.py +++ b/test/py/tests/test_event_dump.py @@ -18,5 +18,6 @@ def test_event_dump(u_boot_console): -------------------- ------------------------------ ------------------------------ EVT_FT_FIXUP bootmeth_vbe_ft_fixup .*boot/vbe_request.c:.* EVT_FT_FIXUP bootmeth_vbe_simple_ft_fixup .*boot/vbe_simple_os.c:.* -EVT_MISC_INIT_F sandbox_misc_init_f .*arch/sandbox/cpu/start.c:''' +EVT_MISC_INIT_F sandbox_early_getopt_check .*arch/sandbox/cpu/start.c:.* +EVT_TEST h_adder_simple .*test/common/event.c:''' assert re.match(expect, out, re.MULTILINE) is not None diff --git a/test/py/tests/test_trace.py b/test/py/tests/test_trace.py index ad2250920d..28a6e72f52 100644 --- a/test/py/tests/test_trace.py +++ b/test/py/tests/test_trace.py @@ -175,7 +175,7 @@ def check_funcgraph(cons, fname, proftool, map_fname, trace_dat): # Then look for this: # u-boot-1 [000] 282.101375: funcgraph_exit: 0.006 us | } # Then check for this: - # u-boot-1 [000] 282.101375: funcgraph_entry: 0.000 us | event_init(); + # u-boot-1 [000] 282.101375: funcgraph_entry: 0.000 us | initcall_is_event(); expected_indent = None found_start = False @@ -197,8 +197,9 @@ def check_funcgraph(cons, fname, proftool, map_fname, trace_dat): elif found_start and indent == expected_indent and brace == '}': found_end = True - # The next function after initf_bootstage() exits should be event_init() - assert upto == 'event_init()' + # The next function after initf_bootstage() exits should be + # initcall_is_event() + assert upto == 'initcall_is_event()' # Now look for initf_dm() and dm_timer_init() so we can check the bootstage # time @@ -247,7 +248,7 @@ def check_flamegraph(cons, fname, proftool, map_fname, trace_fg): # We expect dm_timer_init() to be called twice: once before relocation and # once after look1 = 'initf_dm;dm_timer_init 1' - look2 = 'board_init_r;initr_dm_devices;dm_timer_init 1' + look2 = 'board_init_r;initcall_run_list;initr_dm_devices;dm_timer_init 1' found = 0 with open(trace_fg, 'r') as fd: for line in fd: @@ -272,7 +273,7 @@ def check_flamegraph(cons, fname, proftool, map_fname, trace_fg): total += count return total - +check_flamegraph @pytest.mark.slow @pytest.mark.boardspec('sandbox') @pytest.mark.buildconfigspec('trace') |