Change in osmo-bsc[master]: cosmetic tweaks on handover counting code

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
Tue Nov 2 16:01:55 UTC 2021


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


Change subject: cosmetic tweaks on handover counting code
......................................................................

cosmetic tweaks on handover counting code

I was a bit confused that grep did not find HO counters being used, so
let's add some comments to better explain and provide a grep hook.

Related: SYS#4878
Change-Id: I242de13e657286e09428a8ca6e583d8b5155faa2
---
M src/osmo-bsc/handover_fsm.c
1 file changed, 25 insertions(+), 3 deletions(-)



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

diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c
index 255478f..e61262f 100644
--- a/src/osmo-bsc/handover_fsm.c
+++ b/src/osmo-bsc/handover_fsm.c
@@ -108,10 +108,13 @@
 			rate_ctr_inc(rate_ctr_group_get_ctr(conn->network->bts_unknown_ctrs, counter)); \
 	} while(0)
 
+/* Count handover result on both bts and bsc level.
+ * Call with 'counter' being the counter name without the "BSC_"/"BTS_" part,
+ * e.g. ho_count(conn_get_bts(conn), CTR_HANDOVER_ATTEMPTED); */
 #define ho_count(bts, counter) do { \
-        ho_count_bsc(BSC_##counter); \
-        ho_count_bts(bts, BTS_##counter); \
-} while(0)
+		ho_count_bsc(BSC_##counter); \
+		ho_count_bts(bts, BTS_##counter); \
+	} while(0)
 
 static uint8_t g_next_ho_ref = 1;
 
@@ -748,6 +751,23 @@
 	lchan_activate(ho->new_lchan, &info);
 }
 
+/* Create functions result_counter_{BSC,BTS}_{HANDOVER,...}(), to evaluate the handover result and return
+ * BSC_CTR_HANDOVER_ATTEMPTED,
+ * BSC_CTR_HANDOVER_COMPLETED,
+ * BSC_CTR_HANDOVER_STOPPED,
+ * BSC_CTR_HANDOVER_NO_CHANNEL,
+ * BSC_CTR_HANDOVER_TIMEOUT,
+ * BSC_CTR_HANDOVER_FAILED,
+ * BSC_CTR_HANDOVER_ERROR,
+ * or
+ * BTS_CTR_HANDOVER_ATTEMPTED,
+ * BTS_CTR_HANDOVER_COMPLETED,
+ * BTS_CTR_HANDOVER_STOPPED,
+ * BTS_CTR_HANDOVER_NO_CHANNEL,
+ * BTS_CTR_HANDOVER_TIMEOUT,
+ * BTS_CTR_HANDOVER_FAILED,
+ * BTS_CTR_HANDOVER_ERROR,
+ */
 #define FUNC_RESULT_COUNTER(obj, name) \
 static int result_counter_##obj##_##name(enum handover_result result) \
 { \
@@ -773,6 +793,7 @@
 FUNC_RESULT_COUNTER(BSC, INTRA_BSC_HO)
 FUNC_RESULT_COUNTER(BSC, INTER_BSC_HO_IN)
 
+/* INTRA_BSC_HO_OUT does not have a NO_CHANNEL result, so can't do this with FUNC_RESULT_COUNTER() macro. */
 static int result_counter_BSC_INTER_BSC_HO_OUT(enum handover_result result) {
 	switch (result) {
 	case HO_RESULT_OK:
@@ -810,6 +831,7 @@
 FUNC_RESULT_COUNTER(BTS, INTRA_BSC_HO)
 FUNC_RESULT_COUNTER(BTS, INTER_BSC_HO_IN)
 
+/* INTRA_BSC_HO_OUT does not have a NO_CHANNEL result, so can't do this with FUNC_RESULT_COUNTER() macro. */
 static int result_counter_BTS_INTER_BSC_HO_OUT(enum handover_result result) {
 	switch (result) {
 	case HO_RESULT_OK:

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I242de13e657286e09428a8ca6e583d8b5155faa2
Gerrit-Change-Number: 26070
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/20211102/cf59606b/attachment.htm>


More information about the gerrit-log mailing list