[PATCH] osmocom-bb[master]: host/trxcon/scheduler: separate logging of data messages

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Feb 22 15:33:25 UTC 2018


Review at  https://gerrit.osmocom.org/6783

host/trxcon/scheduler: separate logging of data messages

Change-Id: I3a33687a688db2a183b546425f71c7a0a7030594
---
M src/host/trxcon/logging.c
M src/host/trxcon/logging.h
M src/host/trxcon/sched_lchan_rach.c
M src/host/trxcon/sched_lchan_sch.c
M src/host/trxcon/sched_lchan_xcch.c
M src/host/trxcon/sched_trx.c
6 files changed, 22 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/83/6783/1

diff --git a/src/host/trxcon/logging.c b/src/host/trxcon/logging.c
index 119456b..a76b4d9 100644
--- a/src/host/trxcon/logging.c
+++ b/src/host/trxcon/logging.c
@@ -60,7 +60,13 @@
 	},
 	[DSCH] = {
 		.name = "DSCH",
-		.description = "Scheduler",
+		.description = "Scheduler management",
+		.color = "\033[1;36m",
+		.enabled = 1, .loglevel = LOGL_NOTICE,
+	},
+	[DSCHD] = {
+		.name = "DSCHD",
+		.description = "Scheduler data",
 		.color = "\033[1;36m",
 		.enabled = 1, .loglevel = LOGL_NOTICE,
 	},
diff --git a/src/host/trxcon/logging.h b/src/host/trxcon/logging.h
index 6221c55..0206362 100644
--- a/src/host/trxcon/logging.h
+++ b/src/host/trxcon/logging.h
@@ -2,7 +2,7 @@
 
 #include <osmocom/core/logging.h>
 
-#define DEBUG_DEFAULT "DAPP:DL1C:DL1D:DTRX:DTRXD:DSCH"
+#define DEBUG_DEFAULT "DAPP:DL1C:DL1D:DTRX:DTRXD:DSCH:DSCHD"
 
 enum {
 	DAPP,
@@ -11,6 +11,7 @@
 	DTRX,
 	DTRXD,
 	DSCH,
+	DSCHD,
 };
 
 int trx_log_init(const char *category_mask);
diff --git a/src/host/trxcon/sched_lchan_rach.c b/src/host/trxcon/sched_lchan_rach.c
index 613f644..8201783 100644
--- a/src/host/trxcon/sched_lchan_rach.c
+++ b/src/host/trxcon/sched_lchan_rach.c
@@ -73,7 +73,7 @@
 	/* Encode payload */
 	rc = gsm0503_rach_encode(payload, &req->ra, trx->bsic);
 	if (rc) {
-		LOGP(DSCH, LOGL_ERROR, "Could not encode RACH burst\n");
+		LOGP(DSCHD, LOGL_ERROR, "Could not encode RACH burst\n");
 		return rc;
 	}
 
@@ -83,12 +83,12 @@
 	memcpy(burst + 49, payload, 36); /* payload */
 	memset(burst + 85, 0, 63); /* TB + GP */
 
-	LOGP(DSCH, LOGL_DEBUG, "Transmitting RACH fn=%u\n", fn);
+	LOGP(DSCHD, LOGL_DEBUG, "Transmitting RACH fn=%u\n", fn);
 
 	/* Send burst to transceiver */
 	rc = trx_if_tx_burst(trx, ts->index, fn, trx->tx_power, burst);
 	if (rc) {
-		LOGP(DSCH, LOGL_ERROR, "Could not send burst to transceiver\n");
+		LOGP(DSCHD, LOGL_ERROR, "Could not send burst to transceiver\n");
 		return rc;
 	}
 
diff --git a/src/host/trxcon/sched_lchan_sch.c b/src/host/trxcon/sched_lchan_sch.c
index db73b92..6b4543f 100644
--- a/src/host/trxcon/sched_lchan_sch.c
+++ b/src/host/trxcon/sched_lchan_sch.c
@@ -87,19 +87,19 @@
 	/* Attempt to decode */
 	rc = gsm0503_sch_decode(sb_info, payload);
 	if (rc) {
-		LOGP(DSCH, LOGL_DEBUG, "Received bad SCH burst at fn=%u\n", fn);
+		LOGP(DSCHD, LOGL_DEBUG, "Received bad SCH burst at fn=%u\n", fn);
 		return rc;
 	}
 
 	/* Decode BSIC and TDMA frame number */
 	decode_sb(&time, &bsic, sb_info);
 
