<blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">(1 comment)</p><p style="white-space: pre-wrap; word-wrap: break-word;">I think in general I would have preferred to simply use a separate<br>Uart transmit function from the hardirq handlers.  Either by<br>explicitly changing those calls away from printf, or  by<br>catching/redirecting printf using a #define that's #included only<br>in the exceptions.c file in order to bypass normal printf().</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">I've added an additional prinft for synchronous transfer.<br>A define in the default exceptions redirects to this new printf.</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Another idea that just comes to my mind: Couldn't we simply check<br>some CPU status flags to know that we're in an exception or in an<br>interrupt?  This way the decision to bypass the ring buffer could<br>be entirely automatic without any explcit calls to disable the<br>buffer, or any of the hacks I described above? I would suggest to<br>look into this.  If it turns out it's not that simple, please<br>report back and we can merge your current patch as-is.</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">I also thought of this, but we don't want a synchronous transfer in every ISR (e.g. when TRACE_LOG is used in ISR for ERROR level).<br>We only want synchronous transfer in final handler (with blocking while).</p><p style="white-space: pre-wrap; word-wrap: break-word;">I also think blocking until the transfer is complete is important.<br>This would "remove" the UART 1-byte buffer, but at this point it just adds a 1-byte transfer delay for the whole printf. The benefit is that we are sure the complete string is printed (e.g. it a handler would reset after a print, the last by would not have time to be transferred)</p><p><a href="https://gerrit.osmocom.org/10313">View Change</a></p><ul style="list-style: none; padding: 0;"></ul><p>To view, visit <a href="https://gerrit.osmocom.org/10313">change 10313</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/10313"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: simtrace2 </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I1b4ace5185cf2dc32684934ed12bf6a8682e9bad </div>
<div style="display:none"> Gerrit-Change-Number: 10313 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Kévin Redon <kredon@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: Kévin Redon <kredon@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Sat, 04 Aug 2018 09:32:05 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-HasLabels: No </div>