<p>laforge <strong>uploaded patch set #10</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/20305">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">logging: Avoid memcpy from stack to msgb in _file_output()<br><br>For file and stderr output, the existing code always generates<br>the log string on a stack buffer, and then (in case of non-blocking<br>write via write_queue) copies it over to a msgb.<br><br>Let's optimize this by turning _file_output() into a raw_output<br>callback which first allocates the msgb and then format-prints<br>directly to that msgb instaed of stack + memcpy.<br><br>This has the disadvantage that we don't know how long the buffer<br>has to be in order to print the entire string to it.  As a result<br>we always have to allocate a 4k-sized buffer (plus msgb overhead).<br><br>The write_queue length for log file output has been decreased from<br>1024 entries to 156 entries in order to stay within the same<br>memory requirements for each log target memory pool (about 648 kBytes).<br><br>Related: OS#4311<br>Change-Id: I0d10b0199576d2e7ff6421a6dba19ae5ffafd946<br>---<br>M src/logging.c<br>1 file changed, 43 insertions(+), 18 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/05/20305/10</pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/20305">change 20305</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/+/20305"/><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: I0d10b0199576d2e7ff6421a6dba19ae5ffafd946 </div>
<div style="display:none"> Gerrit-Change-Number: 20305 </div>
<div style="display:none"> Gerrit-PatchSet: 10 </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: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>