Patch Set 3: (3 comments)
There are numerous ways to solve chicken/eggs like this... ideas: Wrap m_ratectrs in a getter function, which allocates the rate counters the first time the getter is called (only if m_ratectrs == NULL), instead of doing so directly in the constructor. or Make the global singleton BTS dynamically allocated (a pointer instead of an instance) and call the constructor after the logging init; also move the call to bts_main_data() further down in pcu_main.c. In this patch, I wonder why the extensive move / separate files are needed. Is that a cosmetic choice or a compilation requirement? https://gerrit.osmocom.org/#/c/4411/3/src/bts.h File src/bts.h: Line 220: struct rate_ctr_group *ctrs; curious, any reason to place it squarely in the middle between lots of unrelated uints? https://gerrit.osmocom.org/#/c/4411/3/src/pcu_ctr.c File src/pcu_ctr.c: Line 5: * Author: Max Suraev <[email protected]> "sysmocom" not capitalized, also Harald says to add a dash, which I wasn't aware of until recently. I usually also add a mail address... by sysmocom - s.f.m.c. GmbH <[email protected]> Line 32: const struct rate_ctr_desc bts_ctr_description[] = { I assume these structs aren't copied by the rate_ctr_init(?), in which case they must be static. -- To view, visit https://gerrit.osmocom.org/4411 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max <[email protected]> Gerrit-Reviewer: Harald Welte <[email protected]> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max <[email protected]> Gerrit-Reviewer: Neels Hofmeyr <[email protected]> Gerrit-HasComments: Yes
