6#ifndef ZEPHYR_INCLUDE_LOGGING_LOG_INSTANCE_H_
7#define ZEPHYR_INCLUDE_LOGGING_LOG_INSTANCE_H_
39#if defined(CONFIG_64BIT)
51#define Z_LOG_ITEM_CONST_DATA(_name) UTIL_CAT(log_const_, _name)
64#define Z_LOG_CONST_ITEM_REGISTER(_name, _str_name, _level) \
65 const STRUCT_SECTION_ITERABLE_ALTERNATE(log_const, \
66 log_source_const_data, \
67 Z_LOG_ITEM_CONST_DATA(_name)) = \
81#define LOG_OBJECT_PTR_INIT(_name, _object) \
82 IF_ENABLED(CONFIG_LOG, (._name = _object,))
88#define Z_LOG_INSTANCE_FULL_NAME(_module_name, _inst_name) \
89 UTIL_CAT(_module_name, UTIL_CAT(_, _inst_name))
100#define Z_LOG_OBJECT_PTR(_name) \
101 COND_CODE_1(CONFIG_LOG_RUNTIME_FILTERING, \
102 (&LOG_ITEM_DYNAMIC_DATA(_name)), \
103 (&Z_LOG_ITEM_CONST_DATA(_name))) \
114#define LOG_INSTANCE_PTR(_module_name, _inst_name) \
115 Z_LOG_OBJECT_PTR(Z_LOG_INSTANCE_FULL_NAME(_module_name, _inst_name))
129#define LOG_INSTANCE_PTR_INIT(_name, _module_name, _inst_name) \
130 LOG_OBJECT_PTR_INIT(_name, LOG_INSTANCE_PTR(_module_name, _inst_name))
132#define Z_LOG_INSTANCE_STRUCT \
133 COND_CODE_1(CONFIG_LOG_RUNTIME_FILTERING, \
134 (struct log_source_dynamic_data), \
135 (const struct log_source_const_data))
147#define LOG_INSTANCE_PTR_DECLARE(_name) \
148 COND_CODE_1(CONFIG_LOG, (Z_LOG_INSTANCE_STRUCT * _name), \
149 (int _name[TOOLCHAIN_HAS_ZLA ? 0 : 1]))
151#define Z_LOG_RUNTIME_INSTANCE_REGISTER(_module_name, _inst_name) \
152 STRUCT_SECTION_ITERABLE_ALTERNATE(log_dynamic, log_source_dynamic_data, \
153 LOG_INSTANCE_DYNAMIC_DATA(_module_name, _inst_name))
155#define Z_LOG_INSTANCE_REGISTER(_module_name, _inst_name, _level) \
156 Z_LOG_CONST_ITEM_REGISTER( \
157 Z_LOG_INSTANCE_FULL_NAME(_module_name, _inst_name), \
158 STRINGIFY(_module_name._inst_name), \
160 IF_ENABLED(CONFIG_LOG_RUNTIME_FILTERING, \
161 (Z_LOG_RUNTIME_INSTANCE_REGISTER(_module_name, _inst_name)))
174#define LOG_INSTANCE_REGISTER(_module_name, _inst_name, _level) \
175 IF_ENABLED(CONFIG_LOG, (Z_LOG_INSTANCE_REGISTER(_module_name, _inst_name, _level)))
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
Constant data associated with the source of log messages.
Definition: log_instance.h:17
uint8_t level
Definition: log_instance.h:19
const char * name
Definition: log_instance.h:18
Dynamic data associated with the source of log messages.
Definition: log_instance.h:30
uint32_t filters
Definition: log_instance.h:31