<p><a href="https://gerrit.osmocom.org/c/libosmocore/+/20296">View Change</a></p><p>3 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/20296/4/src/logging.c">File src/logging.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/20296/4/src/logging.c@869">Patch Set #4, Line 869:</a> <code style="font-family:monospace,monospace">   osmo_wqueue_enqueue_quiet(target->tgt_file.wqueue, msg);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I have a follow-up patch that introduces a rate_counter for overruns. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">rate_counter: ACK, fine.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/20296/4/src/logging.c@926">Patch Set #4, Line 926:</a> <code style="font-family:monospace,monospace">   if (rc != msgb_length(msg))</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">short writes are possible, but rather unlikely. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Well that's maybe the issue here. We should rather try writing as much as possible until write returns a short write, or EAGAIN or whatever meaning the buffer is full. This optimizes time spent + delay upon logging stuff, frees memory beforehand, etc.<br>Otherwise you are removing 1 msgb per select loop while potentially adding several msgbs per loop.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/20296/4/src/select.c">File src/select.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/20296/4/src/select.c@283">Patch Set #4, Line 283:</a> <code style="font-family:monospace,monospace">   log_target_file_switch_to_wqueue(osmo_stderr_target);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I would avoid adding more and more flags for use cases that we don't have yet. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">There's a use case: debugging. When debugging some issue or crash, one wants to be sure logging is outputed synchronously. That's the point of using stderr vs stdout for instance (no bufering). You'll always get printed whatever happens before event X or a crash. By delaying the actual logging you are actually making issues look less reproducible and provide less information, so specially when reproducing an issue, one wants to disable this async logging.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/20296">change 20296</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/c/libosmocore/+/20296"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ia58fd78535c41b3da3aeb7733aadc785ace610da </div>
<div style="display:none"> Gerrit-Change-Number: 20296 </div>
<div style="display:none"> Gerrit-PatchSet: 6 </div>
<div style="display:none"> Gerrit-Owner: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-CC: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 28 Sep 2020 08:52:00 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Comment-In-Reply-To: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>