diff options
author | Simon Glass <sjg@chromium.org> | 2023-08-21 21:16:54 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-08-31 13:16:54 -0400 |
commit | c9eff0a6b6ea2bcd54d30f8a02281681f3730223 (patch) | |
tree | ecb9d75aed5368b976c6ac91ff031529263432f5 /test | |
parent | fb7dfca28ad256f27f89a79f96cb4617dc54731d (diff) | |
download | u-boot-c9eff0a6b6ea2bcd54d30f8a02281681f3730223.zip u-boot-c9eff0a6b6ea2bcd54d30f8a02281681f3730223.tar.gz u-boot-c9eff0a6b6ea2bcd54d30f8a02281681f3730223.tar.bz2 |
initcall: Support emitting events
At present the initcall list consists of a list of function pointers. Over
time the initcall lists will likely change to mostly emitting events,
since most of the calls are board- or arch-specific.
As a first step, allow an initcall to be an event type instead of a
function pointer. Add the required macro and update initcall_run_list() to
emit an event in that case, or ignore it if events are not enabled.
The bottom 8 bits of the function pointer are used to hold the event type,
with the rest being all ones. This should avoid any collision, since
initcalls should not be above 0xffffff00 in memory.
Convert misc_init_f over to use this mechanism.
Add comments to the initcall header file while we are here. Also fix up
the trace test to handle the change.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/py/tests/test_trace.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/test/py/tests/test_trace.py b/test/py/tests/test_trace.py index ad22509..28a6e72 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') |