6#ifndef ZEPHYR_INCLUDE_LOGGING_LOG_INSTANCE_H_
7#define ZEPHYR_INCLUDE_LOGGING_LOG_INSTANCE_H_
38#if defined(CONFIG_RISCV) && defined(CONFIG_64BIT)
48#define LOG_ITEM_CONST_DATA(_name) UTIL_CAT(log_const_, _name)
50#define Z_LOG_CONST_ITEM_REGISTER(_name, _str_name, _level) \
51 const struct log_source_const_data LOG_ITEM_CONST_DATA(_name) \
52 __attribute__ ((section("." STRINGIFY(LOG_ITEM_CONST_DATA(_name))))) \
53 __attribute__((used)) = { \
75#define LOG_INSTANCE_FULL_NAME(_module_name, _inst_name) \
76 UTIL_CAT(_module_name, UTIL_CAT(_, _inst_name))
78#if defined(CONFIG_LOG_RUNTIME_FILTERING)
79#define LOG_INSTANCE_PTR_DECLARE(_name) \
80 struct log_source_dynamic_data *_name
82#define LOG_INSTANCE_REGISTER(_module_name, _inst_name, _level) \
83 Z_LOG_CONST_ITEM_REGISTER( \
84 LOG_INSTANCE_FULL_NAME(_module_name, _inst_name), \
85 STRINGIFY(_module_name._inst_name), \
87 struct log_source_dynamic_data LOG_INSTANCE_DYNAMIC_DATA( \
88 _module_name, _inst_name) \
89 __attribute__ ((section("." STRINGIFY( \
90 LOG_INSTANCE_DYNAMIC_DATA(_module_name, \
93 ))) __attribute__((used))
95#define LOG_INSTANCE_PTR_INIT(_name, _module_name, _inst_name) \
96 ._name = &LOG_ITEM_DYNAMIC_DATA( \
97 LOG_INSTANCE_FULL_NAME(_module_name, _inst_name)),
100#define LOG_INSTANCE_PTR_DECLARE(_name) \
101 const struct log_source_const_data *_name
103#define LOG_INSTANCE_REGISTER(_module_name, _inst_name, _level) \
104 Z_LOG_CONST_ITEM_REGISTER( \
105 LOG_INSTANCE_FULL_NAME(_module_name, _inst_name), \
106 STRINGIFY(_module_name._inst_name), \
110#define LOG_INSTANCE_PTR_INIT(_name, _module_name, _inst_name) \
111 ._name = &LOG_ITEM_CONST_DATA( \
112 LOG_INSTANCE_FULL_NAME(_module_name, _inst_name)),
116#define LOG_INSTANCE_PTR_DECLARE(_name)
117#define LOG_INSTANCE_REGISTER(_module_name, _inst_name, _level)
118#define LOG_INSTANCE_PTR_INIT(_name, _module_name, _inst_name)
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58
Constant data associated with the source of log messages.
Definition: log_instance.h:16
uint8_t level
Definition: log_instance.h:18
const char * name
Definition: log_instance.h:17
Dynamic data associated with the source of log messages.
Definition: log_instance.h:29
uint32_t filters
Definition: log_instance.h:30