[PATCH] osmo-bsc[master]: HO: logging: more logs, and more concise logging

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Feb 15 13:05:17 UTC 2018


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

HO: logging: more logs, and more concise logging

Explicitly log "Handover" or "Assignment", add more info to existing log
statements and add more log statements.

Log ho failure both on RR and HO log categories: RR receives the HO failure
message, while the HO failure is an important event to note when watching the
HO category.

Change-Id: Ia3999755cdd4e0c2861582b20e2dbb7e1538e074
---
M src/libbsc/bsc_api.c
M src/libbsc/handover_logic.c
2 files changed, 41 insertions(+), 15 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/67/6467/1

diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c
index 21836f3..d81bf0d 100644
--- a/src/libbsc/bsc_api.c
+++ b/src/libbsc/bsc_api.c
@@ -675,8 +675,8 @@
 	struct lchan_signal_data sig;
 	struct gsm48_hdr *gh = msgb_l3(msg);
 
-	DEBUGP(DRR, "HANDOVER FAILED cause = %s\n",
-		rr_cause_name(gh->data[0]));
+	DEBUGP(DRR, "HANDOVER FAILED cause = %s\n", rr_cause_name(gh->data[0]));
+	DEBUGP(DHO, "HANDOVER FAILED cause = %s\n", rr_cause_name(gh->data[0]));
 
 	sig.lchan = msg->lchan;
 	sig.mr = NULL;
diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c
index 9f5673f..e320cbc 100644
--- a/src/libbsc/handover_logic.c
+++ b/src/libbsc/handover_logic.c
@@ -40,6 +40,26 @@
 #include <osmocom/bsc/gsm_04_08_utils.h>
 #include <osmocom/bsc/handover.h>
 
+#define LOGPHOLCHANTOLCHAN(lchan, new_lchan, level, fmt, args...) \
+	LOGP(DHODEC, level, "(BTS %u trx %u arfcn %u ts %u lchan %u %s)->(BTS %u trx %u arfcn %u ts %u lchan %u %s) (subscr %s) " fmt, \
+	     lchan->ts->trx->bts->nr, \
+	     lchan->ts->trx->nr, \
+	     lchan->ts->trx->arfcn, \
+	     lchan->ts->nr, \
+	     lchan->nr, \
+	     gsm_pchan_name(lchan->ts->pchan), \
+	     new_lchan->ts->trx->bts->nr, \
+	     new_lchan->ts->trx->nr, \
+	     new_lchan->ts->trx->arfcn, \
+	     new_lchan->ts->nr, \
+	     new_lchan->nr, \
+	     gsm_pchan_name(new_lchan->ts->pchan), \
+	     bsc_subscr_name(lchan->conn->bsub), \
+	     ## args)
+
+#define LOGPHO(struct_bsc_handover, level, fmt, args ...) \
+	LOGPHOLCHANTOLCHAN(struct_bsc_handover->old_lchan, struct_bsc_handover->new_lchan, level, fmt, ## args)
+
 struct bsc_handover {
 	struct llist_head list;
 
@@ -111,10 +131,6 @@
 	if (bsc_ho_by_old_lchan(old_lchan))
 		return -EBUSY;
 
-	DEBUGP(DHO, "Beginning with handover operation"
-	       "(old_lchan on BTS %u, new BTS %u) ...\n",
-		old_lchan->ts->trx->bts->nr, new_bts->nr);
-	/* No new BTS? Then it shall be assignment within the same BTS. */
 	if (!new_bts)
 		new_bts = old_lchan->ts->trx->bts;
 	do_assignment = (new_bts == old_lchan->ts->trx->bts);
@@ -127,6 +143,15 @@
 		LOGP(DHO, LOGL_ERROR, "Old lchan lacks connection data.\n");
 		return -ENOSPC;
 	}
+
+	DEBUGP(DHO, "(BTS %u trx %u ts %u lchan %u %s)->(BTS %u lchan %s) Beginning with handover operation...\n",
+	       old_lchan->ts->trx->bts->nr,
+	       old_lchan->ts->trx->nr,
+	       old_lchan->ts->nr,
+	       old_lchan->nr,
+	       gsm_pchan_name(old_lchan->ts->pchan),
+	       new_bts->nr,
+	       gsm_lchant_name(new_lchan_type));
 
 	new_lchan = lchan_alloc(new_bts, new_lchan_type, 0);
 	if (!new_lchan) {
@@ -146,6 +171,8 @@
 	ho->ho_ref = ho_ref++;
 	ho->inter_cell = !do_assignment;
 	ho->async = true;
+
+	LOGPHO(ho, LOGL_INFO, "Triggering %s\n", do_assignment? "Assignment" : "Handover");
 
 	/* copy some parameters from old lchan */
 	memcpy(&new_lchan->encr, &old_lchan->encr, sizeof(new_lchan->encr));
@@ -173,7 +200,8 @@
 				       : RSL_ACT_INTRA_IMM_ASS,
 				     ho->ho_ref);
 	if (rc < 0) {
-		LOGP(DHO, LOGL_ERROR, "could not activate channel\n");
+		LOGPHO(ho, LOGL_INFO, "%s Failure: activate lchan rc = %d\n",
+		       do_assignment? "Assignment" : "Handover", rc);
 		new_lchan->conn->ho_lchan = NULL;
 		new_lchan->conn = NULL;
 		talloc_free(ho);
@@ -239,7 +267,7 @@
 	if (!ho)
 		return -ENODEV;
 
-	DEBUGP(DHO, "handover activate ack, send HO Command\n");
+	LOGPHO(ho, LOGL_INFO, "Channel Activate Ack, send %s COMMAND\n", ho->inter_cell? "HANDOVER" : "ASSIGNMENT");
 
 	/* we can now send the 04.08 HANDOVER COMMAND to the MS
 	 * using the old lchan */
@@ -291,10 +319,8 @@
 	}
 
 	net = new_lchan->ts->trx->bts->network;
-	LOGP(DHO, LOGL_INFO, "Subscriber %s HO from BTS %u->%u on ARFCN "
-	     "%u->%u\n", bsc_subscr_name(ho->old_lchan->conn->bsub),
-	     ho->old_lchan->ts->trx->bts->nr, new_lchan->ts->trx->bts->nr,
-	     ho->old_lchan->ts->trx->arfcn, new_lchan->ts->trx->arfcn);
+
+	LOGPHO(ho, LOGL_INFO, "%s Complete\n", ho->inter_cell ? "Handover" : "Assignment");
 
 	rate_ctr_inc(&net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_COMPLETED]);
 
@@ -302,10 +328,10 @@
 
 	/* Replace the ho lchan with the primary one */
 	if (ho->old_lchan != new_lchan->conn->lchan)
-		LOGP(DHO, LOGL_ERROR, "Primary lchan changed during handover.\n");
+		LOGPHO(ho, LOGL_ERROR, "Primary lchan changed during handover.\n");
 
 	if (new_lchan != new_lchan->conn->ho_lchan)
-		LOGP(DHO, LOGL_ERROR, "Handover channel changed during this handover.\n");
+		LOGPHO(ho, LOGL_ERROR, "Handover channel changed during this handover.\n");
 
 	new_lchan->conn->ho_lchan = NULL;
 	new_lchan->conn->lchan = new_lchan;
@@ -356,7 +382,7 @@
 		return -ENODEV;
 	}
 
-	LOGP(DHO, LOGL_DEBUG, "%s Handover RACH detected\n", gsm_lchan_name(new_lchan));
+	LOGPHO(ho, LOGL_DEBUG, "Handover RACH detected\n");
 
 	/* This is just for logging on the DHO category. The actual MGCP switchover happens in
 	 * osmo_bsc_mgcp.c by receiving the same S_LCHAN_HANDOVER_DETECT signal.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia3999755cdd4e0c2861582b20e2dbb7e1538e074
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>


More information about the gerrit-log mailing list