Skip to content

Commit

Permalink
zephyr: Remove legacy logging artifacts
Browse files Browse the repository at this point in the history
The sof-logger/smex tools and the .ldc formats are all dead code in
Zephyr builds.  The logging/trace macros don't emit the correct
metadata anymore, using Zephry logging instead (and I don't think they
ever did?), and the resulting .ldc files are degenerate containing
just the header and the records for component UUIDs, which nothing
uses.

Save a few milliseconds of build time and a few bytes of output, and
free up the evolution path by not having to support legacy tools.

Signed-off-by: Andy Ross <andyross@google.com>
  • Loading branch information
andyross authored and lgirdwood committed Jul 5, 2024
1 parent c97bba3 commit 0868b1f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 40 deletions.
19 changes: 0 additions & 19 deletions scripts/xtensa-build-zephyr.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,16 +877,6 @@ def build_platforms():
else: # unknown failure
raise cpe

smex_executable = pathlib.Path(west_top, platform_build_dir_name, "zephyr", "smex_ep",
"build", "smex")
fw_ldc_file = pathlib.Path(sof_platform_output_dir, f"sof-{platform}.ldc")
input_elf_file = pathlib.Path(west_top, platform_build_dir_name, "zephyr", "zephyr.elf")
# Extract metadata
execute_command([str(smex_executable), "-l", str(fw_ldc_file), str(input_elf_file)])

for p_alias in platform_configs[platform].aliases:
symlink_or_copy(sof_platform_output_dir, f"sof-{platform}.ldc", sof_platform_output_dir, f"sof-{p_alias}.ldc")

# reproducible-zephyr.ri is less useful now that show_installed_files() shows
# checksums too. However: - it's still useful when only the .ri file is
# available (no build logs for the other image), - it makes sure sof_ri_info.py
Expand All @@ -900,15 +890,6 @@ def build_platforms():
src_dest_list = []
tools_output_dir = pathlib.Path(STAGING_DIR, "tools")

# Install sof-logger from the last platform built (requires building at least one platform).
if platform_build_dir_name:
sof_logger_dir = pathlib.Path(west_top, platform_build_dir_name, "zephyr",
"sof-logger_ep", "build", "logger")
sof_logger_executable_to_copy = pathlib.Path(shutil.which("sof-logger", path=sof_logger_dir))
sof_logger_installed_file = pathlib.Path(tools_output_dir, sof_logger_executable_to_copy.name).resolve()

src_dest_list += [(sof_logger_executable_to_copy, sof_logger_installed_file)]

src_dest_list += [(pathlib.Path(SOF_TOP) /
"tools" / "mtrace"/ "mtrace-reader.py",
tools_output_dir / "mtrace-reader.py")]
Expand Down
21 changes: 0 additions & 21 deletions zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,27 +128,6 @@ set(RIMAGE_TOP ${sof_top_dir}/tools/rimage)
set(RIMAGE_CONFIG_PATH ${RIMAGE_TOP}/config CACHE PATH
" Path to rimage board configuration files")

include(ExternalProject)

ExternalProject_Add(smex_ep
SOURCE_DIR "${ZEPHYR_SOF_MODULE_DIR}/smex/"
# The default paths are very "deep"
PREFIX "${PROJECT_BINARY_DIR}/smex_ep"
BINARY_DIR "${PROJECT_BINARY_DIR}/smex_ep/build"
BUILD_ALWAYS 1
INSTALL_COMMAND "" # need smex only at build time
)

ExternalProject_Add(sof_logger_ep
SOURCE_DIR "${ZEPHYR_SOF_MODULE_DIR}/tools/"
# The default paths are very "deep"
PREFIX "${PROJECT_BINARY_DIR}/sof-logger_ep"
BINARY_DIR "${PROJECT_BINARY_DIR}/sof-logger_ep/build"
BUILD_COMMAND cmake --build . --target sof-logger
BUILD_ALWAYS 1
INSTALL_COMMAND ""
)

# default SOF includes
target_include_directories(SOF INTERFACE ${RIMAGE_TOP}/src/include)
target_include_directories(SOF INTERFACE ${SOF_SRC_PATH}/include)
Expand Down

0 comments on commit 0868b1f

Please sign in to comment.