[PATCH] osmo-bts[master]: scheduler: log lchan on which prim error occured

Max gerrit-no-reply at lists.osmocom.org
Mon Jan 9 12:59:48 UTC 2017


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

scheduler: log lchan on which prim error occured

Log both lchan and trx_chan_type (using introduced value_string).

Change-Id: I80c581b54eeee371ee524a75a400d1e9ece16c68
---
M include/osmo-bts/scheduler.h
M src/common/scheduler.c
2 files changed, 53 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/50/1550/1

diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index b0387db..33a99bb 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -1,6 +1,8 @@
 #ifndef TRX_SCHEDULER_H
 #define TRX_SCHEDULER_H
 
+#include <osmocom/core/utils.h>
+
 #include <osmo-bts/gsm_data.h>
 
 /* These types define the different channels on a multiframe.
@@ -48,6 +50,8 @@
 	_TRX_CHAN_MAX
 };
 
+extern const struct value_string trx_chan_type_names[];
+
 #define GSM_BURST_LEN		148
 #define GPRS_BURST_LEN		GSM_BURST_LEN
 #define EGPRS_BURST_LEN		444
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index fd5c584..724fb5a 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -156,6 +156,48 @@
       {	1,	TRXC_PTCCH,	0x08,	LID_DEDIC,	"PTCCH",	rts_data_fn,	tx_data_fn,	rx_data_fn,	0 },
 };
 
+const struct value_string trx_chan_type_names[] = {
+	OSMO_VALUE_STRING(TRXC_IDLE),
+	OSMO_VALUE_STRING(TRXC_FCCH),
+	OSMO_VALUE_STRING(TRXC_SCH),
+	OSMO_VALUE_STRING(TRXC_BCCH),
+	OSMO_VALUE_STRING(TRXC_RACH),
+	OSMO_VALUE_STRING(TRXC_CCCH),
+	OSMO_VALUE_STRING(TRXC_TCHF),
+	OSMO_VALUE_STRING(TRXC_TCHH_0),
+	OSMO_VALUE_STRING(TRXC_TCHH_1),
+	OSMO_VALUE_STRING(TRXC_SDCCH4_0),
+	OSMO_VALUE_STRING(TRXC_SDCCH4_1),
+	OSMO_VALUE_STRING(TRXC_SDCCH4_2),
+	OSMO_VALUE_STRING(TRXC_SDCCH4_3),
+	OSMO_VALUE_STRING(TRXC_SDCCH8_0),
+	OSMO_VALUE_STRING(TRXC_SDCCH8_1),
+	OSMO_VALUE_STRING(TRXC_SDCCH8_2),
+	OSMO_VALUE_STRING(TRXC_SDCCH8_3),
+	OSMO_VALUE_STRING(TRXC_SDCCH8_4),
+	OSMO_VALUE_STRING(TRXC_SDCCH8_5),
+	OSMO_VALUE_STRING(TRXC_SDCCH8_6),
+	OSMO_VALUE_STRING(TRXC_SDCCH8_7),
+	OSMO_VALUE_STRING(TRXC_SACCHTF),
+	OSMO_VALUE_STRING(TRXC_SACCHTH_0),
+	OSMO_VALUE_STRING(TRXC_SACCHTH_1),
+	OSMO_VALUE_STRING(TRXC_SACCH4_0),
+	OSMO_VALUE_STRING(TRXC_SACCH4_1),
+	OSMO_VALUE_STRING(TRXC_SACCH4_2),
+	OSMO_VALUE_STRING(TRXC_SACCH4_3),
+	OSMO_VALUE_STRING(TRXC_SACCH8_0),
+	OSMO_VALUE_STRING(TRXC_SACCH8_1),
+	OSMO_VALUE_STRING(TRXC_SACCH8_2),
+	OSMO_VALUE_STRING(TRXC_SACCH8_3),
+	OSMO_VALUE_STRING(TRXC_SACCH8_4),
+	OSMO_VALUE_STRING(TRXC_SACCH8_5),
+	OSMO_VALUE_STRING(TRXC_SACCH8_6),
+	OSMO_VALUE_STRING(TRXC_SACCH8_7),
+	OSMO_VALUE_STRING(TRXC_PDTCH),
+	OSMO_VALUE_STRING(TRXC_PTCCH),
+	OSMO_VALUE_STRING(_TRX_CHAN_MAX),
+ 	{ 0, NULL }
+};
 
 /*
  * init / exit
@@ -264,10 +306,13 @@
 		}
 		if (prim_fn > 100) {
 			LOGP(DL1C, LOGL_NOTICE, "Prim for trx=%u ts=%u at fn=%u "
-				"is out of range, or channel already disabled. "
-				"If this happens in conjunction with PCU, "
-				"increase 'rts-advance' by 5. (current fn=%u)\n",
-				l1t->trx->nr, tn, l1sap->u.data.fn, fn);
+			     "is out of range, or channel %s with type %s is "
+			     "already disabled. If this happens in conjunction "
+			     "with PCU, increase 'rts-advance' by 5. "
+			     "(current fn=%u)\n", l1t->trx->nr, tn,
+			     l1sap->u.data.fn,
+			     get_lchan_by_chan_nr(l1t->trx, chan_nr)->name,
+			     get_value_string(trx_chan_type_names, chan), fn);
 			/* unlink and free message */
 			llist_del(&msg->list);
 			msgb_free(msg);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I80c581b54eeee371ee524a75a400d1e9ece16c68
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>


More information about the gerrit-log mailing list