You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/03/26 13:53:34 UTC

[GitHub] [incubator-nuttx] v01d edited a comment on issue #3166: dmesg/ramlog: do not clear by default but add option to do so

v01d edited a comment on issue #3166:
URL: https://github.com/apache/incubator-nuttx/issues/3166#issuecomment-808235871


   I'm looking at RAMLOG and I would do the following modifications:
   
   1. remove CONFIG_RAMLOG_NONBLOCKING option and use O_NONBLOCK received during open() to determine blocking/non-blocking mode
   2. make the read() non-destroying (just allow to read ramlog contents without clearing it)
   3. use can control manual clearing by opening file with O_TRUNC option and close it
   4. make ramlog_read() do buffer copy instead of char-by-char loop. Any reason this is done this way? I think char-by-char write could make sense given that it can be called from interrupt handler (is that why?). But at least read() should not have that problem.
   
   I further think that supporting no buffer overwrite does not really make sense: if one wants to ensure messages are not lost either the buffer should be made bigger or a non-volatile support be used. 
   
   With these changes, we can have dmesg handle these options:
   - `-C`: clear buffer
   - `-w`: print contents and wait for new messages (open in blocking mode)
   
   What do you think about these modifications?


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