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

sys/log: Add optional support for sector bookmarks to optimize reading logs #3365

Merged
merged 9 commits into from
Mar 13, 2025

Conversation

vrahane
Copy link
Contributor

@vrahane vrahane commented Jan 30, 2025

  • This adds sector bookmarks for reading optimization, earlier only absolute bookmarks were supported
  • Retain older absolute bookmarks behavior. Added a syscfg for specifying number of absolute bookmarks.
  • Added a syscfg to optionally enable sector bookmarks.
  • CLI: Add '-i' option in log_shell for specifying index where log read should start
  • CLI: Add '-b' option in log_shell for reading bookmarks

For mixed bookmarks:

  • Sector bookmarks are from 0 -> sector_cnt of the flash area in the array.
  • Non-sector/Absolute bookmarks are from sector_cnt -> LOG_FCB_NUM_ABS_BMARKS (2 by default)

Several tests were performed:

  • Reboot test, bookmarks should get reset
  • New log entries populate the bookmarks, specially for sector boundaries
  • Test absolute bookmarks behavior, both with mixed bookmarks (sector + absolute) as well as just absolute bookmarks with sector bookmarks disabled

@vrahane vrahane changed the title sys/log: Add bookmarks per sector to optimize reading logs sys/log: Add optional support for sector bookmarks to optimize reading logs Jan 30, 2025
@vrahane vrahane force-pushed the vipul/bmarks branch 3 times, most recently from bf7d968 to efdadf6 Compare January 30, 2025 22:45
@github-actions github-actions bot added size/l and removed size/m labels Jan 30, 2025
@vrahane vrahane force-pushed the vipul/bmarks branch 8 times, most recently from 0e3bcee to 142177c Compare February 14, 2025 02:52
Copy link
Contributor

@kasjer kasjer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Code will not build for FCB2
  • It's not clear how to choose size for bookmarks array
  • If suggested size is around number of sector of the FCB flash area, RAM usage can be an issue. For 384 sectors' FCB RAM usage is over 12KB
  • There are places that use code and RAM space even if no bookmarks/sector-bookmarks are enabled

@vrahane vrahane force-pushed the vipul/bmarks branch 4 times, most recently from 3bcb976 to 8f26895 Compare February 15, 2025 02:57
@vrahane vrahane requested a review from kasjer February 15, 2025 10:34
@vrahane vrahane force-pushed the vipul/bmarks branch 4 times, most recently from 9611300 to bd77e1c Compare February 17, 2025 20:43
@vrahane
Copy link
Contributor Author

vrahane commented Mar 5, 2025

Note: The style check incorrectly flags the unit test functions. It does not understand that its a function, it thinks its a code block.

@vrahane vrahane force-pushed the vipul/bmarks branch 4 times, most recently from 718acc3 to b06037e Compare March 6, 2025 21:41
@vrahane vrahane requested a review from kasjer March 6, 2025 21:43
vrahane added 2 commits March 6, 2025 13:48
- Add sector bookmarks for reading optimization
- Retain older absolute bookmarks behavior
- CLI: Add '-t' option in log_shell for measuring read time (cherry-picking Jerzy's
commit)
- CLI: Add '-b' option in log_shell for reading bookmarks
@vrahane vrahane force-pushed the vipul/bmarks branch 6 times, most recently from 2a90f33 to c78d238 Compare March 8, 2025 02:25
@sjanc
Copy link
Contributor

sjanc commented Mar 11, 2025

Note: The style check incorrectly flags the unit test functions. It does not understand that its a function, it thinks its a code block.

yes, there are couple of uncrustify config tuning needed that I haven't figure out yet (especially those related to macros as in here). So we hit false-positive with this from time to time...

- Fix build, address some review comments
@sjanc sjanc merged commit 5979560 into apache:master Mar 13, 2025
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants