Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/11715 )
Change subject: dbug log: verbosely detach conn<->lchan ...................................................................... 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 --- M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/lchan_fsm.c 2 files changed, 38 insertions(+), 3 deletions(-) Approvals: Jenkins Builder: Verified Harald Welte: Looks good to me, approved diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index bca9e1f..4d6521f 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -651,14 +651,36 @@ /* 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 diff --git a/src/osmo-bsc/lchan_fsm.c b/src/osmo-bsc/lchan_fsm.c index d95620f..726a5bb 100644 --- a/src/osmo-bsc/lchan_fsm.c +++ b/src/osmo-bsc/lchan_fsm.c @@ -1356,8 +1356,21 @@ /* The conn is deallocating, just forget all about it */ void lchan_forget_conn(struct gsm_lchan *lchan) { + struct gsm_subscriber_connection *conn; if (!lchan) return; + + conn = lchan->conn; + if (conn) { + /* Log for both lchan FSM and conn FSM to ease reading the log in case of problems */ + if (lchan->fi) + LOGPFSML(lchan->fi, LOGL_DEBUG, "lchan detaches from conn %s\n", + conn->fi? osmo_fsm_inst_name(conn->fi) : "(conn without FSM)"); + if (conn->fi) + LOGPFSML(conn->fi, LOGL_DEBUG, "lchan %s detaches from conn\n", + lchan->fi? osmo_fsm_inst_name(lchan->fi) : gsm_lchan_name(lchan)); + } + lchan_forget_mgw_endpoint(lchan); lchan->conn = NULL; } -- To view, visit https://gerrit.osmocom.org/11715 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I97558b899e7f2578ba98287e7352dc072d02ce44 Gerrit-Change-Number: 11715 Gerrit-PatchSet: 1 Gerrit-Owner: Neels Hofmeyr <nhofm...@sysmocom.de> Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org> Gerrit-Reviewer: Jenkins Builder (1000002)