diff options
author | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2020-06-06 12:52:34 +0300 |
---|---|---|
committer | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2020-06-06 14:04:11 +0300 |
commit | 5a7c83bbb69fbf1de0b78b6008e41afaef8dfc46 (patch) | |
tree | 8ca8e4afa48459a08a961215ec0058e02a5c39e5 | |
parent | dc5003e87122dfe36eb77e845bb905bbe7f28c40 (diff) |
stats: Count transitions from BORKEN state due to LCHAN_EV_TS_ERROR signal.
Change-Id: Ice3379020039dc3634aa3887939740729d720dee
-rw-r--r-- | include/osmocom/bsc/gsm_data.h | 2 | ||||
-rw-r--r-- | src/osmo-bsc/lchan_fsm.c | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index d2f6c0972..e184adcd2 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -1416,6 +1416,7 @@ enum bts_counter_id { BTS_CTR_LCHAN_BORKEN_EV_RF_CHAN_REL_ACK, BTS_CTR_LCHAN_BORKEN_EV_VTY, BTS_CTR_LCHAN_BORKEN_EV_TEARDOWN, + BTS_CTR_LCHAN_BORKEN_EV_TS_ERROR, BTS_CTR_TS_BORKEN_FROM_NOT_INITIALIZED, BTS_CTR_TS_BORKEN_FROM_UNUSED, BTS_CTR_TS_BORKEN_FROM_WAIT_PDCH_ACT, @@ -1466,6 +1467,7 @@ static const struct rate_ctr_desc bts_ctr_description[] = { [BTS_CTR_LCHAN_BORKEN_EV_RF_CHAN_REL_ACK] = {"lchan_borken:event:rf_chan_rel_ack", "RF_CHAN_REL_ACK received in the lchan BORKEN state"}, [BTS_CTR_LCHAN_BORKEN_EV_VTY] = {"lchan_borken:event:vty", "VTY commands received in the lchan BORKEN state"}, [BTS_CTR_LCHAN_BORKEN_EV_TEARDOWN] = {"lchan_borken:event:teardown", "lchan in a BORKEN state is shutting down (BTS disconnected?)"}, + [BTS_CTR_LCHAN_BORKEN_EV_TS_ERROR] = {"lchan_borken:event:ts_error", "LCHAN_EV_TS_ERROR received in a BORKEN state"}, [BTS_CTR_TS_BORKEN_FROM_NOT_INITIALIZED] = {"ts_borken:from_state:not_initialized", "Transitions from TS NOT_INITIALIZED state to BORKEN state"}, [BTS_CTR_TS_BORKEN_FROM_UNUSED] = {"ts_borken:from_state:unused", "Transitions from TS UNUSED state to BORKEN state"}, [BTS_CTR_TS_BORKEN_FROM_WAIT_PDCH_ACT] = {"ts_borken:from_state:wait_pdch_act", "Transitions from TS WAIT_PDCH_ACT state to BORKEN state"}, diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c index a1bf85701..1550ffb57 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -1327,8 +1327,15 @@ void lchan_fsm_allstate_action(struct osmo_fsm_inst *fi, uint32_t event, void *d switch (event) { case LCHAN_EV_TS_ERROR: + { + struct gsm_lchan *lchan = lchan_fi_lchan(fi); + if (fi->state == LCHAN_ST_BORKEN) { + rate_ctr_inc(&lchan->ts->trx->bts->bts_ctrs->ctr[BTS_CTR_LCHAN_BORKEN_EV_TS_ERROR]); + osmo_stat_item_dec(lchan->ts->trx->bts->bts_statg->items[BTS_STAT_LCHAN_BORKEN], 1); + } lchan_fail_to(LCHAN_ST_UNUSED, "LCHAN_EV_TS_ERROR"); return; + } default: return; |