aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2018-01-09 12:32:18 +0100
committerdexter <pmaier@sysmocom.de>2018-01-10 11:11:53 +0000
commitf9ca0204c468414c553262ad05ec789fa1e5451b (patch)
tree7cf28884a9a1c7e4dac652b99a37e9b4d7844a81
parent55a954bba14f1625d3bb0ca80bdb501998c06309 (diff)
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
-rw-r--r--src/osmo-bsc/osmo_bsc_mgcp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c
index 8ea6415da..6caf49658 100644
--- a/src/osmo-bsc/osmo_bsc_mgcp.c
+++ b/src/osmo-bsc/osmo_bsc_mgcp.c
@@ -122,7 +122,10 @@ enum bsc_mgcp_fsm_evt {
* 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 @@ static void handle_error(struct mgcp_ctx *mgcp_ctx, enum bsc_mgcp_cause_code cau
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);