diff --git a/src/include/sof/audio/component.h b/src/include/sof/audio/component.h index 029557ce1..d213827f4 100644 --- a/src/include/sof/audio/component.h +++ b/src/include/sof/audio/component.h @@ -165,13 +165,24 @@ enum { #define comp_cl_dbg(drv_p, __e, ...) LOG_DBG(__e, ##__VA_ARGS__) /* device level tracing */ -#define comp_err(comp_p, __e, ...) LOG_ERR(__e, ##__VA_ARGS__) -#define comp_warn(comp_p, __e, ...) LOG_WRN(__e, ##__VA_ARGS__) +#if CONFIG_IPC_MAJOR_4 +#define __COMP_FMT "comp:%u %#x " +#else +#define __COMP_FMT "comp:%u.%u " +#endif -#define comp_info(comp_p, __e, ...) LOG_INF(__e, ##__VA_ARGS__) +#define comp_err(comp_p, __e, ...) LOG_ERR(__COMP_FMT __e, trace_comp_get_id(comp_p), \ + trace_comp_get_subid(comp_p), ##__VA_ARGS__) -#define comp_dbg(comp_p, __e, ...) LOG_DBG(__e, ##__VA_ARGS__) +#define comp_warn(comp_p, __e, ...) LOG_WRN(__COMP_FMT __e, trace_comp_get_id(comp_p), \ + trace_comp_get_subid(comp_p), ##__VA_ARGS__) + +#define comp_info(comp_p, __e, ...) LOG_INF(__COMP_FMT __e, trace_comp_get_id(comp_p), \ + trace_comp_get_subid(comp_p), ##__VA_ARGS__) + +#define comp_dbg(comp_p, __e, ...) LOG_DBG(__COMP_FMT __e, trace_comp_get_id(comp_p), \ + trace_comp_get_subid(comp_p), ##__VA_ARGS__) #else /* class (driver) level (no device object) tracing */