Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Task] - LogKit - Configure FIFO buffer at compile time #1143

Open
2 tasks
ladislas opened this issue Nov 18, 2022 · 0 comments
Open
2 tasks

[Task] - LogKit - Configure FIFO buffer at compile time #1143

ladislas opened this issue Nov 18, 2022 · 0 comments
Assignees
Labels
01 - type: task Something to do

Comments

@ladislas
Copy link
Member

Description

Following #1142, fifo buffer size of logger went from 4096 bytes to 8192 bytes.

This was done because, even if it seems big, 4096 bytes/characters can fill up pretty quickly.

As and example:

  • spikes/lk_log_kit

    • pushes 5074 bytes in the fifo buffer in ~1ms (!)
    • outputs the content to serial in 446 ms (!), around 12 Bytes/ms or 12kB/s
  • functional/tests/boost_ut test report was bigger than 4096 characters and was thus truncated at the beginning

But a big fifo buffer is not always a good thing:

  • for the bootloader, logging is scarce and space very limited
  • for the os, we still have plenty of space but this might evolve in the future

The goal is thus to have the size of the buffer configured at compile time to better suit the need of the user.

It has its challenges as different parts (bootloader/os) might need different sizes and we don't want to recompile everything just for that.

Related epic/story/task:

Subtasks

  • investigate buffer size for different targets
  • choose buffer size of bootloader, os, the rest

Misc

Log output:

000:00:03.000 [DBUG] [utils.cpp:15] log_thread_debug > Run debug number: 1
000:00:03.000 [DBUG] [utils.cpp:16] log_thread_debug > First: debug message
000:00:03.000 [INFO] [utils.cpp:17] log_thread_debug > Second: information message
000:00:03.000 [ERR ] [utils.cpp:18] log_thread_debug > Third: error message
Fourth: free formatting log message with line break
Fifth : a low level log using pointer and size
000:00:03.000 [INFO] [utils.cpp:23] log_thread_debug > Total time to log the 6 messages --> 0ms

000:00:03.000 [DBUG] [utils.cpp:15] log_thread_debug > Run debug number: 2
000:00:03.000 [DBUG] [utils.cpp:16] log_thread_debug > First: debug message
000:00:03.000 [INFO] [utils.cpp:17] log_thread_debug > Second: information message
000:00:03.000 [ERR ] [utils.cpp:18] log_thread_debug > Third: error message
Fourth: free formatting log message with line break
Fifth : a low level log using pointer and size
000:00:03.000 [INFO] [utils.cpp:23] log_thread_debug > Total time to log the 6 messages --> 0ms

000:00:03.000 [DBUG] [utils.cpp:15] log_thread_debug > Run debug number: 3
000:00:03.000 [DBUG] [utils.cpp:16] log_thread_debug > First: debug message
000:00:03.000 [INFO] [utils.cpp:17] log_thread_debug > Second: information message
000:00:03.000 [ERR ] [utils.cpp:18] log_thread_debug > Third: error message
Fourth: free formatting log message with line break
Fifth : a low level log using pointer and size
000:00:03.000 [INFO] [utils.cpp:23] log_thread_debug > Total time to log the 6 messages --> 0ms

000:00:03.000 [DBUG] [utils.cpp:15] log_thread_debug > Run debug number: 4
000:00:03.000 [DBUG] [utils.cpp:16] log_thread_debug > First: debug message
000:00:03.000 [INFO] [utils.cpp:17] log_thread_debug > Second: information message
000:00:03.000 [ERR ] [utils.cpp:18] log_thread_debug > Third: error message
Fourth: free formatting log message with line break
Fifth : a low level log using pointer and size
000:00:03.000 [INFO] [utils.cpp:23] log_thread_debug > Total time to log the 6 messages --> 0ms

000:00:03.000 [DBUG] [utils.cpp:15] log_thread_debug > Run debug number: 5
000:00:03.000 [DBUG] [utils.cpp:16] log_thread_debug > First: debug message
000:00:03.000 [INFO] [utils.cpp:17] log_thread_debug > Second: information message
000:00:03.000 [ERR ] [utils.cpp:18] log_thread_debug > Third: error message
Fourth: free formatting log message with line break
Fifth : a low level log using pointer and size
000:00:03.001 [INFO] [utils.cpp:23] log_thread_debug > Total time to log the 6 messages --> 1ms

000:00:03.001 [DBUG] [utils.cpp:15] log_thread_debug > Run debug number: 6
000:00:03.001 [DBUG] [utils.cpp:16] log_thread_debug > First: debug message
000:00:03.001 [INFO] [utils.cpp:17] log_thread_debug > Second: information message
000:00:03.001 [ERR ] [utils.cpp:18] log_thread_debug > Third: error message
Fourth: free formatting log message with line break
Fifth : a low level log using pointer and size
000:00:03.001 [INFO] [utils.cpp:23] log_thread_debug > Total time to log the 6 messages --> 0ms

000:00:03.001 [DBUG] [utils.cpp:15] log_thread_debug > Run debug number: 7
000:00:03.001 [DBUG] [utils.cpp:16] log_thread_debug > First: debug message
000:00:03.001 [INFO] [utils.cpp:17] log_thread_debug > Second: information message
000:00:03.001 [ERR ] [utils.cpp:18] log_thread_debug > Third: error message
Fourth: free formatting log message with line break
Fifth : a low level log using pointer and size
000:00:03.001 [INFO] [utils.cpp:23] log_thread_debug > Total time to log the 6 messages --> 0ms

000:00:03.001 [DBUG] [utils.cpp:15] log_thread_debug > Run debug number: 8
000:00:03.001 [DBUG] [utils.cpp:16] log_thread_debug > First: debug message
000:00:03.001 [INFO] [utils.cpp:17] log_thread_debug > Second: information message
000:00:03.001 [ERR ] [utils.cpp:18] log_thread_debug > Third: error message
Fourth: free formatting log message with line break
Fifth : a low level log using pointer and size
000:00:03.001 [INFO] [utils.cpp:23] log_thread_debug > Total time to log the 6 messages --> 0ms

000:00:03.001 [DBUG] [utils.cpp:15] log_thread_debug > Run debug number: 9
000:00:03.001 [DBUG] [utils.cpp:16] log_thread_debug > First: debug message
000:00:03.001 [INFO] [utils.cpp:17] log_thread_debug > Second: information message
000:00:03.001 [ERR ] [utils.cpp:18] log_thread_debug > Third: error message
Fourth: free formatting log message with line break
Fifth : a low level log using pointer and size
000:00:03.001 [INFO] [utils.cpp:23] log_thread_debug > Total time to log the 6 messages --> 0ms

000:00:03.001 [DBUG] [utils.cpp:15] log_thread_debug > Run debug number: 10
000:00:03.001 [DBUG] [utils.cpp:16] log_thread_debug > First: debug message
000:00:03.001 [INFO] [utils.cpp:17] log_thread_debug > Second: information message
000:00:03.001 [ERR ] [utils.cpp:18] log_thread_debug > Third: error message
Fourth: free formatting log message with line break
Fifth : a low level log using pointer and size
000:00:03.001 [INFO] [utils.cpp:23] log_thread_debug > Total time to log the 6 messages --> 0ms

000:00:03.001 [INFO] [utils.cpp:28] log_thread_debug > Total time to LOG the for loop --> 1ms
@ladislas ladislas added the 01 - type: task Something to do label Nov 18, 2022
@ladislas ladislas added this to the Future Release milestone Nov 18, 2022
@ladislas ladislas self-assigned this Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
01 - type: task Something to do
Projects
None yet
Development

No branches or pull requests

1 participant