fixeria has submitted this change. (
https://gerrit.osmocom.org/c/osmo-bts/+/33729 )
Change subject: osmo-bts-trx: unify and enrich 'Received bad data' logging
......................................................................
osmo-bts-trx: unify and enrich 'Received bad data' logging
Change-Id: I7902f382e1d83ef9ad2cf6f92e31eeb16f6b797c
---
M src/osmo-bts-trx/sched_lchan_pdtch.c
M src/osmo-bts-trx/sched_lchan_tchf.c
M src/osmo-bts-trx/sched_lchan_tchh.c
M src/osmo-bts-trx/sched_lchan_xcch.c
M src/osmo-bts-trx/sched_utils.h
5 files changed, 23 insertions(+), 27 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/osmo-bts-trx/sched_lchan_pdtch.c b/src/osmo-bts-trx/sched_lchan_pdtch.c
index fd813b9..1720537 100644
--- a/src/osmo-bts-trx/sched_lchan_pdtch.c
+++ b/src/osmo-bts-trx/sched_lchan_pdtch.c
@@ -122,8 +122,8 @@
if (rc > 0) {
presence_info = PRES_INFO_BOTH;
} else {
- LOGL1SB(DL1P, LOGL_DEBUG, l1ts, bi, "Received bad PDTCH (%u/%u)\n",
- bi->fn % l1ts->mf_period, l1ts->mf_period);
+ LOGL1SB(DL1P, LOGL_NOTICE, l1ts, bi,
+ BAD_DATA_MSG_FMT "\n", BAD_DATA_MSG_ARGS);
rc = 0;
presence_info = PRES_INFO_INVALID;
}
diff --git a/src/osmo-bts-trx/sched_lchan_tchf.c b/src/osmo-bts-trx/sched_lchan_tchf.c
index 2b2d1f4..69ce488 100644
--- a/src/osmo-bts-trx/sched_lchan_tchf.c
+++ b/src/osmo-bts-trx/sched_lchan_tchf.c
@@ -113,7 +113,6 @@
int rc, amr = 0;
int n_errors = 0;
int n_bits_total = 0;
- bool bfi_flag = false;
unsigned int fn_begin;
uint16_t ber10k;
uint8_t is_sub = 0;
@@ -301,20 +300,13 @@
trx_loop_amr_input(chan_state, &meas_avg);
/* Check if the frame is bad */
- if (rc < 0) {
- LOGL1SB(DL1P, LOGL_NOTICE, l1ts, bi, "Received bad data (%u/%u)\n",
- bi->fn % l1ts->mf_period, l1ts->mf_period);
- bfi_flag = true;
- } else if (rc < 4) {
+ if (rc < 4) {
LOGL1SB(DL1P, LOGL_NOTICE, l1ts, bi,
- "Received bad data (%u/%u) with invalid codec mode %d\n",
- bi->fn % l1ts->mf_period, l1ts->mf_period, rc);
- bfi_flag = true;
+ BAD_DATA_MSG_FMT "\n", BAD_DATA_MSG_ARGS);
+ rc = 0; /* this is how we signal BFI to l1sap */
}
ber10k = compute_ber10k(n_bits_total, n_errors);
- if (bfi_flag)
- rc = 0; /* this is how we signal BFI to l1sap */
/* FACCH */
if (rc == GSM_MACBLOCK_LEN) {
diff --git a/src/osmo-bts-trx/sched_lchan_tchh.c b/src/osmo-bts-trx/sched_lchan_tchh.c
index d7f2227..a128320 100644
--- a/src/osmo-bts-trx/sched_lchan_tchh.c
+++ b/src/osmo-bts-trx/sched_lchan_tchh.c
@@ -169,7 +169,6 @@
int amr = 0;
int n_errors = 0;
int n_bits_total = 0;
- bool bfi_flag = false;
enum sched_meas_avg_mode meas_avg_mode = SCHED_MEAS_AVG_M_S6N4;
struct l1sched_meas_set meas_avg;
unsigned int fn_begin;
@@ -358,19 +357,11 @@
trx_loop_amr_input(chan_state, &meas_avg);
/* Check if the frame is bad */
- if (rc < 0) {
- LOGL1SB(DL1P, LOGL_NOTICE, l1ts, bi, "Received bad data (%u/%u)\n",
- bi->fn % l1ts->mf_period, l1ts->mf_period);
- bfi_flag = true;
- } else if (rc < 4) {
+ if (rc < 4) {
LOGL1SB(DL1P, LOGL_NOTICE, l1ts, bi,
- "Received bad data (%u/%u) with invalid codec mode %d\n",
- bi->fn % l1ts->mf_period, l1ts->mf_period, rc);
- bfi_flag = true;
- }
-
- if (bfi_flag)
+ BAD_DATA_MSG_FMT "\n", BAD_DATA_MSG_ARGS);
rc = 0; /* this is how we signal BFI to l1sap */
+ }
/* FACCH */
if (rc == GSM_MACBLOCK_LEN) {
diff --git a/src/osmo-bts-trx/sched_lchan_xcch.c b/src/osmo-bts-trx/sched_lchan_xcch.c
index 3c67b23..ccf685f 100644
--- a/src/osmo-bts-trx/sched_lchan_xcch.c
+++ b/src/osmo-bts-trx/sched_lchan_xcch.c
@@ -113,8 +113,8 @@
/* decode */
rc = gsm0503_xcch_decode(l2, bursts_p, &n_errors, &n_bits_total);
if (rc) {
- LOGL1SB(DL1P, LOGL_NOTICE, l1ts, bi, "Received bad data (%u/%u)\n",
- bi->fn % l1ts->mf_period, l1ts->mf_period);
+ LOGL1SB(DL1P, LOGL_NOTICE, l1ts, bi,
+ BAD_DATA_MSG_FMT "\n", BAD_DATA_MSG_ARGS);
l2_len = 0;
/* When SACCH Repetition is active, we may try to decode the
diff --git a/src/osmo-bts-trx/sched_utils.h b/src/osmo-bts-trx/sched_utils.h
index 4521a2e..4e8c17e 100644
--- a/src/osmo-bts-trx/sched_utils.h
+++ b/src/osmo-bts-trx/sched_utils.h
@@ -35,6 +35,10 @@
extern void *tall_bts_ctx;
+#define BAD_DATA_MSG_FMT "Received bad data (rc=%d, BER %d/%d) ending at
fn=%u/%u"
+#define BAD_DATA_MSG_ARGS \
+ rc, n_errors, n_bits_total, bi->fn % l1ts->mf_period, l1ts->mf_period
+
/* Compute the bit error rate in 1/10000 units */
static inline uint16_t compute_ber10k(int n_bits_total, int n_errors)
{
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bts/+/33729
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I7902f382e1d83ef9ad2cf6f92e31eeb16f6b797c
Gerrit-Change-Number: 33729
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged