<p><a href="https://gerrit.osmocom.org/c/libosmocore/+/15560">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/15560/2/include/osmocom/core/logging.h">File include/osmocom/core/logging.h:</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/15560/2/include/osmocom/core/logging.h@383">Patch Set #2, Line 383:</a> <code style="font-family:monospace,monospace">#define LOG_MTX_DEBUG 0</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">would be nicer if using programs could somehow set LOG_MTX_DEBUG 1 without re-installing entire libo […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I prefer to keep it compile-time only, I don't want to introduce more unneeded performance penalties.<br>This feature is more a handy development/debugging tool in case a deadlock is detected somewhere during development (for instance, adding/changing a logging vty command and forgetting an unlock()).</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/15560/2/include/osmocom/core/logging.h@392">Patch Set #2, Line 392:</a> <code style="font-family:monospace,monospace">   void log_tgt_mutex_unlock(void);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I guess it would be cleaner if both cases created symbols of the same kind. i.e. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Same as explained above. The LOG_MTX_DEBUG case is not intended to be ever deployed in normal cases, simply some code easy to enable and rebuild which can help in some specific cases. Converting the symbol to a define and rebuilding libosmocore (+ possibly app) allows for prints to be executed without changing any other code and avoid performance penalties in 99.99999% of the times this function is going to ever be called.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I could have kept this privat eto myself but it was useful to debug an issue I introduced while writing the patch, and I thought it'd be nice to have feature if someone have a similar issue in the future or wants to understand better how locking works here.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/15560">change 15560</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/+/15560"/><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: Id7711893b34263baacac6caf4d489467053131bb </div>
<div style="display:none"> Gerrit-Change-Number: 15560 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </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-CC: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 18 Sep 2019 10:33:56 +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: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>