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/07/13 15:31:44 UTC

[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #4111: syslog/intbuf: force output log when syslog interrupt buffer is full

xiaoxiang781216 commented on pull request #4111:
URL: https://github.com/apache/incubator-nuttx/pull/4111#issuecomment-879189811


   > Why this change was made?
   > 
   
   When the panic happen, there is huge log output. The critical log will lose before this change.
   
   > I consider it quite bad.
   > That is because:
   > 
   > 1. The purpose of the intbuffer was to temporarily store the messages, till the system is out of an IRQ and can flush them. There was no writing in an IRQ, while now there is. This totally defeats the purpose of the intbuffer.
   > 2. This makes the system unpredictable and seriously affect the real-time behavior of the system. An IRQ may or may not need to flush the buffer. These two scenarios will have a huge difference in the timings of the IRQ. And most importantly, this is caused by code outside the scope of the IRQ itself. So, it is impossible to time the IRQ and guarantee the scheduling of the system.
   
   If you don't write too much log in the interrupt handler, the intbuffer still work as before(buffer and then flush out side the interrupt). The difference happen when the output in one interrupt handler is larger than the intbuffer size. Except the panic case I mentioned before, I suppose it happen most likely the developer is debugging the code and add many log and then the log content is more important than the timing.
   
   > 3. Many syslog channels do not support the force method. In this case the contents of the buffer are completely lost, without any hint of the fact. The user thinks that the IRQ never executed. At least before there was a hint that the buffer is small and that there is need to enlarge it.
   
   Good catch, the user may lose the notice. How about we bring back the notice but still output the log?


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

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org