6#ifndef ZEPHYR_INCLUDE_LOGGING_LOG_LINK_H_
7#define ZEPHYR_INCLUDE_LOGGING_LOG_LINK_H_
43 char *buf,
size_t *length);
45 uint16_t source_id,
char *buf,
size_t *length);
56 (CONFIG_LOG_REMOTE_DOMAIN_MAX_COUNT),
86#define LOG_LINK_DEF(_name, _api, _buf_wlen, _ctx) \
87 static uint32_t __aligned(Z_LOG_MSG_ALIGNMENT) _name##_buf32[_buf_wlen]; \
88 static const struct mpsc_pbuf_buffer_config _name##_mpsc_pbuf_config = { \
89 .buf = (uint32_t *)_name##_buf32, \
91 .notify_drop = z_log_notify_drop, \
92 .get_wlen = log_msg_generic_get_wlen, \
93 .flags = IS_ENABLED(CONFIG_LOG_MODE_OVERFLOW) ? \
94 MPSC_PBUF_MODE_OVERWRITE : 0 \
96 COND_CODE_0(_buf_wlen, (), (static STRUCT_SECTION_ITERABLE(log_msg_ptr, \
97 _name##_log_msg_ptr);)) \
98 static STRUCT_SECTION_ITERABLE_ALTERNATE(log_mpsc_pbuf, \
100 _name##_log_mpsc_pbuf); \
101 static struct log_link_ctrl_blk _name##_ctrl_blk; \
102 static const STRUCT_SECTION_ITERABLE(log_link, _name) = \
105 .name = STRINGIFY(_name), \
106 .ctrl_blk = &_name##_ctrl_blk, \
108 .mpsc_pbuf = _buf_wlen ? &_name##_log_mpsc_pbuf : NULL, \
109 .mpsc_pbuf_config = _buf_wlen ? &_name##_mpsc_pbuf_config : NULL \
126 __ASSERT_NO_MSG(link);
144 __ASSERT_NO_MSG(link);
169 __ASSERT_NO_MSG(link);
184 __ASSERT_NO_MSG(link);
205 __ASSERT_NO_MSG(link);
224 char *
buf,
size_t *length)
226 __ASSERT_NO_MSG(link);
227 __ASSERT_NO_MSG(
buf);
247 __ASSERT_NO_MSG(link);
250 level, runtime_level);
266 __ASSERT_NO_MSG(link);
267 __ASSERT_NO_MSG(level);
282void z_log_msg_enqueue(
const struct log_link *link,
const void *
data,
size_t len);
static int log_link_get_levels(const struct log_link *link, uint32_t domain_id, uint16_t source_id, uint8_t *level, uint8_t *runtime_level)
Get level settings of the given source.
Definition log_link.h:243
static int log_link_get_domain_name(const struct log_link *link, uint32_t domain_id, char *buf, size_t *length)
Get domain name.
Definition log_link.h:201
static int log_link_activate(const struct log_link *link)
Activate log link.
Definition log_link.h:142
static int log_link_set_runtime_level(const struct log_link *link, uint32_t domain_id, uint16_t source_id, uint8_t level)
Set runtime level of the given source.
Definition log_link.h:262
void(* log_link_dropped_cb_t)(const struct log_link *link, uint32_t dropped)
Definition log_link.h:31
static uint16_t log_link_sources_count(const struct log_link *link, uint32_t domain_id)
Get number of sources in the domain.
Definition log_link.h:181
static int log_link_is_active(const struct log_link *link)
Check if link is activated.
Definition log_link.h:156
static uint8_t log_link_domains_count(const struct log_link *link)
Get number of domains in the link.
Definition log_link.h:167
static int log_link_get_source_name(const struct log_link *link, uint32_t domain_id, uint16_t source_id, char *buf, size_t *length)
Get source name.
Definition log_link.h:222
void(* log_link_callback_t)(const struct log_link *link, union log_msg_generic *msg)
Definition log_link.h:28
static int log_link_initiate(const struct log_link *link, struct log_link_config *config)
Initiate log link.
Definition log_link.h:123
#define COND_CODE_1(_flag, _if_1_code, _else_code)
Insert code depending on whether _flag expands to 1 or not.
Definition util_macro.h:179
#define EINPROGRESS
Operation now in progress.
Definition errno.h:103
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
int(* activate)(const struct log_link *link)
Definition log_link.h:41
int(* get_source_name)(const struct log_link *link, uint32_t domain_id, uint16_t source_id, char *buf, size_t *length)
Definition log_link.h:44
int(* get_domain_name)(const struct log_link *link, uint32_t domain_id, char *buf, size_t *length)
Definition log_link.h:42
int(* initiate)(const struct log_link *link, struct log_link_config *config)
Definition log_link.h:40
int(* set_runtime_level)(const struct log_link *link, uint32_t domain_id, uint16_t source_id, uint8_t level)
Definition log_link.h:49
int(* get_levels)(const struct log_link *link, uint32_t domain_id, uint16_t source_id, uint8_t *level, uint8_t *runtime_level)
Definition log_link.h:46
log_link_dropped_cb_t dropped_cb
Definition log_link.h:36
log_link_callback_t msg_cb
Definition log_link.h:35
uint32_t * filters
Definition log_link.h:59
uint16_t source_cnt[1+COND_CODE_1(CONFIG_LOG_MULTIDOMAIN,(CONFIG_LOG_REMOTE_DOMAIN_MAX_COUNT),(0))]
Definition log_link.h:57
uint32_t domain_offset
Definition log_link.h:58
uint32_t domain_cnt
Definition log_link.h:54
void * ctx
Definition log_link.h:66
const struct log_link_api * api
Definition log_link.h:63
const struct mpsc_pbuf_buffer_config * mpsc_pbuf_config
Definition log_link.h:68
const char * name
Definition log_link.h:64
struct log_link_ctrl_blk * ctrl_blk
Definition log_link.h:65
struct mpsc_pbuf_buffer * mpsc_pbuf
Definition log_link.h:67
MPSC packet buffer configuration.
Definition mpsc_pbuf.h:131
uint32_t * buf
Definition mpsc_pbuf.h:133
MPSC packet buffer structure.
Definition mpsc_pbuf.h:90
static fdata_t data[2]
Definition test_fifo_contexts.c:15
static void msg(uint64_t c64)
Definition main.c:17