Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global UUID registry, cleanup, simplification #9261

Merged
merged 13 commits into from
Jul 5, 2024
Merged
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ set_property(DIRECTORY APPEND
add_dependencies(sof_public_headers genconfig check_version_h)
target_include_directories(sof_public_headers INTERFACE ${GENERATED_DIRECTORY}/include)

include(scripts/cmake/uuid-registry.cmake)

if(CONFIG_LIBRARY)
if (CONFIG_LIBRARY_STATIC)
add_library(sof STATIC "")
Expand Down
37 changes: 37 additions & 0 deletions scripts/cmake/uuid-registry.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#
# UUID registry generation
#

# Simple target. FOUR (really 4.5, as LIBRARY builds use the same
# CMakeLists.txt but differ significantly in how it executes)
# different cmake environments into which it needs to build.
is_zephyr(zephyr_is)
if(zephyr_is)
set(TOPDIR ${sof_top_dir})
set(UUID_REG_H ${PROJECT_BINARY_DIR}/include/generated/uuid-registry.h)
set(DEP_TARGET zephyr_interface)
elseif(${PROJECT_NAME} STREQUAL "SOF_TOOLS")
set(TOPDIR "${PROJECT_SOURCE_DIR}/..")
set(UUID_REG_H "${CMAKE_CURRENT_BINARY_DIR}/uuid-registry.h")
set(DEP_TARGET sof-logger)
elseif(${PROJECT_NAME} STREQUAL "SOF_TPLG_PARSER")
set(TOPDIR "${PROJECT_SOURCE_DIR}/../..")
set(UUID_REG_H "${PROJECT_BINARY_DIR}/include/uuid-registry.h")
set(DEP_TARGET sof_tplg_parser)
else()
# Legacy SOF, or CONFIG_LIBRARY
set(TOPDIR ${PROJECT_SOURCE_DIR})
set(UUID_REG_H ${PROJECT_BINARY_DIR}/generated/include/uuid-registry.h)
set(DEP_TARGET sof_public_headers)
endif()

add_custom_command(
OUTPUT ${UUID_REG_H}
COMMAND
${PYTHON_EXECUTABLE} ${TOPDIR}/scripts/gen-uuid-reg.py
${TOPDIR}/uuid-registry.txt
${UUID_REG_H})

add_custom_target(uuid_reg_h DEPENDS ${UUID_REG_H})

add_dependencies(${DEP_TARGET} uuid_reg_h)
61 changes: 61 additions & 0 deletions scripts/gen-uuid-reg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: BSD-3-Clause
import re
import sys

# Very simple UUID registry validator and C header generator. Parses
# uuid-registry.txt (passed as the first command line argument) and
# writes a C header (named in the second argument) containing
# definitions to be used at build time. Fails via assertion if the
# any element in the registry is invalid.

header = """/*
* GENERATED CODE. DO NOT EDIT.
*
* Generated UUID records (initializers for struct sof_uuid)
* See scripts/gen-uuid-reg.py
*/
#ifndef _UUID_REGISTRY_H
#define _UUID_REGISTRY_H
"""

all_syms = set()
all_uuids = set()
out_recs = []

def emit_uuid_rec(uu, sym):
recs = uu.split('-')
brec = recs[3]
wrecs = [ "0x" + r for r in recs[0:3] ]
byts = [ "0x" + brec[ 2*i : 2*i+2 ] for i in range(int(len(brec) / 2)) ]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bytes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"bytes()" is a python builtin, alas.

uuidinit = "{ " + ", ".join(wrecs) + ", { " + ", ".join(byts) + " } }"
out_recs.append(f"#define _UUIDREG_{sym} {uuidinit}")

def main():
with open(sys.argv[1]) as f:
for line in f.readlines():
line = re.sub(r'\s*#.*', '', line) # trim comments
line = re.sub(r'^\s*', '', line) # trim leading ws
line = re.sub(r'\s*$', '', line) # trim trailing ws
if line == "":
continue
m = re.match(r'(.*)\s+(.*)', line)
assert m
(uu, sym) = (m.group(1).lower(), m.group(2))
assert re.match(r'[0-9a-f]{8}(?:-[0-9a-f]{4}){2}-[0-9a-f]{16}', uu)
assert re.match(r'[a-zA-Z_][a-zA-Z0-9_]*', sym)
assert len(sym) < 32
assert uu not in all_uuids
assert sym not in all_syms
all_uuids.add(uu)
all_syms.add(sym)
emit_uuid_rec(uu, sym)

with open(sys.argv[2], "w") as f:
f.write(header)
for l in out_recs:
f.write(l + "\n")
f.write("#endif /* _UUID_REGISTRY_H */\n")

if __name__ == "__main__":
main()
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)]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this hunk removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly I'm hoping someone chimes in to clarify this.

