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 2020/12/03 04:10:30 UTC

[GitHub] [mynewt-core] nkaje commented on pull request #2425: log_fcb: optimize finding records towards the end of circular buffer

nkaje commented on pull request #2425:
URL: https://github.com/apache/mynewt-core/pull/2425#issuecomment-737653028


   To test `sys/log: optimize header read based on image hash`, use this block immediately after the optimized read.
   ```
   +    /* verify */
   +    bytes_read = log_read(log, dptr, &ue_imghash[0],
                                  LOG_BASE_ENTRY_HDR_SIZE, LOG_IMG_HASHLEN);
   -        if (bytes_read != LOG_IMG_HASHLEN) {
   -            return SYS_EIO;
   -        }
   +    if (bytes_read != LOG_IMG_HASHLEN) {
   +        return SYS_EIO;
        }
   +    if (memcmp(hdr->ue_imghash, &ue_imghash[0], LOG_IMG_HASHLEN) != 0) {
   +        console_printf("imghash read optimization check failed");
   +        return SYS_EIO;
   +    }
   ```


----------------------------------------------------------------
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