diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2021-01-16 17:54:25 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2021-01-19 11:49:07 +0100 |
commit | 2eeef70310b5ba4dd2bf6272cdf136a75b0cd38c (patch) | |
tree | 1bafc64c358ef839c5b3f62260e42072385df3b0 /src/osmo-bsc | |
parent | 499e02c546b37ab029fb6b6e83f8b9b744be1765 (diff) |
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
Diffstat (limited to 'src/osmo-bsc')
-rw-r--r-- | src/osmo-bsc/abis_rsl.c | 4 | ||||
-rw-r--r-- | src/osmo-bsc/handover_decision_2.c | 4 | ||||
-rw-r--r-- | src/osmo-bsc/lchan_select.c | 38 |
3 files changed, 24 insertions, 22 deletions
diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c index a68c9fbd4..321bcb421 100644 --- a/src/osmo-bsc/abis_rsl.c +++ b/src/osmo-bsc/abis_rsl.c @@ -1610,12 +1610,12 @@ static bool force_free_lchan_for_emergency(struct chan_rqd *rqd) /* 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 92374e909..598f05bd6 100644 --- a/src/osmo-bsc/handover_decision_2.c +++ b/src/osmo-bsc/handover_decision_2.c @@ -921,7 +921,7 @@ static void candidate_set_free_tch(struct ho_candidate *c) c->target.min_free_tchh = ho_get_hodec2_tchh_min_slots(c->target.bts->ho); /* Would the next TCH/F lchan occupy 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 @@ -929,7 +929,7 @@ static void candidate_set_free_tch(struct ho_candidate *c) /* Would the next TCH/H lchan occupy a dynamic timeslot that currently counts for free TCH/F timeslots? * Note that a dyn TS already in TCH/H mode (half occupied) would not reduce free TCH/F. */ - 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 64f4939e5..626520c42 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 @@ _lc_find_trx(struct gsm_bts_trx *trx, enum gsm_phys_chan_config pchan, 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 @@ _lc_dyn_find_bts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan, 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 @@ _lc_dyn_find_bts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan, } 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 @@ struct gsm_lchan *lchan_select_by_chan_mode(struct gsm_bts *bts, 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 @@ struct gsm_lchan *lchan_avail_by_type(struct gsm_bts *bts, enum gsm_chan_t type) 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 @@ struct gsm_lchan *lchan_avail_by_type(struct gsm_bts *bts, enum gsm_chan_t type) 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_select_by_type(struct gsm_bts *bts, enum gsm_chan_t type { 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)); |