From 1d0c6fe7529395a629f78582c293775beed27afe Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 9 Jul 2020 18:09:10 +0200 Subject: [PATCH] Add rate counter for missing Txbursts when scheduled towards the radioInterface Related: OS#4487 Change-Id: Ibb2c492b3c67cbab11fbb936ae3a090fb5756aa8 --- CommonLibs/osmo_signal.h | 3 ++- CommonLibs/trx_rate_ctr.cpp | 4 ++++ CommonLibs/trx_rate_ctr.h | 1 + CommonLibs/trx_vty.c | 3 ++- Transceiver52M/Transceiver.cpp | 15 +++++++++++---- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/CommonLibs/osmo_signal.h b/CommonLibs/osmo_signal.h index 5cd90c6a..13646a13 100644 --- a/CommonLibs/osmo_signal.h +++ b/CommonLibs/osmo_signal.h @@ -60,7 +60,8 @@ struct device_counters { /* signal cb for signal */ struct trx_counters { size_t chan; - unsigned int tx_stale_bursts; /* Amount of Tx bursts dropped to to arriving too late from TRXD */ + unsigned int tx_stale_bursts; + unsigned int tx_unavailable_bursts; unsigned int tx_trxd_fn_repeated; unsigned int tx_trxd_fn_outoforder; unsigned int tx_trxd_fn_skipped; diff --git a/CommonLibs/trx_rate_ctr.cpp b/CommonLibs/trx_rate_ctr.cpp index 8b2597d6..e45aba88 100644 --- a/CommonLibs/trx_rate_ctr.cpp +++ b/CommonLibs/trx_rate_ctr.cpp @@ -103,6 +103,7 @@ const struct value_string trx_chan_ctr_names[] = { { TRX_CTR_DEV_TX_DROP_EV, "tx_drop_events" }, { TRX_CTR_DEV_TX_DROP_SMPL, "tx_drop_samples" }, { TRX_CTR_TRX_TX_STALE_BURSTS, "tx_stale_bursts" }, + { TRX_CTR_TRX_TX_UNAVAILABLE_BURSTS, "tx_unavailable_bursts" }, { TRX_CTR_TRX_TRXD_FN_REPEATED, "tx_trxd_fn_repeated" }, { TRX_CTR_TRX_TRXD_FN_OUTOFORDER, "tx_trxd_fn_outoforder" }, { TRX_CTR_TRX_TRXD_FN_SKIPPED, "tx_trxd_fn_skipped" }, @@ -117,6 +118,7 @@ static const struct rate_ctr_desc trx_chan_ctr_desc[] = { [TRX_CTR_DEV_TX_DROP_EV] = { "device:tx_drop_events", "Number of times Tx samples were dropped by HW" }, [TRX_CTR_DEV_TX_DROP_SMPL] = { "device:tx_drop_samples", "Number of Tx samples dropped by HW" }, [TRX_CTR_TRX_TX_STALE_BURSTS] = { "trx:tx_stale_bursts", "Number of Tx burts dropped by TRX due to arriving too late" }, + [TRX_CTR_TRX_TX_UNAVAILABLE_BURSTS] = { "trx:tx_unavailable_bursts","Number of Tx burts unavailable (not enqueued) at the time they should be transmitted" }, [TRX_CTR_TRX_TRXD_FN_REPEATED] = { "trx:tx_trxd_fn_repeated", "Number of Tx burts received from TRXD with repeated FN" }, [TRX_CTR_TRX_TRXD_FN_OUTOFORDER] = { "trx:tx_trxd_fn_outoforder","Number of Tx burts received from TRXD with a past FN" }, [TRX_CTR_TRX_TRXD_FN_SKIPPED] = { "trx:tx_trxd_fn_skipped", "Number of Tx burts potentially skipped due to FN jumps" }, @@ -172,6 +174,8 @@ static int trx_rate_ctr_timerfd_cb(struct osmo_fd *ofd, unsigned int what) { LOGCHAN(chan, DMAIN, INFO) << "rate_ctr update"; ctr = &rate_ctrs[chan]->ctr[TRX_CTR_TRX_TX_STALE_BURSTS]; rate_ctr_add(ctr, trx_ctrs_pending[chan].tx_stale_bursts - ctr->current); + ctr = &rate_ctrs[chan]->ctr[TRX_CTR_TRX_TX_UNAVAILABLE_BURSTS]; + rate_ctr_add(ctr, trx_ctrs_pending[chan].tx_unavailable_bursts - ctr->current); ctr = &rate_ctrs[chan]->ctr[TRX_CTR_TRX_TRXD_FN_REPEATED]; rate_ctr_add(ctr, trx_ctrs_pending[chan].tx_trxd_fn_repeated - ctr->current); ctr = &rate_ctrs[chan]->ctr[TRX_CTR_TRX_TRXD_FN_OUTOFORDER]; diff --git a/CommonLibs/trx_rate_ctr.h b/CommonLibs/trx_rate_ctr.h index cef3c21f..c4c05efd 100644 --- a/CommonLibs/trx_rate_ctr.h +++ b/CommonLibs/trx_rate_ctr.h @@ -11,6 +11,7 @@ enum TrxCtr { TRX_CTR_DEV_TX_DROP_EV, TRX_CTR_DEV_TX_DROP_SMPL, TRX_CTR_TRX_TX_STALE_BURSTS, + TRX_CTR_TRX_TX_UNAVAILABLE_BURSTS, TRX_CTR_TRX_TRXD_FN_REPEATED, TRX_CTR_TRX_TRXD_FN_OUTOFORDER, TRX_CTR_TRX_TRXD_FN_SKIPPED, diff --git a/CommonLibs/trx_vty.c b/CommonLibs/trx_vty.c index 941a4354..e37ecaf8 100644 --- a/CommonLibs/trx_vty.c +++ b/CommonLibs/trx_vty.c @@ -390,7 +390,7 @@ static int vty_intv_name_2_id(const char* str) { return -1; } -#define THRESHOLD_ARGS "(rx_overruns|tx_underruns|rx_drop_events|rx_drop_samples|tx_drop_events|tx_drop_samples|tx_stale_bursts|tx_trxd_fn_repeated|tx_trxd_fn_outoforder|tx_trxd_fn_skipped)" +#define THRESHOLD_ARGS "(rx_overruns|tx_underruns|rx_drop_events|rx_drop_samples|tx_drop_events|tx_drop_samples|tx_stale_bursts|tx_unavailable_bursts|tx_trxd_fn_repeated|tx_trxd_fn_outoforder|tx_trxd_fn_skipped)" #define THRESHOLD_STR_VAL(s) "Set threshold value for rate_ctr device:" OSMO_STRINGIFY_VAL(s) "\n" #define THRESHOLD_STRS \ THRESHOLD_STR_VAL(rx_overruns) \ @@ -400,6 +400,7 @@ static int vty_intv_name_2_id(const char* str) { THRESHOLD_STR_VAL(tx_drop_events) \ THRESHOLD_STR_VAL(tx_drop_samples) \ THRESHOLD_STR_VAL(tx_stale_bursts) \ + THRESHOLD_STR_VAL(tx_unavailable_bursts) \ THRESHOLD_STR_VAL(tx_trxd_fn_repeated) \ THRESHOLD_STR_VAL(tx_trxd_fn_outoforder) \ THRESHOLD_STR_VAL(tx_trxd_fn_skipped) \ diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index 7aaf1d49..5e421789 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -431,13 +431,14 @@ void Transceiver::pushRadioVector(GSM::Time &nowTime) std::vector bursts(mChans); std::vector zeros(mChans); std::vector filler(mChans, true); - bool stale_bursts_changed; + bool ratectr_changed; TN = nowTime.TN(); for (size_t i = 0; i < mChans; i ++) { state = &mStates[i]; - stale_bursts_changed = false; + ratectr_changed = false; + zeros[i] = state->chanType[TN] == NONE; Mutex *mtx = mTxPriorityQueues[i].getMutex(); @@ -447,7 +448,7 @@ void Transceiver::pushRadioVector(GSM::Time &nowTime) LOGCHAN(i, DTRXDDL, NOTICE) << "dumping STALE burst in TRX->SDR interface (" << burst->getTime() <<" vs " << nowTime << "), retrans=" << state->mRetrans; state->ctrs.tx_stale_bursts++; - stale_bursts_changed = true; + ratectr_changed = true; if (state->mRetrans) updateFillerTable(i, burst); delete burst; @@ -467,11 +468,17 @@ void Transceiver::pushRadioVector(GSM::Time &nowTime) } else { modFN = nowTime.FN() % state->fillerModulus[TN]; bursts[i] = state->fillerTable[modFN][TN]; + if (state->chanType[TN] != NONE) { + LOGCHAN(i, DTRXDDL, NOTICE) << "No Tx burst available for " << nowTime + << ", retrans=" << state->mRetrans; + state->ctrs.tx_unavailable_bursts++; + ratectr_changed = true; + } } mtx->unlock(); - if (stale_bursts_changed) + if (ratectr_changed) dispatch_trx_rate_ctr_change(state, i); }