diff options
author | Max <msuraev@sysmocom.de> | 2017-11-30 12:36:11 +0100 |
---|---|---|
committer | Max <msuraev@sysmocom.de> | 2017-12-04 10:55:47 +0100 |
commit | 59f50c2718ba30479449ed31ed2202f7a797ca1d (patch) | |
tree | b3233c0a691c495e8fe13f9051b598e59d189123 /src/tbf.cpp | |
parent | 701afa4b3a5ae3e93b92bd9a4fa013fadbe69774 (diff) |
TBF: log timer override
Currently TBF support only single Txxxx timer so scheduling another
timer will cancel out the one which is already running. Until the proper
fix is in place, let's at least log this situation as error.
Note: cosmetic adjustement to test output is required - we do not report
restart of the same timer twice because "restarting" assumes it anyway.
Change-Id: I462464a1e6df937b72cad65d19cd48e95dc4db45
Related: OS#2407
Diffstat (limited to 'src/tbf.cpp')
-rw-r--r-- | src/tbf.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/tbf.cpp b/src/tbf.cpp index 8e541570..831cd971 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -531,13 +531,13 @@ const char *gprs_rlcmac_tbf::tbf_state_name[] = { void tbf_timer_start(struct gprs_rlcmac_tbf *tbf, unsigned int T, unsigned int seconds, unsigned int microseconds) { - if (!osmo_timer_pending(&tbf->timer)) - LOGP(DRLCMAC, LOGL_DEBUG, "%s starting timer %u.\n", - tbf_name(tbf), T); - else - LOGP(DRLCMAC, LOGL_DEBUG, "%s restarting timer %u " - "while old timer %u pending \n", - tbf_name(tbf), T, tbf->T); + LOGPC(DRLCMAC, (T != tbf->T) ? LOGL_ERROR : LOGL_DEBUG, "%s %sstarting timer %u.", + tbf_name(tbf), osmo_timer_pending(&tbf->timer) ? "re" : "", T); + + if (T != tbf->T && osmo_timer_pending(&tbf->timer)) + LOGPC(DRLCMAC, LOGL_ERROR, " while old timer %u pending", tbf->T); + + LOGPC(DRLCMAC, (T != tbf->T) ? LOGL_ERROR : LOGL_DEBUG, "\n"); tbf->T = T; tbf->num_T_exp = 0; |