aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-04 16:52:23 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-06-08 09:40:28 +0200
commita17fccbcf47bff8f0cca7f3f02d55d63cf5b4d01 (patch)
tree72c91a99bd989baf6282abd38e7914cb0d0757a5
parent1751c62c980f8d6ed965e08fcb9ad1af485d8854 (diff)
tbf: Add debugging output to analyse_errors()
To help with the debugging, optimisation, and understanding of this method, this commit adds an info string containing a flag character per RLC/MAC data block in the current window. Note that the blocks are shown in reversed order (highest BSN first) in comparison to other logging output. Sponsored-by: On-Waves ehf
-rw-r--r--src/tbf_dl.cpp28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index 0726ef7..fa1b8ac 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -679,36 +679,52 @@ int gprs_rlcmac_dl_tbf::analyse_errors(char *show_rbb, uint8_t ssn)
{
gprs_rlc_data *rlc_data;
uint16_t lost = 0, received = 0, skipped = 0;
+ char info[65];
+ memset(info, '.', sizeof(info));
+ info[64] = 0;
+ uint16_t bsn = 0;
/* SSN - 1 is in range V(A)..V(S)-1 */
for (int bitpos = 0; bitpos < m_window.ws(); bitpos++) {
- uint16_t bsn = bitnum_to_bsn(bitpos, ssn, m_window.mod_sns());
+ bsn = bitnum_to_bsn(bitpos, ssn, m_window.mod_sns());
- if (bsn == ((m_window.v_a() - 1) & m_window.mod_sns()))
+ if (bsn == ((m_window.v_a() - 1) & m_window.mod_sns())) {
+ info[bitpos] = '$';
break;
+ }
rlc_data = m_rlc.block(bsn);
- if (!rlc_data)
+ if (!rlc_data) {
+ info[bitpos] = '0';
continue;
+ }
if (rlc_data->cs != current_cs()) {
/* This block has already been encoded with a different
* CS, so it doesn't help us to decide, whether the
* current CS is ok. Ignore it. */
+ info[bitpos] = 'x';
skipped += 1;
continue;
}
if (show_rbb[m_window.ws() - 1 - bitpos] == 'R') {
- if (!m_window.m_v_b.is_acked(bsn))
+ if (!m_window.m_v_b.is_acked(bsn)) {
received += 1;
+ info[bitpos] = 'R';
+ } else {
+ info[bitpos] = 'r';
+ }
} else {
+ info[bitpos] = 'L';
lost += 1;
}
}
- LOGP(DRLCMACDL, LOGL_DEBUG, "%s DL analysis, range=%d:%d, lost=%d, recv=%d, skipped=%d\n",
- name(), m_window.v_a(), m_window.v_s(), lost, received, skipped);
+ LOGP(DRLCMACDL, LOGL_DEBUG, "%s DL analysis, range=%d:%d, lost=%d, recv=%d, "
+ "skipped=%d, bsn=%d, info='%s'\n",
+ name(), m_window.v_a(), m_window.v_s(), lost, received,
+ skipped, bsn, info);
if (lost + received == 0)
return -1;