meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| embedded:nordic:sdk5:log [2024/10/14 21:59] – niziak | embedded:nordic:sdk5:log [2024/10/24 11:26] (current) – niziak | ||
|---|---|---|---|
| Line 16: | Line 16: | ||
| * filters: check if module log level and log entry severity level matches | * filters: check if module log level and log entry severity level matches | ||
| * if log entry should be send to backend - call '' | * if log entry should be send to backend - call '' | ||
| - | * **BACKEND: | + | * **BACKEND: |
| * '' | * '' | ||
| Line 64: | Line 64: | ||
| * Circular buffer of **NRF_LOG_BUFSIZE (1024)**: | * Circular buffer of **NRF_LOG_BUFSIZE (1024)**: | ||
| - | * Its aim is to store log entry from app as fast as poosible | + | * Its aim is to store log entry from app as fast as possible |
| * DEFERRED: should be big enough to store all log entries until apps calls log to be processed. | * DEFERRED: should be big enough to store all log entries until apps calls log to be processed. | ||
| * Dynamic memory pool: | * Dynamic memory pool: | ||
| Line 73: | Line 73: | ||
| * It looks like to be designed for background backends. Counting semaphore will keep object locked until all backends finish. | * It looks like to be designed for background backends. Counting semaphore will keep object locked until all backends finish. | ||
| * Background backends: | * Background backends: | ||
| - | * ??? | + | * **NRF_CLI_LOG_BACKEND** |
| * Backends are using temporary string buffers - this is the real place where printf-like function writes generated strings. | * Backends are using temporary string buffers - this is the real place where printf-like function writes generated strings. | ||
| * '' | * '' | ||
| Line 90: | Line 90: | ||
| * '' | * '' | ||
| - | * printf-like processing | + | |
| - | * memobj with log entry is released ('' | + | |
| + | * memobj with log entry is released ('' | ||
| * CLI: | * CLI: | ||
| - | * memobj is not released. '' | + | * memobj is not released. '' |
| - | * '' | + | * own **queue** size is defined by '' |
| + | * '' | ||
| * '' | * '' | ||
| * RTT: empty | * RTT: empty | ||
| Line 100: | Line 102: | ||
| * '' | * '' | ||
| * CLI: '' | * CLI: '' | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * result of processing is passed to printf-like writer '' | ||
| + | * '' | ||
| + | * cli_uart_write puts data to UART TX ringbuffer defined by macro NRF_CLI_UART_DEF | ||
| + | |||
| + | ===== using CLI and deferred log ===== | ||
| + | |||
| + | SUMMARY: | ||
| + | * app logs data and metadata to ringbuffer: '' | ||
| + | * app idle calls: '' | ||
| + | * if dynamic log levels enabled it filter what to log | ||
| + | * it copies entries from ringbuffer to memobj (dynamic memory of size '' | ||
| + | * each one memobj log entry is passed to all active backends (multiple reference locking possible by counting semaphore) | ||
| + | * UART backend: it process log entry (printf-like formatting) and put it in UART TX buffer. Memobj log entry is released. | ||
| + | * RTT backend: it process log entry (printf-like formatting) and put it in RTT buffer. Memobj log entry is released. | ||
| + | * CLI backend: it puts log entry into own queue. Memobj log entry is **NOT released**. | ||
| + | * **conclusion**: | ||
| + | * **conclusion**: | ||
| + | * app idle calls: '' | ||
| + | * whole queue is processed in loop | ||
| + | * each memobj log entry is processed (printf-like formatting) and put into UART TX ring buffer (size defined by '' | ||
| + | |||