Open protobits opened 3 years ago
I'm looking at RAMLOG and I would do the following modifications:
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?
The suggestion looks good. But it's also useful to support syslog_channel_s::sc_write since it could avoid the log interlace issue discussed here: https://github.com/apache/incubator-nuttx/pull/3050.
That part might be trickier since I still don't understand how to safely change it into a simple copy. It appears it deliberately does char-by-char to ensure safety of the internal ring buffer without using a mutex. Is that so?
@v01d when do you have free time to implement this feature? We like all of them:).
Sorry, I will get to this later on. I'm currently knee deep into CMake migration (currently trying to support sim build) so that I can open a draft PR soon.
Ok, If I find the free time, I will take this work.
We could improve
dmesg
by only clearing ring buffer when specified by adding support for a-C
option, as in Linux. This way the default works more as expected. I think this requires some change on nuttx side (besides just adding the option todmesg
command), so i'm creating the issue here for now.