aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-27 09:50:15 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2013-10-30 21:24:12 +0100
commit158776411b13cdda080dd3b72296fb97a0141d64 (patch)
treecbc1d6db8d95883b95efc62d84908d5ba86ae0b9
parentf537298ccad65dfb64076c5a68895eb93743c432 (diff)
bts: Provide the first set of counters
-rw-r--r--src/bts.cpp3
-rw-r--r--src/bts.h25
-rw-r--r--src/tbf.cpp13
3 files changed, 39 insertions, 2 deletions
diff --git a/src/bts.cpp b/src/bts.cpp
index 29e5834..39c1fd5 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -664,6 +664,7 @@ int gprs_rlcmac_pdch::rcv_data_block_acknowledged(uint8_t *data, uint8_t len, in
case 23:
break;
default:
+ bts()->decode_error();
LOGP(DRLCMACUL, LOGL_ERROR, "Dropping data block with invalid"
"length: %d)\n", len);
return -EINVAL;
@@ -696,6 +697,7 @@ int gprs_rlcmac_pdch::rcv_data_block_acknowledged(uint8_t *data, uint8_t len, in
}
rc = Decoding::tlli_from_ul_data(data, len, &tbf->tlli);
if (rc) {
+ bts()->decode_error();
LOGP(DRLCMACUL, LOGL_NOTICE, "Failed to decode TLLI "
"of UL DATA TBF=%d.\n", rh->tfi);
return 0;
@@ -1101,6 +1103,7 @@ int gprs_rlcmac_pdch::rcv_control_block(
gprs_rlcmac_meas_rep(&ul_control_block->u.Packet_Measurement_Report);
break;
default:
+ bts()->decode_error();
LOGP(DRLCMAC, LOGL_NOTICE, "RX: [PCU <- BTS] unknown control block received\n");
}
talloc_free(ul_control_block);
diff --git a/src/bts.h b/src/bts.h
index af51e47..eec3493 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -237,6 +237,31 @@ inline struct rate_ctr_group *BTS::rate_counters() const
return m_ratectrs;
}
+inline void BTS::tbf_dl_created()
+{
+ rate_ctr_inc(&m_ratectrs->ctr[CTR_TBF_DL_ALLOCATED]);
+}
+
+inline void BTS::tbf_dl_freed()
+{
+ rate_ctr_inc(&m_ratectrs->ctr[CTR_TBF_DL_FREED]);
+}
+
+inline void BTS::tbf_ul_created()
+{
+ rate_ctr_inc(&m_ratectrs->ctr[CTR_TBF_UL_ALLOCATED]);
+}
+
+inline void BTS::tbf_ul_freed()
+{
+ rate_ctr_inc(&m_ratectrs->ctr[CTR_TBF_UL_FREED]);
+}
+
+inline void BTS::decode_error()
+{
+ rate_ctr_inc(&m_ratectrs->ctr[CTR_DECODE_ERRORS]);
+}
+
inline gprs_rlcmac_bts *gprs_rlcmac_pdch::bts_data() const
{
return trx->bts->bts_data();
diff --git a/src/tbf.cpp b/src/tbf.cpp
index eb76ab8..cdd8098 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -328,6 +328,12 @@ void tbf_free(struct gprs_rlcmac_tbf *tbf)
msgb_free(msg);
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();
+
LOGP(DRLCMAC, LOGL_DEBUG, "********** TBF ends here **********\n");
talloc_free(tbf);
}
@@ -602,10 +608,13 @@ next_diagram:
gettimeofday(&tbf->meas.dl_loss_tv, NULL);
INIT_LLIST_HEAD(&tbf->llc_queue);
- if (dir == GPRS_RLCMAC_UL_TBF)
+ if (dir == GPRS_RLCMAC_UL_TBF) {
llist_add(&tbf->list, &bts->ul_tbfs);
- else
+ tbf->bts->tbf_ul_created();
+ } else {
llist_add(&tbf->list, &bts->dl_tbfs);
+ tbf->bts->tbf_dl_created();
+ }
debug_diagram(bts->bts, tbf->diag, "+-----------------+");
debug_diagram(bts->bts, tbf->diag, "|NEW %s TBF TFI=%2d|",