Change in osmo-remsim[master]: bankd_main: Improve log usefulness

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

laforge gerrit-no-reply at lists.osmocom.org
Wed Dec 8 19:45:16 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-remsim/+/26467 )

Change subject: bankd_main: Improve log usefulness
......................................................................

bankd_main: Improve log usefulness

Right now we get duplicate log lines like

[000 CONN_CLIENT_MAPPED_CARD] bankd_main.c:662 Rx RSPRO tpduModemToCard
[000 CONN_CLIENT_MAPPED_CARD] bankd_main.c:623 tpduModemToCard(0070000001)

Where the first line is printed by the generic receive handler for RSPRO
messages, while the second line is from the specific handler function
handling the specific message type.

Let's only print from the generic message handler if no specific
handler function exists.

Change-Id: I992c847e0081bd1cd8a0b70212618c4980d9db81
---
M src/bankd/bankd_main.c
1 file changed, 6 insertions(+), 5 deletions(-)

Approvals:
  Jenkins Builder: Verified
  dexter: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/bankd/bankd_main.c b/src/bankd/bankd_main.c
index ce34ac2..ecfa22d 100644
--- a/src/bankd/bankd_main.c
+++ b/src/bankd/bankd_main.c
@@ -645,7 +645,7 @@
 
 	OSMO_ASSERT(pdu->msg.present == RsproPDUchoice_PR_connectClientReq);
 
-	LOGW(worker, "connectClientReq(T=%lu, N='%s', SW='%s', VER='%s')\n",
+	LOGW(worker, "Rx RSPRO connectClientReq(T=%lu, N='%s', SW='%s', VER='%s')\n",
 		cid->type, cid->name.buf, cid->software.buf, cid->swVersion.buf);
 	/* FIXME: store somewhere? */
 
@@ -698,7 +698,8 @@
 	struct bank_slot bslot;
 	int rc;
 
-	LOGW(worker, "tpduModemToCard(%s)\n", osmo_hexdump_nospc(mdm2sim->data.buf, mdm2sim->data.size));
+	LOGW(worker, "Rx RSPRO tpduModemToCard(%s)\n",
+	     osmo_hexdump_nospc(mdm2sim->data.buf, mdm2sim->data.size));
 
 	if (worker->state != BW_ST_CONN_CLIENT_MAPPED_CARD) {
 		LOGW(worker, "Unexpected tpduModemToCaard\n");
@@ -738,7 +739,7 @@
 	const struct SlotPhysStatus *sps = &cssi->slotPhysStatus;
 	int rc = 0;
 
-	LOGW(worker, "clientSlotStatusInd(RST=%s, VCC=%s, CLK=%s)\n",
+	LOGW(worker, "Rx RSPRO clientSlotStatusInd(RST=%s, VCC=%s, CLK=%s)\n",
 		sps->resetActive ? "ACTIVE" : "INACTIVE",
 		sps->vccPresent ? *sps->vccPresent ? "PRESENT" : "ABSENT" : "NULL",
 		sps->clkActive ? *sps->clkActive ? "ACTIVE" : "INACTIVE" : "NULL");
@@ -757,8 +758,6 @@
 {
 	int rc = -100;
 
-	LOGW(worker, "Rx RSPRO %s\n", rspro_msgt_name(pdu));
-
 	switch (pdu->msg.present) {
 	case RsproPDUchoice_PR_connectClientReq:
 		rc = worker_handle_connectClientReq(worker, pdu);
@@ -771,9 +770,11 @@
 		rc = 0;
 		break;
 	case RsproPDUchoice_PR_setAtrRes:
+		LOGW(worker, "Rx RSPRO %s\n", rspro_msgt_name(pdu));
 		rc = 0;
 		break;
 	default:
+		LOGW(worker, "Rx RSPRO %s (unhandled)\n", rspro_msgt_name(pdu));
 		rc = -101;
 		break;
 	}

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/26467
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: I992c847e0081bd1cd8a0b70212618c4980d9db81
Gerrit-Change-Number: 26467
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211208/dbb4a879/attachment.htm>


More information about the gerrit-log mailing list