Change in osmo-bsc[master]: lchan_avail(): omit logging for handover decision 2

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 Jan 17 19:53:03 UTC 2021


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


Change subject: lchan_avail(): omit logging for handover decision 2
......................................................................

lchan_avail(): omit logging for handover decision 2

Add bool log argument to lchan_avail_by_type() and omit logging when
passed as false. From handover_decision_2.c, pass 'log' as false, from
all other callers pass true, i.e. for unchanged behavior.

Rationale:

Usually, we use lchan_avail_by_type() to select a new lchan to initiate
actual service. For that, it is interesting to see how osmo-bsc decides
which lchan will be used.

For handover decision 2, we since recently call lchan_avail_by_type()
for each and every handover candidate, to determine whether it will
occupy a dynamic timeslot or not (to know whether we would congest the
other TCH kind). So this happens for each permutation of source lchan
and target cell. That produces a lot of logging, out of proportion of
being useful to the maintainer.

Change-Id: Ia403f8fc853ca9ea9e81f7a7395df6b23845ebed
---
M include/osmocom/bsc/lchan_select.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/handover_decision_2.c
M src/osmo-bsc/lchan_select.c
4 files changed, 25 insertions(+), 23 deletions(-)



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

diff --git a/include/osmocom/bsc/lchan_select.h b/include/osmocom/bsc/lchan_select.h
index 41e7015..11f63b0 100644
--- a/include/osmocom/bsc/lchan_select.h
+++ b/include/osmocom/bsc/lchan_select.h
@@ -4,4 +4,4 @@
 struct gsm_lchan *lchan_select_by_type(struct gsm_bts *bts, enum gsm_chan_t type);
 struct gsm_lchan *lchan_select_by_chan_mode(struct gsm_bts *bts,
 					    enum gsm48_chan_mode chan_mode, enum channel_rate chan_rate);
-struct gsm_lchan *lchan_avail_by_type(struct gsm_bts *bts, enum gsm_chan_t type);
+struct gsm_lchan *lchan_avail_by_type(struct gsm_bts *bts, enum gsm_chan_t type, bool log);
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 2142219..ae9a432 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -1576,12 +1576,12 @@
 
 	/* First check the situation on the BTS, if we have TCH/H or TCH/F resources available for another (EMERGENCY)
 	 * call. If yes, then no (further) action has to be carried out. */