AFAICT sof-logger, smex, .ldc files and old-style trace context usage are all degenerate in Zephyr builds. The window that used to store the dictionary logging output has been repurposed to transmit plaintext Zephyr logs, and almost nothing is actually emitting the trace output anyway as all the {tr,comp}_{err,warn,info}() has been redirected to Zephyr LOG_xxx() macros which ignore the context struct.

Basically this is me ripping the bandaid off to see what breaks. For sure, after this PR merges none of that stuff will work anymore as the addresses of the sof_uuid structs won't appear within the static_uuids section and sof-logger won't see any ldc entries.

If we absolutely still need this, let me know and I'll see what needs to be ported.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andyross @lyakh Let's have some from @thesofproject/nxp check this. In the transition to Zephyr, we did use sof-logger early with Zephyr so the smex/ldc/soflogger stuff was also used with Zephyr, but indeed for Intel platforms we've now moved on to Zephyr logging subsystem completely. But has NXP made the move? There is certainly a maintainance cost in having these around (see #8822 ), so in general I'm happy to drop these.

PS The UUID rework looks great. Once we have the v2.10 release out, I'll do a more proper review.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thesofproject/mediatek should also check to see if they still depend on this

Copy link
Contributor Author

@andyross andyross Jun 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW: mt8xxx builds are fine in-tree as non-Zephyr builds are unchanged and will continue to work.

