component: add pipeline and component ids to comp_foo() output for Zephyr

The component and pipeline identifiers were direct part of the older
SOF dictionary format. This information was added directly to encoded
output and was not part of the log message. When using Zephyr logging
subsystem, this type of audio specific information has be to put
as part of the log messages like any other log content.

Modify comp_{err,warn,info,dbg} macros to add component pipeline
and component identifiers to all printed log messages.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
This commit is contained in:
Kai Vehmanen 2022-10-10 16:29:45 +03:00 committed by Kai Vehmanen
parent de739dd89c
commit cef9544f06
1 changed files with 15 additions and 4 deletions

View File

@ -165,13 +165,24 @@ enum {
#define comp_cl_dbg(drv_p, __e, ...) LOG_DBG(__e, ##__VA_ARGS__) #define comp_cl_dbg(drv_p, __e, ...) LOG_DBG(__e, ##__VA_ARGS__)
/* device level tracing */ /* 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 #else
/* class (driver) level (no device object) tracing */ /* class (driver) level (no device object) tracing */