Change in osmo-bsc[master]: fix 'handover:*' counters: remove bogus increments

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Sun Aug 30 00:20:37 UTC 2020


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/19895 )


Change subject: fix 'handover:*' counters: remove bogus increments
......................................................................

fix 'handover:*' counters: remove bogus increments

To handle cases of unknown handover type (like failure to find the target
cell), return -1 as counter code; treat -1 as skipping in ho_count_bsc() and
ho_count_bts().

The handover:* counters indicate overall counts, without knowing whether inter-
or intra-BSC, or whether the target ARFCN even exists. So they need to be
counted separately, and must not serve as fallback category in
result_counter_bsc() and result_counter_bts().

Related: OS#4736
Change-Id: Ie311e599d7bd35d33cf471c6c63e649246e8396a
---
M src/osmo-bsc/handover_fsm.c
1 file changed, 19 insertions(+), 21 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/95/19895/1

diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c
index 4b54bb7..86f17ec 100644
--- a/src/osmo-bsc/handover_fsm.c
+++ b/src/osmo-bsc/handover_fsm.c
@@ -81,23 +81,29 @@
 /* Assume presence of local var 'conn' as struct gsm_subscriber_connection.
  * This is a macro to preserve the source file and line number in logging. */
 #define ho_count_bsc(counter) do { \
-		LOG_HO(conn, LOGL_DEBUG, "(BSC) incrementing rate counter: %s %s\n", \
-		       bsc_ctr_description[counter].name, \
-		       bsc_ctr_description[counter].description); \
-		rate_ctr_inc(&conn->network->bsc_ctrs->ctr[counter]); \
+		/* If a handover target could not be found, the counter may be -1. */ \
+		if (counter >= 0) { \
+			LOG_HO(conn, LOGL_DEBUG, "(BSC) incrementing rate counter: %s %s\n", \
+			       bsc_ctr_description[counter].name, \
+			       bsc_ctr_description[counter].description); \
+			rate_ctr_inc(&conn->network->bsc_ctrs->ctr[counter]); \
+		} \
 	} while(0)
 
 /* Assume presence of local var 'conn' as struct gsm_subscriber_connection.
  * Handles bts == NULL gracefully
  * This is a macro to preserve the source file and line number in logging. */
 #define ho_count_bts(bts, counter) do { \
-		LOG_HO(conn, LOGL_DEBUG, "(BTS) incrementing rate counter: %s %s\n", \
-		       bts_ctr_description[counter].name, \
-		       bts_ctr_description[counter].description); \
-		if (bts) \
-			rate_ctr_inc(&bts->bts_ctrs->ctr[counter]); \
-		else \
-			rate_ctr_inc(&conn->network->bts_unknown_ctrs->ctr[counter]); \
+		/* If a handover target could not be found, the counter may be -1. */ \
+		if (counter >= 0) { \
+			LOG_HO(conn, LOGL_DEBUG, "(BTS) incrementing rate counter: %s %s\n", \
+			       bts_ctr_description[counter].name, \
+			       bts_ctr_description[counter].description); \
+			if (bts) \
+				rate_ctr_inc(&bts->bts_ctrs->ctr[counter]); \
+			else \
+				rate_ctr_inc(&conn->network->bts_unknown_ctrs->ctr[counter]); \
+		} \
 	} while(0)
 
 #define ho_count(bts, counter) do { \
@@ -722,11 +728,7 @@
 {
 	switch (scope) {
 	default:
-		LOGP(DHO, LOGL_ERROR, "invalid enum handover_scope value: %s\n",
-		     handover_scope_name(scope));
-		/* use "normal" HO counter... */
-	case HO_NO_HANDOVER:
-		return result_counter_BSC_HANDOVER(result);
+		return -1;
 	case HO_INTRA_CELL:
 		return result_counter_BSC_INTRA_CELL_HO(result);
 	case HO_INTRA_BSC:
@@ -761,11 +763,7 @@
 {
 	switch (scope) {
 	default:
-		LOGP(DHO, LOGL_ERROR, "invalid enum handover_scope value: %s\n",
-		     handover_scope_name(scope));
-		/* use "normal" HO counter... */
-	case HO_NO_HANDOVER:
-		return result_counter_BTS_HANDOVER(result);
+		return -1;
 	case HO_INTRA_CELL:
 		return result_counter_BTS_INTRA_CELL_HO(result);
 	case HO_INTRA_BSC:

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/19895
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ie311e599d7bd35d33cf471c6c63e649246e8396a
Gerrit-Change-Number: 19895
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200830/048aa182/attachment.htm>


More information about the gerrit-log mailing list