The question here is whether or not any Zephyr configurations are still in the deprecated/only-partially-working trace context world. And I'm pretty sure[1] the answer is no, because if you tried you'd discover that it doesn't actually have all the info. When __ZEPHYR__==1, all the tr_info()/comp_info() logging et. al. goes to a Zephyr LOG_INFO() macro, 100% of the time. And the implementation of that ignores the trace context that would have been used earlier to associate the log message with a UUID[2]. So the only output you'll get out of it are a handful of spots that are still going to the trace context (buffer and dai logging, in particular, are still using trace-based macros which land in stubs in a Zephyr build, though AFAICT those don't appear on the Zephyr output and no one seems to care!).

Anyway, the point being: this PR moves the UUIDs to a different location in the binary (an iterable array and not a special .static_uuids section) with a different layout (the struct sof_uuid_entry that includes the string name in addition to the bare UUID). So it's 100% going to break any existing users. I just don't think there are any.

[1] I mean, actually I'm more than pretty sure. But software is complicated and edge cases abound, thus the questions.

[2] Zephyr logging is plaintext, ignores the trace context and UUID, and doesn't require .ldc files nor smex/sof_logger. There actually is a Zephyr dictionary logging feature @dcpleung did long ago, but it's not enabled for SOF and to be honest I don't know much about how its tooling works.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh i totally misread this as C code, not python, then yes ignore my previous comment since this is zephyr specific

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately we still have old and very complex build and CI dependencies here because (as usual) the logging transitions to Zephyr and IPC4 were after-thoughts and rushed on the validation side. Some in Intel CI are not even open-source, which means you couldn't fix them even if you volunteered to.

So unless this literally stops building, I highly recommend you don't touch this if you want the rest merged in a reasonable time. Feel free to print additional warnings.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andyross As for Zephyr logging being plaintext, we have enabled both Zephyr dictionary and mipi syst and even have an overlay in upstream SOF -> work/sof/app/logging_mipisystcat_overlay.conf . Enablement is pending changes to CI infra which has a lot of dependencies to the current plaintext logs, but we have full capability to employ dictionaries.

Copy link
Member

@lgirdwood lgirdwood Jul 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andyross I'm good to go ahead without CI being ready - can you wrap any transition a a Kconfig which we can enable as CI catches up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI should be fine, almost all of it was just waiting for the missing Zephyr patch mentioned above, which is in now that #9278 has merged.[1]

Should have it up today, July-4th-distractions willing.

[1] Also there was a tweak needed for testbench, which builds the SOF code in a third (!) cmake environment to make a shared library for tplg_parser which early-exits (!!) from the legacy CMakeLists.txt, so I needed to move where the generation was included.


src_dest_list += [(pathlib.Path(SOF_TOP) /
"tools" / "mtrace"/ "mtrace-reader.py",
tools_output_dir / "mtrace-reader.py")]
Expand Down
8 changes: 3 additions & 5 deletions src/audio/aria/aria.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@
LOG_MODULE_REGISTER(aria, CONFIG_SOF_LOG_LEVEL);

/* these ids aligns windows driver requirement to support windows driver */
/* 99f7166d-372c-43ef-81f6-22007aa15f03 */
DECLARE_SOF_RT_UUID("aria", aria_comp_uuid, 0x99f7166d, 0x372c, 0x43ef,
0x81, 0xf6, 0x22, 0x00, 0x7a, 0xa1, 0x5f, 0x03);
SOF_DEFINE_REG_UUID(aria);

DECLARE_TR_CTX(aria_comp_tr, SOF_UUID(aria_comp_uuid), LOG_LEVEL_INFO);
DECLARE_TR_CTX(aria_comp_tr, SOF_UUID(aria_uuid), LOG_LEVEL_INFO);

static size_t get_required_emory(size_t chan_cnt, size_t smpl_group_cnt)
{
Expand Down Expand Up @@ -292,5 +290,5 @@ static const struct module_interface aria_interface = {
.set_configuration = aria_set_config,
};

DECLARE_MODULE_ADAPTER(aria_interface, aria_comp_uuid, aria_comp_tr);
DECLARE_MODULE_ADAPTER(aria_interface, aria_uuid, aria_comp_tr);
SOF_MODULE_INIT(aria, sys_comp_module_aria_interface_init);
2 changes: 1 addition & 1 deletion src/audio/asrc/asrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -877,5 +877,5 @@ static const struct module_interface asrc_interface = {
.free = asrc_free,
};

DECLARE_MODULE_ADAPTER(asrc_interface, asrc_uuid, asrc_tr);
DECLARE_MODULE_ADAPTER(asrc_interface, ASRC_UUID, asrc_tr);
SOF_MODULE_INIT(asrc, sys_comp_module_asrc_interface_init);
9 changes: 8 additions & 1 deletion src/audio/asrc/asrc.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,14 @@ int asrc_dai_start_timestamp(struct comp_data *cd);
int asrc_dai_stop_timestamp(struct comp_data *cd);
void asrc_update_buffer_format(struct comp_buffer *buf_c, struct comp_data *cd);
void asrc_set_stream_params(struct comp_data *cd, struct sof_ipc_stream_params *params);
extern const struct sof_uuid asrc_uuid;
extern struct tr_ctx asrc_tr;

/* Different UUID names for different build configurations... */
#ifdef CONFIG_IPC_MAJOR_4
#define ASRC_UUID asrc4_uuid
#else
#define ASRC_UUID asrc_uuid
#endif
extern const struct sof_uuid ASRC_UUID;

#endif
4 changes: 1 addition & 3 deletions src/audio/asrc/asrc_ipc3.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
#include <errno.h>
#include "asrc.h"

/* c8ec72f6-8526-4faf-9d39-a23d0b541de2 */
DECLARE_SOF_RT_UUID("asrc", asrc_uuid, 0xc8ec72f6, 0x8526, 0x4faf,
0x9d, 0x39, 0xa2, 0x3d, 0x0b, 0x54, 0x1d, 0xe2);
SOF_DEFINE_REG_UUID(asrc);

DECLARE_TR_CTX(asrc_tr, SOF_UUID(asrc_uuid), LOG_LEVEL_INFO);

Expand Down
6 changes: 2 additions & 4 deletions src/audio/asrc/asrc_ipc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@
#include <errno.h>
#include "asrc.h"

/* 66b4402d-b468-42f2-81a7-b37121863dd4 */
DECLARE_SOF_RT_UUID("asrc", asrc_uuid, 0x66b4402d, 0xb468, 0x42f2,
0x81, 0xa7, 0xb3, 0x71, 0x21, 0x86, 0x3d, 0xd4);
SOF_DEFINE_REG_UUID(asrc4);

DECLARE_TR_CTX(asrc_tr, SOF_UUID(asrc_uuid), LOG_LEVEL_INFO);
DECLARE_TR_CTX(asrc_tr, SOF_UUID(asrc4_uuid), LOG_LEVEL_INFO);

int asrc_dai_configure_timestamp(struct comp_data *cd)
{
Expand Down
8 changes: 3 additions & 5 deletions src/audio/base_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@

LOG_MODULE_REGISTER(basefw, CONFIG_SOF_LOG_LEVEL);

/* 0e398c32-5ade-ba4b-93b1-c50432280ee4 */
DECLARE_SOF_RT_UUID("basefw", basefw_comp_uuid, 0xe398c32, 0x5ade, 0xba4b,
0x93, 0xb1, 0xc5, 0x04, 0x32, 0x28, 0x0e, 0xe4);
DECLARE_TR_CTX(basefw_comp_tr, SOF_UUID(basefw_comp_uuid), LOG_LEVEL_INFO);
SOF_DEFINE_REG_UUID(basefw);
DECLARE_TR_CTX(basefw_comp_tr, SOF_UUID(basefw_uuid), LOG_LEVEL_INFO);

static struct ipc4_system_time_info global_system_time_info;
static uint64_t global_cycle_delta;
Expand Down Expand Up @@ -512,7 +510,7 @@ static int basefw_set_large_config(struct comp_dev *dev,
};

static const struct comp_driver comp_basefw = {
.uid = SOF_RT_UUID(basefw_comp_uuid),
.uid = SOF_RT_UUID(basefw_uuid),
.tctx = &basefw_comp_tr,
.ops = {
.get_large_config = basefw_get_large_config,
Expand Down
4 changes: 1 addition & 3 deletions src/audio/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@

LOG_MODULE_REGISTER(buffer, CONFIG_SOF_LOG_LEVEL);

/* 42544c92-8e92-4e41-b679-34519f1c1d28 */
DECLARE_SOF_RT_UUID("buffer", buffer_uuid, 0x42544c92, 0x8e92, 0x4e41,
0xb6, 0x79, 0x34, 0x51, 0x9f, 0x1c, 0x1d, 0x28);
SOF_DEFINE_REG_UUID(buffer);
DECLARE_TR_CTX(buffer_tr, SOF_UUID(buffer_uuid), LOG_LEVEL_INFO);

static struct comp_buffer *buffer_alloc_struct(void *stream_addr, size_t size, uint32_t caps,
Expand Down
4 changes: 1 addition & 3 deletions src/audio/chain_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ static const uint32_t max_chain_number = DAI_NUM_HDA_OUT + DAI_NUM_HDA_IN;

LOG_MODULE_REGISTER(chain_dma, CONFIG_SOF_LOG_LEVEL);

/* 6a0a274f-27cc-4afb-a3e7-3444723f432e */
DECLARE_SOF_RT_UUID("chain_dma", chain_dma_uuid, 0x6a0a274f, 0x27cc, 0x4afb,
0xa3, 0xe7, 0x34, 0x44, 0x72, 0x3f, 0x43, 0x2e);
SOF_DEFINE_REG_UUID(chain_dma);
DECLARE_TR_CTX(chain_dma_tr, SOF_UUID(chain_dma_uuid), LOG_LEVEL_INFO);

/* chain dma component private data */
Expand Down
4 changes: 1 addition & 3 deletions src/audio/channel_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@

LOG_MODULE_REGISTER(channel_map, CONFIG_SOF_LOG_LEVEL);

/* ec290e95-4a20-47eb-bbff-d9c888431831 */
DECLARE_SOF_UUID("channel-map", chmap_uuid, 0xec290e95, 0x4a20, 0x47eb,
0xbb, 0xff, 0xd9, 0xc8, 0x88, 0x43, 0x18, 0x31);
SOF_DEFINE_REG_UUID(chmap);

DECLARE_TR_CTX(chmap_tr, SOF_UUID(chmap_uuid), LOG_LEVEL_INFO);

Expand Down
4 changes: 1 addition & 3 deletions src/audio/codec/dts/dts.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

LOG_MODULE_REGISTER(dts, CONFIG_SOF_LOG_LEVEL);

/* d95fc34f-370f-4ac7-bc86-bfdc5be241e6 */
DECLARE_SOF_RT_UUID("dts_codec", dts_uuid, 0xd95fc34f, 0x370f, 0x4ac7,
0xbc, 0x86, 0xbf, 0xdc, 0x5b, 0xe2, 0x41, 0xe6);
SOF_DEFINE_REG_UUID(dts);
DECLARE_TR_CTX(dts_tr, SOF_UUID(dts_uuid), LOG_LEVEL_INFO);

#define MAX_EXPECTED_DTS_CONFIG_DATA_SIZE 8192
Expand Down
6 changes: 2 additions & 4 deletions src/audio/component.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ LOG_MODULE_REGISTER(component, CONFIG_SOF_LOG_LEVEL);

static SHARED_DATA struct comp_driver_list cd;

/* 7c42ce8b-0108-43d0-9137-56d660478c5f */
DECLARE_SOF_UUID("component", comp_uuid, 0x7c42ce8b, 0x0108, 0x43d0,
0x91, 0x37, 0x56, 0xd6, 0x60, 0x47, 0x8c, 0x5f);
SOF_DEFINE_REG_UUID(component);

DECLARE_TR_CTX(comp_tr, SOF_UUID(comp_uuid), LOG_LEVEL_INFO);
DECLARE_TR_CTX(comp_tr, SOF_UUID(component_uuid), LOG_LEVEL_INFO);

int comp_register(struct comp_driver_info *drv)
{
Expand Down
8 changes: 3 additions & 5 deletions src/audio/copier/copier.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,9 @@
LOG_MODULE_REGISTER(copier, CONFIG_SOF_LOG_LEVEL);

/* this id aligns windows driver requirement to support windows driver */
/* 9ba00c83-ca12-4a83-943c-1fa2e82f9dda */
DECLARE_SOF_RT_UUID("copier", copier_comp_uuid, 0x9ba00c83, 0xca12, 0x4a83,
0x94, 0x3c, 0x1f, 0xa2, 0xe8, 0x2f, 0x9d, 0xda);
SOF_DEFINE_REG_UUID(copier);

DECLARE_TR_CTX(copier_comp_tr, SOF_UUID(copier_comp_uuid), LOG_LEVEL_INFO);
DECLARE_TR_CTX(copier_comp_tr, SOF_UUID(copier_uuid), LOG_LEVEL_INFO);

static int copier_init(struct processing_module *mod)
{
Expand Down Expand Up @@ -1027,5 +1025,5 @@ static const struct module_interface copier_interface = {
.endpoint_ops = &copier_endpoint_ops,
};

DECLARE_MODULE_ADAPTER(copier_interface, copier_comp_uuid, copier_comp_tr);
DECLARE_MODULE_ADAPTER(copier_interface, copier_uuid, copier_comp_tr);
SOF_MODULE_INIT(copier, sys_comp_module_copier_interface_init);
6 changes: 2 additions & 4 deletions src/audio/copier/copier_ipcgtw.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@

LOG_MODULE_REGISTER(ipcgtw, CONFIG_SOF_LOG_LEVEL);

/* a814a1ca-0b83-466c-9587-2f35ff8d12e8 */
DECLARE_SOF_RT_UUID("ipcgw", ipcgtw_comp_uuid, 0xa814a1ca, 0x0b83, 0x466c,
0x95, 0x87, 0x2f, 0x35, 0xff, 0x8d, 0x12, 0xe8);
SOF_DEFINE_REG_UUID(ipcgw);

DECLARE_TR_CTX(ipcgtw_comp_tr, SOF_UUID(ipcgtw_comp_uuid), LOG_LEVEL_INFO);
DECLARE_TR_CTX(ipcgtw_comp_tr, SOF_UUID(ipcgw_uuid), LOG_LEVEL_INFO);

/* List of existing IPC gateways */
static struct list_item ipcgtw_list_head = LIST_INIT(ipcgtw_list_head);
Expand Down
4 changes: 1 addition & 3 deletions src/audio/crossover/crossover.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@

LOG_MODULE_REGISTER(crossover, CONFIG_SOF_LOG_LEVEL);

/* 948c9ad1-806a-4131-ad6c-b2bda9e35a9f */
DECLARE_SOF_RT_UUID("crossover", crossover_uuid, 0x948c9ad1, 0x806a, 0x4131,
0xad, 0x6c, 0xb2, 0xbd, 0xa9, 0xe3, 0x5a, 0x9f);
SOF_DEFINE_REG_UUID(crossover);

DECLARE_TR_CTX(crossover_tr, SOF_UUID(crossover_uuid), LOG_LEVEL_INFO);

Expand Down
8 changes: 3 additions & 5 deletions src/audio/dai-legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ static const struct comp_driver comp_dai;

LOG_MODULE_REGISTER(dai_comp, CONFIG_SOF_LOG_LEVEL);

/* c2b00d27-ffbc-4150-a51a-245c79c5e54b */
DECLARE_SOF_RT_UUID("dai", dai_comp_uuid, 0xc2b00d27, 0xffbc, 0x4150,
0xa5, 0x1a, 0x24, 0x5c, 0x79, 0xc5, 0xe5, 0x4b);
SOF_DEFINE_REG_UUID(dai);

DECLARE_TR_CTX(dai_comp_tr, SOF_UUID(dai_comp_uuid), LOG_LEVEL_INFO);
DECLARE_TR_CTX(dai_comp_tr, SOF_UUID(dai_uuid), LOG_LEVEL_INFO);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this part of the unification needed for some automation in one of the following commits? If not - maybe we could keep different names, makes grepping the code easier

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this is sort of a fakeout. The names in-tree are both "dai", and they were renamed by an early patch in this series to disambiguate them. But then it turns out that the value of the UUID is the same in both cases, which is unfortunate but technically unresolvable (I mean... not really, but I'm trying very hard not to have to renumber these things and being really clear where I do). So this moves back to the original usage where the two drivers share the same UUID, which is OK in this case as they can't be built into the same image anyway.

I should fold them together to reduce the churn, though that's a mildly hard rebase.


#if CONFIG_COMP_DAI_GROUP

Expand Down Expand Up @@ -1112,7 +1110,7 @@ static uint64_t dai_get_processed_data(struct comp_dev *dev, uint32_t stream_no,

static const struct comp_driver comp_dai = {
.type = SOF_COMP_DAI,
.uid = SOF_RT_UUID(dai_comp_uuid),
.uid = SOF_RT_UUID(dai_uuid),
.tctx = &dai_comp_tr,
.ops = {
.create = dai_new,
Expand Down
8 changes: 3 additions & 5 deletions src/audio/dai-zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,9 @@ static const struct comp_driver comp_dai;

LOG_MODULE_REGISTER(dai_comp, CONFIG_SOF_LOG_LEVEL);

/* c2b00d27-ffbc-4150-a51a-245c79c5e54b */
DECLARE_SOF_RT_UUID("dai", dai_comp_uuid, 0xc2b00d27, 0xffbc, 0x4150,
0xa5, 0x1a, 0x24, 0x5c, 0x79, 0xc5, 0xe5, 0x4b);
SOF_DEFINE_REG_UUID(dai);

DECLARE_TR_CTX(dai_comp_tr, SOF_UUID(dai_comp_uuid), LOG_LEVEL_INFO);
DECLARE_TR_CTX(dai_comp_tr, SOF_UUID(dai_uuid), LOG_LEVEL_INFO);

#if CONFIG_COMP_DAI_GROUP

Expand Down Expand Up @@ -1777,7 +1775,7 @@ int dai_zephyr_unbind(struct dai_data *dd, struct comp_dev *dev, void *data)

static const struct comp_driver comp_dai = {
.type = SOF_COMP_DAI,
.uid = SOF_RT_UUID(dai_comp_uuid),
.uid = SOF_RT_UUID(dai_uuid),
.tctx = &dai_comp_tr,
.ops = {
.create = dai_new,
Expand Down
4 changes: 1 addition & 3 deletions src/audio/dcblock/dcblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@

LOG_MODULE_REGISTER(dcblock, CONFIG_SOF_LOG_LEVEL);

/* b809efaf-5681-42b1-9ed6-04bb012dd384 */
DECLARE_SOF_RT_UUID("dcblock", dcblock_uuid, 0xb809efaf, 0x5681, 0x42b1,
0x9e, 0xd6, 0x04, 0xbb, 0x01, 0x2d, 0xd3, 0x84);
SOF_DEFINE_REG_UUID(dcblock);

DECLARE_TR_CTX(dcblock_tr, SOF_UUID(dcblock_uuid), LOG_LEVEL_INFO);

Expand Down
Loading
Loading