<p style="white-space: pre-wrap; word-wrap: break-word;">Maybe the thing here is that I don't really see the point in having that done for all TCP sockets. Specially not by default. IMHO the app should specifically allocate and register specific sats_tcp-entry to the API and then they would become available. If then you still want to have somehow a possibility to get all the sockets registered automatically (which I don't see the point), then one may register those as done here but have it disabled by default. But in this case there's going to be no hood "name" or "description" to show for those, well maybe yes, by printing rem_addr:rem_port<->local_addr:local_port or alike on its stats name.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Those are my ideas. If you still find the current solution acceptable then feel free to merge it.</p><p>Patch set 9:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/26454">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/+/26454/9/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/+/26454/9/src/select.c@188">Patch Set #9, Line 188:</a> <code style="font-family:monospace,monospace">   osmo_stats_tcp_osmo_fd_unregister(fd);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">so we are now converting a O(k) operation into an O(n) one.<br>Also if user is responsible of registering it, I'd argue it should also be responsible from unregistering it here.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/26454/9/src/stats_tcp.c">File src/stats_tcp.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/+/26454/9/src/stats_tcp.c@194">Patch Set #9, Line 194:</a> <code style="font-family:monospace,monospace">            return;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">return error?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/libosmocore/+/26454/9/src/stats_tcp.c@210">Patch Set #9, Line 210:</a> <code style="font-family:monospace,monospace">void osmo_stats_tcp_osmo_fd_unregister(const struct osmo_fd *fd)</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">By exposing struct stats_tcp_entry and using it as a param, you convert these functions from O(n) to O(k) because you can directly use llist_add, llist_del, etc.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/26454">change 26454</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/+/26454"/><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: I1416f95aff2adcf13689646b7574845de169fa3d </div>
<div style="display:none"> Gerrit-Change-Number: 26454 </div>
<div style="display:none"> Gerrit-PatchSet: 9 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Thu, 16 Dec 2021 11:29:43 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>