diff options
author | Max <msuraev@sysmocom.de> | 2017-01-05 18:26:58 +0100 |
---|---|---|
committer | Max <msuraev@sysmocom.de> | 2017-01-05 18:39:25 +0100 |
commit | e66de5b5ae47736404c95c5f191c88b56432da84 (patch) | |
tree | d9c848856fc625adb21e67395cd9d8d1eab777cc /src/tbf.cpp | |
parent | ee78bf0882d982ed69a98a0207dec1a1d00de32a (diff) |
Improve logging
Add value_string describing UL and DL TBF states and use it for logging
errors while freeing TBFs.
Change-Id: I292ec81ab602c65ef86e6e3e85740182b63474b6
Diffstat (limited to 'src/tbf.cpp')
-rw-r--r-- | src/tbf.cpp | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp index 0e4d6cc0..657255dc 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -43,6 +43,21 @@ extern void *tall_pcu_ctx; static void tbf_timer_cb(void *_tbf); +const struct value_string gprs_rlcmac_tbf_dl_ass_state_names[] = { + OSMO_VALUE_STRING(GPRS_RLCMAC_DL_ASS_NONE), + OSMO_VALUE_STRING(GPRS_RLCMAC_DL_ASS_SEND_ASS), + OSMO_VALUE_STRING(GPRS_RLCMAC_DL_ASS_WAIT_ACK), + { 0, NULL } +}; + +const struct value_string gprs_rlcmac_tbf_ul_ass_state_names[] = { + OSMO_VALUE_STRING(GPRS_RLCMAC_UL_ASS_NONE), + OSMO_VALUE_STRING(GPRS_RLCMAC_UL_ASS_SEND_ASS), + OSMO_VALUE_STRING(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ), + OSMO_VALUE_STRING(GPRS_RLCMAC_UL_ASS_WAIT_ACK), + { 0, NULL } +}; + static const struct rate_ctr_desc tbf_ctr_description[] = { { "rlc.nacked", "RLC Nacked " }, }; @@ -435,16 +450,20 @@ void tbf_free(struct gprs_rlcmac_tbf *tbf) LOGP(DRLCMAC, LOGL_INFO, "%s free\n", tbf_name(tbf)); if (tbf->ul_ass_state != GPRS_RLCMAC_UL_ASS_NONE) LOGP(DRLCMAC, LOGL_ERROR, "%s Software error: Pending uplink " - "assignment. This may not happen, because the " + "assignment in state %s. This may not happen, because the " "assignment message never gets transmitted. Please " "be sure not to free in this state. PLEASE FIX!\n", - tbf_name(tbf)); + tbf_name(tbf), + get_value_string(gprs_rlcmac_tbf_ul_ass_state_names, + tbf->ul_ass_state)); if (tbf->dl_ass_state != GPRS_RLCMAC_DL_ASS_NONE) LOGP(DRLCMAC, LOGL_ERROR, "%s Software error: Pending downlink " - "assignment. This may not happen, because the " + "assignment in state %s. This may not happen, because the " "assignment message never gets transmitted. Please " "be sure not to free in this state. PLEASE FIX!\n", - tbf_name(tbf)); + tbf_name(tbf), + get_value_string(gprs_rlcmac_tbf_dl_ass_state_names, + tbf->dl_ass_state)); tbf->stop_timer(); #warning "TODO: Could/Should generate bssgp_tx_llc_discarded" tbf_unlink_pdch(tbf); |