Skip to content

Commit

Permalink
scripts: check_init_priorities: use the Zephyr executable file
Browse files Browse the repository at this point in the history
Rework check_init_priorities to use the main executable file instead of
the individual object files for discovering the devices.

This should make the script more robust in case of stale files in the
build directory, and also makes it work with LTO object files.

Additionally, keep track of the detected init calls, and add a handy
"-i" option to produce a human readable print of the initcalls in the
call sequence, which can be useful for debugging initialization problems
due to odd SYS_INIT and DEVICE interactions.

Signed-off-by: Fabio Baltieri <[email protected]>
  • Loading branch information
fabiobaltieri committed Sep 14, 2023
1 parent 9fc414a commit 5ffb4f0
Show file tree
Hide file tree
Showing 6 changed files with 350 additions and 270 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1811,8 +1811,7 @@ if(CONFIG_CHECK_INIT_PRIORITIES)
list(APPEND
post_build_commands
COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/build/check_init_priorities.py
--build-dir ${PROJECT_BINARY_DIR}/..
--edt-pickle ${EDT_PICKLE}
--elf-file=${ZEPHYR_BINARY_DIR}/${KERNEL_ELF_NAME}
${fail_on_warning}
)
endif()
Expand Down
1 change: 1 addition & 0 deletions Kconfig.zephyr
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ config BUILD_OUTPUT_STRIP_PATHS
config CHECK_INIT_PRIORITIES
bool "Build time initialization priorities check"
default y
depends on !NATIVE_LIBRARY
help
Check the build for initialization priority issues by comparing the
initialization priority in the build with the device dependency
Expand Down
Loading

0 comments on commit 5ffb4f0

Please sign in to comment.