-	LOGP(DSCH, LOGL_DEBUG, "Received SCH: bsic=%u, fn=%u, sched_fn=%u\n",
+	LOGP(DSCHD, LOGL_DEBUG, "Received SCH: bsic=%u, fn=%u, sched_fn=%u\n",
 		bsic, time.fn, trx->sched.fn_counter_proc);
 
 	/* Check if decoded frame number matches */
 	if (time.fn != fn) {
-		LOGP(DSCH, LOGL_ERROR, "Decoded fn=%u does not match "
+		LOGP(DSCHD, LOGL_ERROR, "Decoded fn=%u does not match "
 			"fn=%u provided by scheduler\n", time.fn, fn);
 		return -EINVAL;
 	}
diff --git a/src/host/trxcon/sched_lchan_xcch.c b/src/host/trxcon/sched_lchan_xcch.c
index 958d80d..f57c8fc 100644
--- a/src/host/trxcon/sched_lchan_xcch.c
+++ b/src/host/trxcon/sched_lchan_xcch.c
@@ -65,7 +65,7 @@
 	toa_sum = &lchan->toa_sum;
 	toa_num = &lchan->toa_num;
 
-	LOGP(DSCH, LOGL_DEBUG, "Data received on %s: fn=%u ts=%u bid=%u\n",
+	LOGP(DSCHD, LOGL_DEBUG, "Data received on %s: fn=%u ts=%u bid=%u\n",
 		lchan_desc->name, fn, ts->index, bid);
 
 	/* Clear buffer & store frame number of first burst */
@@ -99,7 +99,7 @@
 
 	/* Check for complete set of bursts */
 	if ((*mask & 0xf) != 0xf) {
-		LOGP(DSCH, LOGL_DEBUG, "Received incomplete data frame at "
+		LOGP(DSCHD, LOGL_DEBUG, "Received incomplete data frame at "
 			"fn=%u (%u/%u) for %s\n", *first_fn,
 			(*first_fn) % ts->mf_layout->period,
 			ts->mf_layout->period,
@@ -111,7 +111,7 @@
 	/* Attempt to decode */
 	rc = gsm0503_xcch_decode(l2, buffer, &n_errors, &n_bits_total);
 	if (rc) {
-		LOGP(DSCH, LOGL_DEBUG, "Received bad data frame at fn=%u "
+		LOGP(DSCHD, LOGL_DEBUG, "Received bad data frame at fn=%u "
 			"(%u/%u) for %s\n", *first_fn,
 			(*first_fn) % ts->mf_layout->period,
 			ts->mf_layout->period,
@@ -159,7 +159,7 @@
 	/* Encode bursts */
 	rc = gsm0503_xcch_encode(buffer, l2);
 	if (rc) {
-		LOGP(DSCH, LOGL_ERROR, "Failed to encode L2 payload\n");
+		LOGP(DSCHD, LOGL_ERROR, "Failed to encode L2 payload\n");
 
 		/* Remove primitive from queue and free memory */
 		llist_del(&prim->list);
@@ -185,13 +185,13 @@
 	memcpy(burst + 87, offset + 58, 58); /* Payload 2/2 */
 	memset(burst + 145, 0, 3); /* TB */
 
-	LOGP(DSCH, LOGL_DEBUG, "Transmitting %s fn=%u ts=%u burst=%u\n",
+	LOGP(DSCHD, LOGL_DEBUG, "Transmitting %s fn=%u ts=%u burst=%u\n",
 		lchan_desc->name, fn, ts->index, bid);
 
 	/* Send burst to transceiver */
 	rc = trx_if_tx_burst(trx, ts->index, fn, trx->tx_power, burst);
 	if (rc) {
-		LOGP(DSCH, LOGL_ERROR, "Could not send burst to transceiver\n");
+		LOGP(DSCHD, LOGL_ERROR, "Could not send burst to transceiver\n");
 
 		/* Remove primitive from queue and free memory */
 		prim = llist_entry(ts->tx_prims.next, struct trx_ts_prim, list);
diff --git a/src/host/trxcon/sched_trx.c b/src/host/trxcon/sched_trx.c
index c7520b9..b7ebfeb 100644
--- a/src/host/trxcon/sched_trx.c
+++ b/src/host/trxcon/sched_trx.c
@@ -533,7 +533,7 @@
 	/* Check whether required timeslot is allocated and configured */
 	ts = trx->ts_list[tn];
 	if (ts == NULL || ts->mf_layout == NULL) {
-		LOGP(DSCH, LOGL_DEBUG, "TDMA timeslot #%u isn't configured, "
+		LOGP(DSCHD, LOGL_DEBUG, "TDMA timeslot #%u isn't configured, "
 			"ignoring burst...\n", tn);
 		return -EINVAL;
 	}

-- 
To view, visit https://gerrit.osmocom.org/6783
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3a33687a688db2a183b546425f71c7a0a7030594
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list