Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion posix/include/sof/lib/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
#endif

#define assert_can_be_cold() do {} while (0)
#define mem_hot_path_confirm() do {} while (0)
#define dbg_path_hot_confirm() do {} while (0)

#endif /* __SOF_LIB_MEMORY_H__ */
12 changes: 6 additions & 6 deletions src/debug/dram.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@
#include <zephyr/logging/log.h>
#include <zephyr/sys/__assert.h>

LOG_MODULE_REGISTER(dram_debug, CONFIG_SOF_LOG_LEVEL);
LOG_MODULE_REGISTER(dbg_path, CONFIG_SOF_LOG_LEVEL);

static struct k_spinlock hot_path_lock;
static unsigned int hot_path_depth;
static const char *cold_path_fn;
static bool hot_path_confirmed;

void mem_cold_path_enter(const char *fn)
void dbg_path_cold_enter(const char *fn)
{
k_spinlock_key_t key = k_spin_lock(&hot_path_lock);

cold_path_fn = fn;

k_spin_unlock(&hot_path_lock, key);
}
EXPORT_SYMBOL(mem_cold_path_enter);
EXPORT_SYMBOL(dbg_path_cold_enter);

void mem_hot_path_start_watching(void)
void dbg_path_hot_start_watching(void)
{
k_spinlock_key_t key = k_spin_lock(&hot_path_lock);

Expand All @@ -36,7 +36,7 @@ void mem_hot_path_start_watching(void)
k_spin_unlock(&hot_path_lock, key);
}

void mem_hot_path_confirm(void)
void dbg_path_hot_confirm(void)
{
k_spinlock_key_t key = k_spin_lock(&hot_path_lock);

Expand All @@ -45,7 +45,7 @@ void mem_hot_path_confirm(void)
k_spin_unlock(&hot_path_lock, key);
}

void mem_hot_path_stop_watching(void)
void dbg_path_hot_stop_watching(void)
{
bool underrun, error;
k_spinlock_key_t key = k_spin_lock(&hot_path_lock);
Expand Down
4 changes: 2 additions & 2 deletions src/idc/idc.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,9 @@ void idc_cmd(struct idc_msg *msg)
notifier_notify_remote();
break;
case iTS(IDC_MSG_IPC):
mem_hot_path_start_watching();
dbg_path_hot_start_watching();
idc_ipc();
mem_hot_path_stop_watching();
dbg_path_hot_stop_watching();
break;
#if CONFIG_IPC_MAJOR_4
case iTS(IDC_MSG_BIND):
Expand Down
4 changes: 2 additions & 2 deletions src/ipc/ipc-zephyr.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,14 @@ enum task_state ipc_platform_do_cmd(struct ipc *ipc)
{
struct ipc_cmd_hdr *hdr;

mem_hot_path_start_watching();
dbg_path_hot_start_watching();

hdr = ipc_compact_read_msg();

/* perform command */
ipc_cmd(hdr);

mem_hot_path_stop_watching();
dbg_path_hot_stop_watching();

if (ipc->task_mask & IPC_TASK_POWERDOWN ||
ipc_get()->pm_prepare_D3) {
Expand Down
2 changes: 1 addition & 1 deletion src/ipc/ipc4/handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ int ipc4_pipeline_trigger(struct ipc_comp_dev *ppl_icd, uint32_t cmd, bool *dela
* mem_hot_path_start_watching() - mem_hot_path_stop_watching()
* brackets, the latter will generate an error / trigger a panic.
*/
mem_hot_path_confirm();
dbg_path_hot_confirm();

/* trigger the component */
ret = pipeline_trigger(host->cd->pipeline, host->cd, cmd);
Expand Down
2 changes: 1 addition & 1 deletion xtos/include/sof/lib/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
#endif

#define assert_can_be_cold() do {} while (0)
#define mem_hot_path_confirm() do {} while (0)
#define dbg_path_hot_confirm() do {} while (0)

#endif /* __SOF_LIB_MEMORY_H__ */
18 changes: 9 additions & 9 deletions zephyr/include/sof/lib/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ bool ll_sch_is_current(void);
#define ll_sch_is_current() false
#endif

void mem_hot_path_start_watching(void);
void mem_hot_path_stop_watching(void);
void mem_hot_path_confirm(void);
void mem_cold_path_enter(const char *fn);
void dbg_path_hot_start_watching(void);
void dbg_path_hot_stop_watching(void);
void dbg_path_hot_confirm(void);
void dbg_path_cold_enter(const char *fn);

static inline void __assert_can_be_cold(const char *fn)
{
__ASSERT(!ll_sch_is_current(), "%s() called from an LL thread!", fn);
mem_cold_path_enter(fn);
dbg_path_cold_enter(fn);
}
#define assert_can_be_cold() __assert_can_be_cold(__func__)
#else
#define mem_hot_path_start_watching() do {} while (0)
#define mem_hot_path_stop_watching() do {} while (0)
#define mem_hot_path_confirm() do {} while (0)
#define mem_cold_path_enter() do {} while (0)
#define dbg_path_hot_start_watching() do {} while (0)
#define dbg_path_hot_stop_watching() do {} while (0)
#define dbg_path_hot_confirm() do {} while (0)
#define dbg_path_cold_enter() do {} while (0)
#define assert_can_be_cold() do {} while (0)
#endif

Expand Down
Loading