Kévin Redon has posted comments on this change. ( 
https://gerrit.osmocom.org/10313 )

Change subject: add synchronous UART transmission and use it in exceptions
......................................................................


Patch Set 2:

> (1 comment)
 >
 > I think in general I would have preferred to simply use a separate
 > Uart transmit function from the hardirq handlers.  Either by
 > explicitly changing those calls away from printf, or  by
 > catching/redirecting printf using a #define that's #included only
 > in the exceptions.c file in order to bypass normal printf().

I've added an additional prinft for synchronous transfer.
A define in the default exceptions redirects to this new printf.

 > Another idea that just comes to my mind: Couldn't we simply check
 > some CPU status flags to know that we're in an exception or in an
 > interrupt?  This way the decision to bypass the ring buffer could
 > be entirely automatic without any explcit calls to disable the
 > buffer, or any of the hacks I described above? I would suggest to
 > look into this.  If it turns out it's not that simple, please
 > report back and we can merge your current patch as-is.

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).
We only want synchronous transfer in final handler (with blocking while).

I also think blocking until the transfer is complete is important.
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)


--
To view, visit https://gerrit.osmocom.org/10313
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I1b4ace5185cf2dc32684934ed12bf6a8682e9bad
Gerrit-Change-Number: 10313
Gerrit-PatchSet: 2
Gerrit-Owner: Kévin Redon <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Kévin Redon <[email protected]>
Gerrit-Comment-Date: Sat, 04 Aug 2018 09:32:05 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: No

Reply via email to