Skip to content

Commit

Permalink
drc: move logging context to the base image
Browse files Browse the repository at this point in the history
Logging context can be accessed from the deferred logging
thread. Therefore it must be always available to avoid
access to unmapped memory when an LLEXT module is unloaded.

Signed-off-by: Guennadi Liakhovetski <[email protected]>
  • Loading branch information
lyakh committed Aug 20, 2024
1 parent a93f301 commit 0823647
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/audio/drc/drc.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@
#include "drc.h"
#include "drc_algorithm.h"

LOG_MODULE_REGISTER(drc, CONFIG_SOF_LOG_LEVEL);
LOG_MODULE_DECLARE(drc, CONFIG_SOF_LOG_LEVEL);

SOF_DEFINE_REG_UUID(drc);

DECLARE_TR_CTX(drc_tr, SOF_UUID(drc_uuid), LOG_LEVEL_INFO);
extern const struct sof_uuid drc_uuid;
extern struct tr_ctx drc_tr;

void drc_reset_state(struct drc_state *state)
{
Expand Down
15 changes: 15 additions & 0 deletions src/audio/drc/drc_log.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2024 Intel Corporation.

#include <rtos/symbol.h>
#include <sof/lib/uuid.h>
#include <sof/trace/trace.h>
#include <user/trace.h>

SOF_DEFINE_REG_UUID(drc);
LOG_MODULE_REGISTER(drc, CONFIG_SOF_LOG_LEVEL);
DECLARE_TR_CTX(drc_tr, SOF_UUID(drc_uuid), LOG_LEVEL_INFO);
EXPORT_SYMBOL(drc_tr);
EXPORT_SYMBOL(drc_uuid);
EXPORT_SYMBOL(log_const_drc);
6 changes: 6 additions & 0 deletions zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,12 @@ elseif(CONFIG_COMP_DRC)
)
endif()

if(NOT CONFIG_COMP_DRC STREQUAL "n")
zephyr_library_sources(
${SOF_AUDIO_PATH}/drc/drc_log.c
)
endif()

zephyr_library_sources_ifdef(CONFIG_COMP_MULTIBAND_DRC
${SOF_AUDIO_PATH}/multiband_drc/multiband_drc.c
${SOF_AUDIO_PATH}/multiband_drc/multiband_drc_generic.c
Expand Down

0 comments on commit 0823647

Please sign in to comment.