aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2016-01-21 20:12:04 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2016-02-08 00:45:37 +0100
commit0316dc6e4808d0413a4edf3738edea44193228e4 (patch)
tree61f4acaf36b443c2700e9bff1c8836dd472f717c
parent29e3a2f0f3d3cacdb741d406e43b0c725fffd81e (diff)
tbf: Add counters for aborted TBF in state FLOW
Increment CTR_TBF_DL_ABORTED/CTR_TBF_UL_ABORTED if a TBF gets freed that is still in state GPRS_RLCMAC_FLOW. Sponsored-by: On-Waves ehf
-rw-r--r--src/bts.cpp2
-rw-r--r--src/bts.h6
-rw-r--r--src/tbf.cpp16
3 files changed, 19 insertions, 5 deletions
diff --git a/src/bts.cpp b/src/bts.cpp
index 0d3e32a..c0918dd 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 14b6c1f..119f6b2 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 c852d66..e8a9e3e 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);