From c859ef646c1e62b3d6c8855bfe1ae22516d58192 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Sat, 29 Aug 2020 02:21:36 +0000 Subject: fix 'handover:*' counters: add missing / move increments Move initial 'handover:attempted' counts from bsc_subscr_conn_fsm.c to handover_fsm.c, where all the other counters are handled. Add missing increments for the overall 'handover:*' counts. Related: OS#4736 Change-Id: I783bdedafc0eb8f2df9ea100792846fecc7ccbf7 --- src/osmo-bsc/bsc_subscr_conn_fsm.c | 7 ------- src/osmo-bsc/handover_fsm.c | 4 ++++ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index 6871c4cc1..281ab7177 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -382,13 +382,6 @@ static void gscon_fsm_active(struct osmo_fsm_inst *fi, uint32_t event, void *dat return; case GSCON_EV_HANDOVER_START: - bts = conn_get_bts(conn); - rate_ctr_inc(&conn->network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED]); - if (bts) - rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_HANDOVER_ATTEMPTED]); - else - rate_ctr_inc(&conn->network->bts_unknown_ctrs->ctr[BTS_CTR_HANDOVER_ATTEMPTED]); - /* Rely on handover_fsm timeout */ if (osmo_fsm_inst_state_chg(fi, ST_HANDOVER, 0, 0)) LOGPFSML(fi, LOGL_ERROR, "Cannot transition to HANDOVER state, discarding\n"); diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index 4b54bb7ce..9ab96e316 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -323,6 +323,7 @@ void handover_start(struct handover_out_req *req) * is to always create a handover_fsm instance, even if the target cell is not resolved yet. Any failure should * then call handover_end(), which ensures that the conn snaps back to a valid state. */ handover_fsm_alloc(conn); + ho_count(conn_get_bts(conn), CTR_HANDOVER_ATTEMPTED); ho->from_hodec_id = req->from_hodec_id; ho->new_lchan_type = req->new_lchan_type == GSM_LCHAN_NONE ? @@ -629,6 +630,7 @@ void handover_start_inter_bsc_in(struct gsm_subscriber_connection *conn, break; } + ho_count(ho->new_bts, CTR_HANDOVER_ATTEMPTED); ho_count(ho->new_bts, CTR_INTER_BSC_HO_IN_ATTEMPTED); if (!ho->new_bts) { @@ -919,7 +921,9 @@ void handover_end(struct gsm_subscriber_connection *conn, enum handover_result r if (hdc && hdc->on_handover_end) hdc->on_handover_end(conn, result); + ho_count_bsc(result_counter_BSC_HANDOVER(result)); ho_count_bsc(result_counter_bsc(ho->scope, result)); + ho_count_bts(bts, result_counter_BTS_HANDOVER(result)); ho_count_bts(bts, result_counter_bts(ho->scope, result)); LOG_HO(conn, LOGL_INFO, "Result: %s\n", handover_result_name(result)); -- cgit v1.2.3