[MERGED] osmo-bsc[master]: mgcp: log file and line of calls to handle_error()

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

dexter gerrit-no-reply at lists.osmocom.org
Wed Jan 10 11:11:57 UTC 2018


dexter has submitted this change and it was merged.

Change subject: mgcp: log file and line of calls to handle_error()
......................................................................


mgcp: log file and line of calls to handle_error()

When the FSM runs into an error condition handle_error() is called with
a cause code. The information about the error is then printed by handle_error(),
by this we do not get the sourcecode line of the location where the error
actually happend.

Convey the source code line number of the actual error in handle_error()

Change-Id: Ifa7f2a655474826630988572616cd26e1e2f3464
---
M src/osmo-bsc/osmo_bsc_mgcp.c
1 file changed, 6 insertions(+), 3 deletions(-)

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



diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c
index 8ea6415..6caf496 100644
--- a/src/osmo-bsc/osmo_bsc_mgcp.c
+++ b/src/osmo-bsc/osmo_bsc_mgcp.c
@@ -122,7 +122,10 @@
  * remove a half open connection (if possible). This function will execute
  * a controlled jump to the DLCX phase. From there, the FSM will then just
  * continue like the call were ended normally */
-static void handle_error(struct mgcp_ctx *mgcp_ctx, enum bsc_mgcp_cause_code cause)
+#define handle_error(mgcp_ctx, cause) \
+	_handle_error(mgcp_ctx, cause, __FILE__, __LINE__)
+static void _handle_error(struct mgcp_ctx *mgcp_ctx, enum bsc_mgcp_cause_code cause,
+			  const char *file, int line)
 {
 	struct osmo_fsm_inst *fi;
 
@@ -130,8 +133,8 @@
 	fi = mgcp_ctx->fsm;
 	OSMO_ASSERT(fi);
 
-	LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "%s -- graceful shutdown...\n",
-		 get_value_string(bsc_mgcp_cause_codes_names, cause));
+	LOGPFSMLSRC(mgcp_ctx->fsm, LOGL_ERROR, file, line, "%s -- graceful shutdown...\n",
+		    get_value_string(bsc_mgcp_cause_codes_names, cause));
 
 	/* Set the VM into the state where it waits for the call end */
 	osmo_fsm_inst_state_chg(fi, ST_CALL, 0, 0);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifa7f2a655474826630988572616cd26e1e2f3464
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>



More information about the gerrit-log mailing list