Change in osmo-bsc[master]: hodec2: log requirements of best candidate, log rxlev in dBm

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
Mon Aug 10 19:33:00 UTC 2020


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


Change subject: hodec2: log requirements of best candidate, log rxlev in dBm
......................................................................

hodec2: log requirements of best candidate, log rxlev in dBm

Instead of logging a hex value for the met requirements, fully expand the "ABC"
flags for both TCH/F and TCH/H.

>From HO_CANDIDATE_FMT/_ARGS, split off into REQUIREMENTS_FMT/_ARGS and use that
when logging the chosen HO candidates.

Also change the RX level to dBm, to match general logging and reduce confusion
between rxlev number variants in the log.

Change-Id: I1b30a6e98bdb4bd92e72864fafdd2f4f3ae3134c
---
M src/osmo-bsc/handover_decision_2.c
1 file changed, 21 insertions(+), 14 deletions(-)



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

diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c
index 3191957..c818dbb 100644
--- a/src/osmo-bsc/handover_decision_2.c
+++ b/src/osmo-bsc/handover_decision_2.c
@@ -797,26 +797,30 @@
 		return trigger_remote_bss_ho(c, requirements);
 }
 
+#define REQUIREMENTS_FMT "[%s%s%s]%s"
+#define REQUIREMENTS_ARGS(REQUIREMENTS, TCHX) \
+	     (REQUIREMENTS) & REQUIREMENT_A_TCH##TCHX ? "A" : \
+		((REQUIREMENTS) & REQUIREMENT_TCH##TCHX##_MASK) == 0? "-" : "", \
+	     (REQUIREMENTS) & REQUIREMENT_B_TCH##TCHX ? "B" : "", \
+	     (REQUIREMENTS) & REQUIREMENT_C_TCH##TCHX ? "C" : "", \
+	     ((REQUIREMENTS) & REQUIREMENT_TCH##TCHX##_MASK) == 0 ? " not a candidate" : \
+	       (((REQUIREMENTS) & REQUIREMENT_TCH##TCHX##_MASK) == REQUIREMENT_A_TCH##TCHX ? \
+	        " more congestion" : \
+		((REQUIREMENTS) & REQUIREMENT_B_TCH##TCHX ? \
+		 " good" : \
+		  /* now has to be (REQUIREMENTS) & REQUIREMENT_C_TCHX != 0: */ \
+		  " less-or-equal congestion"))
+
 /* verbosely log about a handover candidate */
 static inline void debug_candidate(struct ho_candidate *candidate,
 				   int8_t rxlev, int tchf_count, int tchh_count)
 {
 	struct gsm_lchan *lchan = candidate->lchan;
 
-#define HO_CANDIDATE_FMT(tchx, TCHX) "TCH/" #TCHX "={free %d (want %d), [%s%s%s]%s}"
+#define HO_CANDIDATE_FMT(tchx, TCHX) "TCH/" #TCHX "={free %d (want %d), " REQUIREMENTS_FMT "}"
 #define HO_CANDIDATE_ARGS(tchx, TCHX) \
 	     tch##tchx##_count, ho_get_hodec2_tch##tchx##_min_slots(candidate->bts->ho), \
-	     candidate->requirements & REQUIREMENT_A_TCH##TCHX ? "A" : \
-		(candidate->requirements & REQUIREMENT_TCH##TCHX##_MASK) == 0? "-" : "", \
-	     candidate->requirements & REQUIREMENT_B_TCH##TCHX ? "B" : "", \
-	     candidate->requirements & REQUIREMENT_C_TCH##TCHX ? "C" : "", \
-	     (candidate->requirements & REQUIREMENT_TCH##TCHX##_MASK) == 0 ? " not a candidate" : \
-	       ((candidate->requirements & REQUIREMENT_TCH##TCHX##_MASK) == REQUIREMENT_A_TCH##TCHX ? \
-	        " more congestion" : \
-		(candidate->requirements & REQUIREMENT_B_TCH##TCHX ? \
-		 " good" : \
-		  /* now has to be candidate->requirements & REQUIREMENT_C_TCHX != 0: */ \
-		  " less-or-equal congestion"))
+	     REQUIREMENTS_ARGS(candidate->requirements, TCHX)
 
 	if (!candidate->bts && !candidate->cil)
 		LOGPHOLCHAN(lchan, LOGL_DEBUG, "Empty candidate\n");
@@ -1503,8 +1507,11 @@
 	if (log_check_level(DHODEC, LOGL_DEBUG)) {
 		LOGPHOBTS(bts, LOGL_DEBUG, "Considering %u candidates to solve congestion:\n", candidates);
 		for (i = 0; i < candidates; i++) {
-			LOGPHOCAND(&clist[i], LOGL_DEBUG, "#%d: req=0x%x avg-rxlev=%d\n",
-				   i, clist[i].requirements, clist[i].avg);
+
+			LOGPHOCAND(&clist[i], LOGL_DEBUG, "#%d: req={TCH/F:" REQUIREMENTS_FMT ", TCH/H:" REQUIREMENTS_FMT "} avg-rxlev=%d dBm\n",
+				   i, REQUIREMENTS_ARGS(clist[i].requirements, F),
+				   REQUIREMENTS_ARGS(clist[i].requirements, H),
+				   rxlev2dbm(clist[i].avg));
 		}
 	}
 

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I1b30a6e98bdb4bd92e72864fafdd2f4f3ae3134c
Gerrit-Change-Number: 19560
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/20200810/db83cce8/attachment.htm>


More information about the gerrit-log mailing list