[MERGED] openbsc[master]: debug log for sms: fix/add

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

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Mon Sep 19 11:50:40 UTC 2016


Neels Hofmeyr has submitted this change and it was merged.

Change subject: debug log for sms: fix/add
......................................................................


debug log for sms: fix/add

One logged the wrong function name. Add others.

Change-Id: Ied5d8e84d5d192c826bc131be8907eaa55190479
---
M openbsc/src/libmsc/gsm_04_11.c
M openbsc/src/libmsc/sms_queue.c
M openbsc/src/libmsc/vty_interface_layer3.c
3 files changed, 14 insertions(+), 2 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c
index d1fdfb9..08d8fdf 100644
--- a/openbsc/src/libmsc/gsm_04_11.c
+++ b/openbsc/src/libmsc/gsm_04_11.c
@@ -888,7 +888,7 @@
 		return -EBUSY;
 	}
 
-	DEBUGP(DLSMS, "send_sms_lchan()\n");
+	DEBUGP(DLSMS, "%s()\n", __func__);
 
 	/* FIXME: allocate transaction with message reference */
 	trans = trans_alloc(conn->bts->network, conn->subscr,
@@ -996,10 +996,14 @@
 	 * if yes, send the SMS this way */
 	conn = connection_for_subscr(subscr);
 	if (conn) {
+		LOGP(DLSMS, LOGL_DEBUG, "Sending SMS via already open connection %p to %s\n",
+		     conn, subscr_name(subscr));
 		return gsm411_send_sms(conn, sms);
 	}
 
 	/* if not, we have to start paging */
+	LOGP(DLSMS, LOGL_DEBUG, "Sending SMS: no connection open, start paging %s\n",
+	     subscr_name(subscr));
 	res = subscr_request_channel(subscr, RSL_CHANNEED_SDCCH,
 					paging_cb_send_sms, sms);
 	if (!res) {
diff --git a/openbsc/src/libmsc/sms_queue.c b/openbsc/src/libmsc/sms_queue.c
index 5dbe81f..ebc53c2 100644
--- a/openbsc/src/libmsc/sms_queue.c
+++ b/openbsc/src/libmsc/sms_queue.c
@@ -225,10 +225,14 @@
 
 
 		sms = take_next_sms(smsq);
-		if (!sms)
+		if (!sms) {
+			LOGP(DLSMS, LOGL_DEBUG, "Sending SMS done (%d attempted)\n",
+			     attempted);
 			break;
+		}
 
 		rounds += 1;
+		LOGP(DLSMS, LOGL_DEBUG, "Sending SMS round %d\n", rounds);
 
 		/*
 		 * This code needs to detect a loop. It assumes that no SMS
@@ -243,6 +247,8 @@
 			first_sub = sms->receiver->id;
 			initialized = 1;
 		} else if (first_sub == sms->receiver->id) {
+			LOGP(DLSMS, LOGL_DEBUG, "Sending SMS done (loop) (%d attempted)\n",
+			     attempted);
 			sms_free(sms);
 			break;
 		}
@@ -324,6 +330,7 @@
  */
 int sms_queue_trigger(struct gsm_sms_queue *smsq)
 {
+	LOGP(DLSMS, LOGL_DEBUG, "Triggering SMS queue\n");
 	if (osmo_timer_pending(&smsq->push_queue))
 		return 0;
 
diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c
index fd3771a..6f0006c 100644
--- a/openbsc/src/libmsc/vty_interface_layer3.c
+++ b/openbsc/src/libmsc/vty_interface_layer3.c
@@ -176,6 +176,7 @@
 		sms_free(sms);
 		return CMD_WARNING;
 	}
+	LOGP(DLSMS, LOGL_DEBUG, "SMS stored in DB\n");
 
 	sms_free(sms);
 	sms_queue_trigger(receiver->group->net->sms_queue);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ied5d8e84d5d192c826bc131be8907eaa55190479
Gerrit-PatchSet: 3
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list