|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
Interface for log links bringing in messages from remote domains. More...
Files | |
| file | log_link.h |
| Header file for the log link interface. | |
Data Structures | |
| struct | log_link_config |
| Log link configuration passed to the link at initiation time. More... | |
| struct | log_link_api |
| Log link API. More... | |
| struct | log_link_ctrl_blk |
| Run-time control block for a Log links instance. More... | |
| struct | log_link |
| Log link instance. More... | |
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) |
| Callback invoked by a link for each received log message. | |
| typedef void(* | log_link_dropped_cb_t) (const struct log_link *link, uint32_t dropped) |
| Callback invoked by a link to report dropped messages. | |
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. | |
Interface for log links bringing in messages from remote domains.
| #define LOG_LINK_DEF | ( | _name, | |
| _api, | |||
| _buf_wlen, | |||
| _ctx ) |
#include <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 <log_link.h>
Callback invoked by a link for each received log message.
| link | Link instance. |
| msg | Message received from the remote domain. |
#include <log_link.h>
Callback invoked by a link to report dropped messages.
| link | Link instance. |
| dropped | Number of messages dropped since the previous notification. |
|
inlinestatic |
#include <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 <log_link.h>
Get number of domains in the link.
| [in] | link | Log link instance. |
|
inlinestatic |
#include <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 <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 <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 <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 <log_link.h>
Check if link is activated.
| link | Log link instance. |
| 0 | When successfully activated. |
| -EINPROGRESS | Activation in progress. |
|
inlinestatic |
#include <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. |
| [in] | level | Requested level. |
#include <log_link.h>
Get number of sources in the domain.
| [in] | link | Log link instance. |
| [in] | domain_id | Relative domain ID. |