Change in osmo-trx[master]: Transceiver: Add several rate_ctr for rx error conditions

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Wed Jul 29 13:43:51 UTC 2020


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/19403 )

Change subject: Transceiver: Add several rate_ctr for rx error conditions
......................................................................

Transceiver: Add several rate_ctr for rx error conditions

Since there's now a rate counter, we can drop log level for those events
which can be bursty and hence print lots of output in short periods of
time, which may affect performance. This way setting them to INFO it's
enough to avoid getting them in stderr unless explicitly configured by
the user (for instance to debug stuff), while still allowing a good
enough level to be enabled for other targets such as gsmtap.

Related: OS#4679
Change-Id: I000f7112e35ac68d3d922444f78468b1ea74cbba
---
M CommonLibs/osmo_signal.h
M CommonLibs/trx_rate_ctr.cpp
M CommonLibs/trx_rate_ctr.h
M Transceiver52M/Transceiver.cpp
4 files changed, 33 insertions(+), 5 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, but someone else must approve
  Hoernchen: Looks good to me, approved



diff --git a/CommonLibs/osmo_signal.h b/CommonLibs/osmo_signal.h
index 13646a1..003e7af 100644
--- a/CommonLibs/osmo_signal.h
+++ b/CommonLibs/osmo_signal.h
@@ -65,4 +65,7 @@
 	unsigned int tx_trxd_fn_repeated;
 	unsigned int tx_trxd_fn_outoforder;
 	unsigned int tx_trxd_fn_skipped;
+	unsigned int rx_empty_burst;
+	unsigned int rx_clipping;
+	unsigned int rx_no_burst_detected;
 };
diff --git a/CommonLibs/trx_rate_ctr.cpp b/CommonLibs/trx_rate_ctr.cpp
index 1f44404..e902ff1 100644
--- a/CommonLibs/trx_rate_ctr.cpp
+++ b/CommonLibs/trx_rate_ctr.cpp
@@ -107,6 +107,9 @@
 	{ 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" },
+	{ TRX_CTR_TRX_RX_EMPTY_BURST,	"rx_empty_burst" },
+	{ TRX_CTR_TRX_RX_CLIPPING,	"rx_clipping" },
+	{ TRX_CTR_TRX_RX_NO_BURST_DETECTED, "rx_no_burst_detected" },
 	{ 0, NULL }
 };
 
@@ -122,6 +125,9 @@
 	[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" },
+	[TRX_CTR_TRX_RX_EMPTY_BURST]		= { "trx:rx_empty_burst",	"Number of Rx bursts empty" },
+	[TRX_CTR_TRX_RX_CLIPPING]		= { "trx:rx_clipping",		"Number of Rx bursts discarded due to clipping" },
+	[TRX_CTR_TRX_RX_NO_BURST_DETECTED]	= { "trx:rx_no_burst_detected",	"Number of Rx burts discarded due to burst detection error" },
 };
 
 static const struct rate_ctr_group_desc trx_chan_ctr_group_desc = {
@@ -182,6 +188,12 @@
 		rate_ctr_add(ctr, trx_ctrs_pending[chan].tx_trxd_fn_outoforder - ctr->current);
 		ctr = &rate_ctrs[chan]->ctr[TRX_CTR_TRX_TRXD_FN_SKIPPED];
 		rate_ctr_add(ctr, trx_ctrs_pending[chan].tx_trxd_fn_skipped - ctr->current);
+		ctr = &rate_ctrs[chan]->ctr[TRX_CTR_TRX_RX_EMPTY_BURST];
+		rate_ctr_add(ctr, trx_ctrs_pending[chan].rx_empty_burst - ctr->current);
+		ctr = &rate_ctrs[chan]->ctr[TRX_CTR_TRX_RX_CLIPPING];
+		rate_ctr_add(ctr, trx_ctrs_pending[chan].rx_clipping - ctr->current);
+		ctr = &rate_ctrs[chan]->ctr[TRX_CTR_TRX_RX_NO_BURST_DETECTED];
+		rate_ctr_add(ctr, trx_ctrs_pending[chan].rx_no_burst_detected - ctr->current);
 		/* Mark as done */
 		trx_ctrs_pending[chan].chan = PENDING_CHAN_NONE;
 	}
diff --git a/CommonLibs/trx_rate_ctr.h b/CommonLibs/trx_rate_ctr.h
index c4c05ef..72125c2 100644
--- a/CommonLibs/trx_rate_ctr.h
+++ b/CommonLibs/trx_rate_ctr.h
@@ -15,6 +15,9 @@
 	TRX_CTR_TRX_TRXD_FN_REPEATED,
 	TRX_CTR_TRX_TRXD_FN_OUTOFORDER,
 	TRX_CTR_TRX_TRXD_FN_SKIPPED,
+	TRX_CTR_TRX_RX_EMPTY_BURST,
+	TRX_CTR_TRX_RX_CLIPPING,
+	TRX_CTR_TRX_RX_NO_BURST_DETECTED,
 };
 
 struct ctr_threshold {
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index c92a61b..c3ef377 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -638,6 +638,7 @@
   GSM::Time burstTime;
   SoftVector *rxBurst;
   TransceiverState *state = &mStates[chan];
+  bool ctr_changed = false;
 
   /* Blocking FIFO read */
   radioVector *radio_burst = mReceiveFIFO[chan]->read();
@@ -687,7 +688,9 @@
   }
 
   if (max_i < 0) {
-    LOGCHAN(chan, DTRXDUL, FATAL) << "Received empty burst";
+    LOGCHAN(chan, DTRXDUL, INFO) << "Received empty burst";
+    state->ctrs.rx_empty_burst++;
+    ctr_changed = true;
     goto ret_idle;
   }
 
@@ -713,10 +716,15 @@
   /* Detect normal or RACH bursts */
   rc = detectAnyBurst(*burst, mTSC, BURST_THRESH, mSPSRx, type, max_toa, &ebp);
   if (rc <= 0) {
-    if (rc == -SIGERR_CLIP)
-      LOGCHAN(chan, DTRXDUL, NOTICE) << "Clipping detected on received RACH or Normal Burst";
-    else if (rc != SIGERR_NONE)
-      LOGCHAN(chan, DTRXDUL, NOTICE) << "Unhandled RACH or Normal Burst detection error";
+    if (rc == -SIGERR_CLIP) {
+      LOGCHAN(chan, DTRXDUL, INFO) << "Clipping detected on received RACH or Normal Burst";
+      state->ctrs.rx_clipping++;
+      ctr_changed = true;
+    } else if (rc != SIGERR_NONE) {
+      LOGCHAN(chan, DTRXDUL, INFO) << "Unhandled RACH or Normal Burst detection error";
+      state->ctrs.rx_no_burst_detected++;
+      ctr_changed = true;
+    }
     goto ret_idle;
   }
 
@@ -743,6 +751,8 @@
   return 0;
 
 ret_idle:
+  if (ctr_changed)
+    dispatch_trx_rate_ctr_change(state, chan);
   bi->idle = true;
   delete radio_burst;
   return 0;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/19403
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I000f7112e35ac68d3d922444f78468b1ea74cbba
Gerrit-Change-Number: 19403
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Hoernchen <ewild at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200729/788640ce/attachment.htm>


More information about the gerrit-log mailing list