laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/37664?usp=email )

Change subject: hnb_persistent: Use incrementing counter for rate_ctr + 
stat_item index
......................................................................

hnb_persistent: Use incrementing counter for rate_ctr + stat_item index

This will remove the annoying log messages like

DLGLOBAL ERROR counter group 'hnb' already exists for index 0, instead using 
index 1. This is a software bug that needs fixing. (rate_ctr.c:221)

Closes: OS#6433
Change-Id: I0bb6a679fb05a6aba917f089401fe3765a5d1fc3
---
M src/osmo-hnbgw/hnbgw.c
1 file changed, 5 insertions(+), 2 deletions(-)

Approvals:
  fixeria: Looks good to me, but someone else must approve
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/src/osmo-hnbgw/hnbgw.c b/src/osmo-hnbgw/hnbgw.c
index d4515a8..90b8147 100644
--- a/src/osmo-hnbgw/hnbgw.c
+++ b/src/osmo-hnbgw/hnbgw.c
@@ -497,19 +497,22 @@
        osmo_timer_schedule(&hnbp->disconnected_timeout, period_s, 0);
 }

+static unsigned int g_hnbp_ctr_id;
+
 struct hnb_persistent *hnb_persistent_alloc(const struct umts_cell_id *id)
 {
        struct hnb_persistent *hnbp = talloc_zero(g_hnbgw, struct 
hnb_persistent);
+       unsigned int ctr_id = g_hnbp_ctr_id++;
        if (!hnbp)
                return NULL;

        hnbp->id = *id;
        hnbp->id_str = talloc_strdup(hnbp, umts_cell_id_to_str(id));
-       hnbp->ctrs = rate_ctr_group_alloc(hnbp, &hnb_ctrg_desc, 0);
+       hnbp->ctrs = rate_ctr_group_alloc(hnbp, &hnb_ctrg_desc, ctr_id);
        if (!hnbp->ctrs)
                goto out_free;
        rate_ctr_group_set_name(hnbp->ctrs, hnbp->id_str);
-       hnbp->statg = osmo_stat_item_group_alloc(hnbp, &hnb_statg_desc, 0);
+       hnbp->statg = osmo_stat_item_group_alloc(hnbp, &hnb_statg_desc, ctr_id);
        if (!hnbp->statg)
                goto out_free_ctrs;
        osmo_stat_item_group_set_name(hnbp->statg, hnbp->id_str);

--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/37664?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I0bb6a679fb05a6aba917f089401fe3765a5d1fc3
Gerrit-Change-Number: 37664
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>

Reply via email to