You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/11/15 14:11:28 UTC

[GitHub] [mynewt-core] kasjer opened a new pull request #2096: sys/log: Add persistent log index

kasjer opened a new pull request #2096: sys/log: Add persistent log index
URL: https://github.com/apache/mynewt-core/pull/2096
 
 
   It may be useful to keep log index even if after factory reset.
   
   On startup:
   A. (As usual) Firmware scans all persistent logs to determine the next available index.
   B. Firmware reads the persistent_index value from flash, if available.
   C. The next_index RAM variable is set to the greater of these two values.
   
   On each log write:
   1. Compare the next_index variable to persistent_index.
   2. If the difference is less than 500, schedule an event to write a new persistent_index to flash.
   3. The new persistent_index is equal to: next_index + 1000.
   
   Note 1: the numbers 500 and 1000 were chosen arbitrarily.
   Note 2: In step 2, the new persistent_index is written asynchronously because the logging task might not tolerate the time required to write to flash (e.g., ble_ll task).

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services