diff --git a/src/bts.cpp b/src/bts.cpp index 6f25da14..76358a0c 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -52,8 +52,10 @@ static BTS s_bts; static const struct rate_ctr_desc bts_ctr_description[] = { { "tbf.dl.alloc", "TBF DL Allocated "}, { "tbf.dl.freed", "TBF DL Freed "}, + { "tbf.dl.aborted", "TBF DL Aborted "}, { "tbf.ul.alloc", "TBF UL Allocated "}, { "tbf.ul.freed", "TBF UL Freed "}, + { "tbf.ul.aborted", "TBF UL Aborted "}, { "tbf.reused", "TBF Reused "}, { "tbf.alloc.algo-a", "TBF Alloc Algo A "}, { "tbf.alloc.algo-b", "TBF Alloc Algo B "}, diff --git a/src/bts.h b/src/bts.h index 14b6c1f8..119f6b2c 100644 --- a/src/bts.h +++ b/src/bts.h @@ -212,8 +212,10 @@ public: enum { CTR_TBF_DL_ALLOCATED, CTR_TBF_DL_FREED, + CTR_TBF_DL_ABORTED, CTR_TBF_UL_ALLOCATED, CTR_TBF_UL_FREED, + CTR_TBF_UL_ABORTED, CTR_TBF_REUSED, CTR_TBF_ALLOC_ALGO_A, CTR_TBF_ALLOC_ALGO_B, @@ -286,8 +288,10 @@ public: */ void tbf_dl_created(); void tbf_dl_freed(); + void tbf_dl_aborted(); void tbf_ul_created(); void tbf_ul_freed(); + void tbf_ul_aborted(); void tbf_reused(); void tbf_alloc_algo_a(); void tbf_alloc_algo_b(); @@ -424,8 +428,10 @@ inline struct osmo_stat_item_group *BTS::stat_items() const CREATE_COUNT_INLINE(tbf_dl_created, CTR_TBF_DL_ALLOCATED) CREATE_COUNT_INLINE(tbf_dl_freed, CTR_TBF_DL_FREED) +CREATE_COUNT_INLINE(tbf_dl_aborted, CTR_TBF_DL_ABORTED) CREATE_COUNT_INLINE(tbf_ul_created, CTR_TBF_UL_ALLOCATED) CREATE_COUNT_INLINE(tbf_ul_freed, CTR_TBF_UL_FREED) +CREATE_COUNT_INLINE(tbf_ul_aborted, CTR_TBF_UL_ABORTED) CREATE_COUNT_INLINE(tbf_reused, CTR_TBF_REUSED) CREATE_COUNT_INLINE(tbf_alloc_algo_a, CTR_TBF_ALLOC_ALGO_A) CREATE_COUNT_INLINE(tbf_alloc_algo_b, CTR_TBF_ALLOC_ALGO_B) diff --git a/src/tbf.cpp b/src/tbf.cpp index c852d665..e8a9e3e9 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -310,6 +310,17 @@ static void tbf_unlink_pdch(struct gprs_rlcmac_tbf *tbf) void tbf_free(struct gprs_rlcmac_tbf *tbf) { + /* update counters */ + if (tbf->direction == GPRS_RLCMAC_UL_TBF) { + tbf->bts->tbf_ul_freed(); + if (tbf->state_is(GPRS_RLCMAC_FLOW)) + tbf->bts->tbf_ul_aborted(); + } else { + tbf->bts->tbf_dl_freed(); + if (tbf->state_is(GPRS_RLCMAC_FLOW)) + tbf->bts->tbf_dl_aborted(); + } + /* Give final measurement report */ gprs_rlcmac_rssi_rep(tbf); if (tbf->direction == GPRS_RLCMAC_DL_TBF) { @@ -336,11 +347,6 @@ void tbf_free(struct gprs_rlcmac_tbf *tbf) tbf_unlink_pdch(tbf); llist_del(&tbf->list()); - if (tbf->direction == GPRS_RLCMAC_UL_TBF) - tbf->bts->tbf_ul_freed(); - else - tbf->bts->tbf_dl_freed(); - if (tbf->ms()) tbf->set_ms(NULL);