Zephyr API 3.6.99
|
Log link API . More...
Data Structures | |
struct | log_link_config |
struct | log_link_api |
struct | log_link_ctrl_blk |
struct | log_link |
Macros | |
#define | LOG_LINK_DEF(_name, _api, _buf_wlen, _ctx) |
Create instance of a log link. | |
Typedefs | |
typedef void(* | log_link_callback_t) (const struct log_link *link, union log_msg_generic *msg) |
typedef void(* | log_link_dropped_cb_t) (const struct log_link *link, uint32_t dropped) |
Functions | |
static int | log_link_initiate (const struct log_link *link, struct log_link_config *config) |
Initiate log link. | |
static int | log_link_activate (const struct log_link *link) |
Activate log link. | |
static int | log_link_is_active (const struct log_link *link) |
Check if link is activated. | |
static uint8_t | log_link_domains_count (const struct log_link *link) |
Get number of domains in the link. | |
static uint16_t | log_link_sources_count (const struct log_link *link, uint32_t domain_id) |
Get number of sources in the domain. | |
static int | log_link_get_domain_name (const struct log_link *link, uint32_t domain_id, char *buf, size_t *length) |
Get domain name. | |
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. | |
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. | |
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. | |
Log link API .
#define LOG_LINK_DEF | ( | _name, | |
_api, | |||
_buf_wlen, | |||
_ctx ) |
#include <zephyr/logging/log_link.h>
Create instance of a log link.
Link can have dedicated buffer for messages if _buf_len
is positive. In that case messages will be processed in an order since logging core will attempt to fetch message from all available buffers (default and links) and process the one with the earliest timestamp. If strict ordering is not needed then dedicated buffer may be omitted (_buf_len
set to 0). That results in better memory utilization but unordered messages passed to backends.
_name | Instance name. |
_api | API list. See log_link_api. |
_buf_wlen | Size (in words) of dedicated buffer for messages from this buffer. If 0 default buffer is used. |
_ctx | Context (void *) associated with the link. |
typedef void(* log_link_callback_t) (const struct log_link *link, union log_msg_generic *msg) |
#include <zephyr/logging/log_link.h>
#include <zephyr/logging/log_link.h>
|
inlinestatic |
#include <zephyr/logging/log_link.h>
Activate log link.
Function checks if link is initialized and completes initialization process. When successfully returns, link is ready with domain and sources count fetched and timestamp details updated.
link | Log link instance. |
0 | When successfully activated. |
-EINPROGRESS | Activation in progress. |
#include <zephyr/logging/log_link.h>
Get number of domains in the link.
[in] | link | Log link instance. |
|
inlinestatic |
#include <zephyr/logging/log_link.h>
Get domain name.
[in] | link | Log link instance. |
[in] | domain_id | Relative domain ID. |
[out] | buf | Output buffer filled with domain name. If NULL then name length is returned. |
[in,out] | length | Buffer size. Name is trimmed if it does not fit in the buffer and field is set to actual name length. |
|
inlinestatic |
#include <zephyr/logging/log_link.h>
Get level settings of the given source.
[in] | link | Log link instance. |
[in] | domain_id | Relative domain ID. |
[in] | source_id | Source ID. |
[out] | level | Location to store requested compile time level. |
[out] | runtime_level | Location to store requested runtime time level. |
|
inlinestatic |
#include <zephyr/logging/log_link.h>
Get source name.
[in] | link | Log link instance. |
[in] | domain_id | Relative domain ID. |
[in] | source_id | Source ID. |
[out] | buf | Output buffer filled with source name. |
[in,out] | length | Buffer size. Name is trimmed if it does not fit in the buffer and field is set to actual name length. |
|
inlinestatic |
#include <zephyr/logging/log_link.h>
Initiate log link.
Function initiates the link. Since initialization procedure may be time consuming, function returns before link is ready to not block logging initialization. log_link_activate is called to complete link initialization.
link | Log link instance. |
config | Configuration. |
|
inlinestatic |
#include <zephyr/logging/log_link.h>
Check if link is activated.
link | Log link instance. |
0 | When successfully activated. |
-EINPROGRESS | Activation in progress. |
|
inlinestatic |
#include <zephyr/logging/log_link.h>
Set runtime level of the given source.
[in] | link | Log link instance. |
[in] | domain_id | Relative domain ID. |
[in] | source_id | Source ID. |
[out] | level | Requested level. |
|
inlinestatic |
#include <zephyr/logging/log_link.h>
Get number of sources in the domain.
[in] | link | Log link instance. |
[in] | domain_id | Relative domain ID. |