Add rate counter for missing Txbursts when scheduled towards the radioInterface

Related: OS#4487
Change-Id: Ibb2c492b3c67cbab11fbb936ae3a090fb5756aa8
This commit is contained in:
Pau Espin 2020-07-09 18:09:10 +02:00
parent 8b0c5368f5
commit 1d0c6fe752
5 changed files with 20 additions and 6 deletions

View File

@ -60,7 +60,8 @@ struct device_counters {
/* signal cb for signal <SS_DEVICE,S_TRX_COUNTER_CHANGE> */
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;

View File

@ -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];

View File

@ -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,

View File

@ -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) \

View File

@ -431,13 +431,14 @@ void Transceiver::pushRadioVector(GSM::Time &nowTime)
std::vector<signalVector *> bursts(mChans);
std::vector<bool> zeros(mChans);
std::vector<bool> 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);
}