Loading...
Searching...
No Matches
Go to the documentation of this file.
8#ifndef __SOF_AUDIO_PIPELINE_TRACE_H__
9#define __SOF_AUDIO_PIPELINE_TRACE_H__
12#include <sof/trace/trace.h>
21#define trace_pipe_get_tr_ctx(pipe_p) (&(pipe_p)->tctx)
22#define trace_pipe_get_id(pipe_p) ((pipe_p)->pipeline_id)
23#define trace_pipe_get_subid(pipe_p) ((pipe_p)->comp_id)
27#define pipe_cl_err(__e, ...) \
28 tr_err(&pipe_tr, __e, ##__VA_ARGS__)
30#define pipe_cl_warn(__e, ...) \
31 tr_warn(&pipe_tr, __e, ##__VA_ARGS__)
33#define pipe_cl_info(__e, ...) \
34 tr_info(&pipe_tr, __e, ##__VA_ARGS__)
36#define pipe_cl_dbg(__e, ...) \
37 tr_dbg(&pipe_tr, __e, ##__VA_ARGS__)
40#if defined(__ZEPHYR__) && defined(CONFIG_ZEPHYR_LOG)
43#define __PIPE_FMT "pipe:%u %#x "
45#define __PIPE_FMT "pipe:%u.%u "
48#define pipe_err(pipe_p, __e, ...) LOG_ERR(__PIPE_FMT __e, trace_pipe_get_id(pipe_p), \
49 trace_pipe_get_subid(pipe_p), ##__VA_ARGS__)
51#define pipe_warn(pipe_p, __e, ...) LOG_WRN(__PIPE_FMT __e, trace_pipe_get_id(pipe_p), \
52 trace_pipe_get_subid(pipe_p), ##__VA_ARGS__)
54#define pipe_info(pipe_p, __e, ...) LOG_INF(__PIPE_FMT __e, trace_pipe_get_id(pipe_p), \
55 trace_pipe_get_subid(pipe_p), ##__VA_ARGS__)
57#define pipe_dbg(pipe_p, __e, ...) LOG_DBG(__PIPE_FMT __e, trace_pipe_get_id(pipe_p), \
58 trace_pipe_get_subid(pipe_p), ##__VA_ARGS__)
62#if defined(__ZEPHYR__) && defined(CONFIG_SOF_USERSPACE_LL)
63#error "Invalid build config: User-space cannot access trace context."
66#define pipe_err(pipe_p, __e, ...) \
67 trace_dev_err(trace_pipe_get_tr_ctx, trace_pipe_get_id, \
68 trace_pipe_get_subid, pipe_p, __e, ##__VA_ARGS__)
70#define pipe_warn(pipe_p, __e, ...) \
71 trace_dev_warn(trace_pipe_get_tr_ctx, trace_pipe_get_id, \
72 trace_pipe_get_subid, pipe_p, __e, ##__VA_ARGS__)
74#define pipe_info(pipe_p, __e, ...) \
75 trace_dev_info(trace_pipe_get_tr_ctx, trace_pipe_get_id, \
76 trace_pipe_get_subid, pipe_p, __e, ##__VA_ARGS__)
78#define pipe_dbg(pipe_p, __e, ...) \
79 trace_dev_dbg(trace_pipe_get_tr_ctx, trace_pipe_get_id, \
80 trace_pipe_get_subid, pipe_p, __e, ##__VA_ARGS__)