-	if (lchan_avail_by_type(rqd->bts, GSM_LCHAN_TCH_F)) {
+	if (lchan_avail_by_type(rqd->bts, GSM_LCHAN_TCH_F, true)) {
 		LOG_BTS(rqd->bts, DRSL, LOGL_NOTICE,
 			"CHAN RQD/EMERGENCY-PRIORITY: at least one TCH/F is (now) available!\n");
 		return false;
 	}
-	if (lchan_avail_by_type(rqd->bts, GSM_LCHAN_TCH_H)) {
+	if (lchan_avail_by_type(rqd->bts, GSM_LCHAN_TCH_H, true)) {
 		LOG_BTS(rqd->bts, DRSL, LOGL_NOTICE,
 			"CHAN RQD/EMERGENCY-PRIORITY: at least one TCH/H is (now) available!\n");
 		return false;
diff --git a/src/osmo-bsc/handover_decision_2.c b/src/osmo-bsc/handover_decision_2.c
index 131a309..379970f 100644
--- a/src/osmo-bsc/handover_decision_2.c
+++ b/src/osmo-bsc/handover_decision_2.c
@@ -921,14 +921,14 @@
 	c->target.min_free_tchh = ho_get_hodec2_tchh_min_slots(c->target.bts->ho);
 
 	/* Would the next TCH/F lchan convert a dynamic timeslot that currently counts for free TCH/H timeslots? */
-	next_lchan = lchan_avail_by_type(c->target.bts, GSM_LCHAN_TCH_F);
+	next_lchan = lchan_avail_by_type(c->target.bts, GSM_LCHAN_TCH_F, false);
 	if (next_lchan && next_lchan->ts->pchan_on_init == GSM_PCHAN_TCH_F_TCH_H_PDCH)
 		c->target.next_tchf_reduces_tchh = 2;
 	else
 		c->target.next_tchf_reduces_tchh = 0;
 
 	/* Would the next TCH/H lchan convert a dynamic timeslot that currently counts for free TCH/F timeslots? */
-	next_lchan = lchan_avail_by_type(c->target.bts, GSM_LCHAN_TCH_H);
+	next_lchan = lchan_avail_by_type(c->target.bts, GSM_LCHAN_TCH_H, false);
 	if (next_lchan && next_lchan->ts->pchan_on_init == GSM_PCHAN_TCH_F_TCH_H_PDCH
 	    && next_lchan->ts->pchan_is != GSM_PCHAN_TCH_H)
 		c->target.next_tchh_reduces_tchf = 1;
diff --git a/src/osmo-bsc/lchan_select.c b/src/osmo-bsc/lchan_select.c
index 64f4939..626520c 100644
--- a/src/osmo-bsc/lchan_select.c
+++ b/src/osmo-bsc/lchan_select.c
@@ -32,13 +32,14 @@
 
 static struct gsm_lchan *
 _lc_find_trx(struct gsm_bts_trx *trx, enum gsm_phys_chan_config pchan,
-	     enum gsm_phys_chan_config as_pchan, bool allow_pchan_switch)
+	     enum gsm_phys_chan_config as_pchan, bool allow_pchan_switch, bool log)
 {
 	struct gsm_lchan *lchan;
 	struct gsm_bts_trx_ts *ts;
 	int j, start, stop, dir;
 
 #define LOGPLCHANALLOC(fmt, args...) \
+	if (log) \
 		LOGP(DRLL, LOGL_DEBUG, "looking for lchan %s%s%s%s: " fmt, \
 		     gsm_pchan_name(pchan), \
 		     pchan == as_pchan ? "" : " as ", \
@@ -103,7 +104,7 @@
 
 static struct gsm_lchan *
 _lc_dyn_find_bts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan,
-		 enum gsm_phys_chan_config dyn_as_pchan)
+		 enum gsm_phys_chan_config dyn_as_pchan, bool log)
 {
 	struct gsm_bts_trx *trx;
 	struct gsm_lchan *lc;
@@ -119,13 +120,13 @@
 	for (allow_pchan_switch = 0; allow_pchan_switch <= (try_pchan_switch ? 1 : 0); allow_pchan_switch++) {
 		if (bts->chan_alloc_reverse) {
 			llist_for_each_entry_reverse(trx, &bts->trx_list, list) {
-				lc = _lc_find_trx(trx, pchan, dyn_as_pchan, (bool)allow_pchan_switch);
+				lc = _lc_find_trx(trx, pchan, dyn_as_pchan, (bool)allow_pchan_switch, log);
 				if (lc)
 					return lc;
 			}
 		} else {
 			llist_for_each_entry(trx, &bts->trx_list, list) {
-				lc = _lc_find_trx(trx, pchan, dyn_as_pchan, (bool)allow_pchan_switch);
+				lc = _lc_find_trx(trx, pchan, dyn_as_pchan, (bool)allow_pchan_switch, log);
 				if (lc)
 					return lc;
 			}
@@ -136,9 +137,9 @@
 }
 
 static struct gsm_lchan *
-_lc_find_bts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan)
+_lc_find_bts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan, bool log)
 {
-	return _lc_dyn_find_bts(bts, pchan, pchan);
+	return _lc_dyn_find_bts(bts, pchan, pchan, log);
 }
 
 struct gsm_lchan *lchan_select_by_chan_mode(struct gsm_bts *bts,
@@ -175,12 +176,13 @@
 	return lchan_select_by_type(bts, type);
 }
 
-struct gsm_lchan *lchan_avail_by_type(struct gsm_bts *bts, enum gsm_chan_t type)
+struct gsm_lchan *lchan_avail_by_type(struct gsm_bts *bts, enum gsm_chan_t type, bool log)
 {
 	struct gsm_lchan *lchan = NULL;
 	enum gsm_phys_chan_config first, first_cbch, second, second_cbch;
 
-	LOG_BTS(bts, DRLL, LOGL_DEBUG, "lchan_avail_by_type(%s)\n", gsm_lchant_name(type));
+	if (log)
+		LOG_BTS(bts, DRLL, LOGL_DEBUG, "lchan_avail_by_type(%s)\n", gsm_lchant_name(type));
 
 	switch (type) {
 	case GSM_LCHAN_SDCCH:
@@ -196,20 +198,20 @@
 			second_cbch = GSM_PCHAN_SDCCH8_SACCH8C_CBCH;
 		}
 
-		lchan = _lc_find_bts(bts, first);
+		lchan = _lc_find_bts(bts, first, log);
 		if (lchan == NULL)
-			lchan = _lc_find_bts(bts, first_cbch);
+			lchan = _lc_find_bts(bts, first_cbch, log);
 		if (lchan == NULL)
-			lchan = _lc_find_bts(bts, second);
+			lchan = _lc_find_bts(bts, second, log);
 		if (lchan == NULL)
-			lchan = _lc_find_bts(bts, second_cbch);
+			lchan = _lc_find_bts(bts, second_cbch, log);
 		break;
 	case GSM_LCHAN_TCH_F:
-		lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F);
+		lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_F, log);
 		/* If we don't have TCH/F available, try dynamic TCH/F_PDCH */
 		if (!lchan) {
 			lchan = _lc_dyn_find_bts(bts, GSM_PCHAN_TCH_F_PDCH,
-						 GSM_PCHAN_TCH_F);
+						 GSM_PCHAN_TCH_F, log);
 			/* TCH/F_PDCH used as TCH/F -- here, type is already
 			 * set to GSM_LCHAN_TCH_F, but for clarity's sake... */
 			if (lchan)
@@ -220,19 +222,19 @@
 		if (!lchan && bts->network->dyn_ts_allow_tch_f) {
 			lchan = _lc_dyn_find_bts(bts,
 						 GSM_PCHAN_TCH_F_TCH_H_PDCH,
-						 GSM_PCHAN_TCH_F);
+						 GSM_PCHAN_TCH_F, log);
 			if (lchan)
 				type = GSM_LCHAN_TCH_F;
 		}
 		break;
 	case GSM_LCHAN_TCH_H:
-		lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_H);
+		lchan = _lc_find_bts(bts, GSM_PCHAN_TCH_H, log);
 		/* No dedicated TCH/x available -- try fully dynamic
 		 * TCH/F_TCH/H_PDCH */
 		if (!lchan) {
 			lchan = _lc_dyn_find_bts(bts,
 						 GSM_PCHAN_TCH_F_TCH_H_PDCH,
-						 GSM_PCHAN_TCH_H);
+						 GSM_PCHAN_TCH_H, log);
 			if (lchan)
 				type = GSM_LCHAN_TCH_H;
 		}
@@ -251,7 +253,7 @@
 {
 	struct gsm_lchan *lchan = NULL;
 
-	lchan = lchan_avail_by_type(bts, type);
+	lchan = lchan_avail_by_type(bts, type, true);
 
 	LOG_BTS(bts, DRLL, LOGL_DEBUG, "lchan_select_by_type(%s)\n", gsm_lchant_name(type));
 

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ia403f8fc853ca9ea9e81f7a7395df6b23845ebed
Gerrit-Change-Number: 22267
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/20210117/9502a76f/attachment.htm>


More information about the gerrit-log mailing list