aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/bsc_subscr_conn_fsm.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-11-09 23:42:51 +0100
committerNeels Hofmeyr <neels@hofmeyr.de>2018-11-09 23:54:59 +0100
commit946d1fb5c7f4a593567b407222c9235f8fac7a59 (patch)
tree388d7e7fe3913c40cd970f87dd51705277e2c531 /src/osmo-bsc/bsc_subscr_conn_fsm.c
parent64b092e8551f942f06e831f989c8af4e03913428 (diff)
dbug log: verbosely detach conn<->lchan
When reading the log of OS#3686, I wished for explicit logging of when exactly an lchan disassociates from a conn. Here is the debug logging I would have liked to see. I'm not sure whether we really need to merge this patch... Change-Id: I97558b899e7f2578ba98287e7352dc072d02ce44
Diffstat (limited to 'src/osmo-bsc/bsc_subscr_conn_fsm.c')
-rw-r--r--src/osmo-bsc/bsc_subscr_conn_fsm.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c
index bca9e1f87..4d6521f83 100644
--- a/src/osmo-bsc/bsc_subscr_conn_fsm.c
+++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c
@@ -651,14 +651,36 @@ void gscon_lchan_releasing(struct gsm_subscriber_connection *conn, struct gsm_lc
/* An lchan was deallocated. */
void gscon_forget_lchan(struct gsm_subscriber_connection *conn, struct gsm_lchan *lchan)
{
+ const char *detach_label = NULL;
+ if (!conn)
+ return;
if (!lchan)
return;
- if (conn->assignment.new_lchan == lchan)
+
+ if (conn->assignment.new_lchan == lchan) {
conn->assignment.new_lchan = NULL;
- if (conn->ho.new_lchan == lchan)
+ detach_label = "assignment.new_lchan";
+ }
+ if (conn->ho.new_lchan == lchan) {
conn->ho.new_lchan = NULL;
- if (conn->lchan == lchan)
+ detach_label = "ho.new_lchan";
+ }
+ if (conn->lchan == lchan) {
conn->lchan = NULL;
+ detach_label = "primary lchan";
+ }
+
+ /* Log for both lchan FSM and conn FSM to ease reading the log in case of problems */
+ if (detach_label) {
+ if (conn->fi)
+ LOGPFSML(conn->fi, LOGL_DEBUG, "conn detaches lchan %s\n",
+ lchan->fi? osmo_fsm_inst_name(lchan->fi) : gsm_lchan_name(lchan));
+
+ if (lchan->fi)
+ LOGPFSML(lchan->fi, LOGL_DEBUG, "conn %s detaches lchan (%s)\n",
+ conn->fi? osmo_fsm_inst_name(conn->fi) : "(conn without FSM)",
+ detach_label);
+ }
if (conn->fi->state != ST_CLEARING
&& !conn->lchan