aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/dtx_check.gawk
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-10-19 19:07:12 +0200
committerMax <msuraev@sysmocom.de>2016-10-26 17:33:55 +0200
commit64a2bd72f591a27105d94c4f860886e17e16d44a (patch)
treea45c1b0140921af507c00c4d49d527a688220c82 /contrib/dtx_check.gawk
parentced9a5d0e2c7e3371760f1c07df7b41cfe7ab71d (diff)
Add tools to check DTX operation
* superfemto.sh can parse superfemto-compatible DSP log output to properly sort records into MT/MO and DL/UL parts * dtx_check.gawk can process output of superfemto.sh and check for common scheduling errors This allows to check lc15 and sysmo for errors in DTX DL scheduling. As dtx_check.gawk is generic it can be used with any other BTS hw (or virtual BTS) as long as raw logs from this hw can be converted to simple input format 'FN EVENT' per-line. Change-Id: Ib1c70c4543b24c2a05a7df8eec5ce3f4eda2c02e Related: OS#1801
Diffstat (limited to 'contrib/dtx_check.gawk')
-rwxr-xr-xcontrib/dtx_check.gawk77
1 files changed, 77 insertions, 0 deletions
diff --git a/contrib/dtx_check.gawk b/contrib/dtx_check.gawk
new file mode 100755
index 00000000..9e753e46
--- /dev/null
+++ b/contrib/dtx_check.gawk
@@ -0,0 +1,77 @@
+#!/usr/bin/gawk -f
+
+# Expected input format: FN TYPE
+
+BEGIN {
+ DELTA = 0
+ ERR = 0
+ FORCE = 0
+ FN = 0
+ SILENCE = 0
+ TYPE = ""
+ CHK = ""
+ U_MAX = 8 * 20 + 120 / 26
+ U_MIN = 8 * 20 - 120 / 26
+ F_MAX = 3 * 20 + 120 / 26
+ F_MIN = 3 * 20 - 120 / 26
+}
+
+{
+ if (NR > 2) { # we have data from previous record to compare to
+ DELTA = ($1 - FN) * 120 / 26
+ CHK = "OK"
+ if ("FACCH" == $2 && "ONSET" == TYPE) { # ONSET due to FACCH is NOT a talkspurt
+ SILENCE = 1
+ }
+ if (("UPDATE" == TYPE || "FIRST" == TYPE) && ("FACCH" == $2 || "SPEECH" == $2)) { # check for missing ONSET:
+ CHK = "FAIL: missing ONSET (" $2 ") after " TYPE "."
+ ERR++
+ }
+ if ("FORCED_FIRST" == $2 || "FORCED_NODATA" == $2) {
+ CHK = "FAIL: event " $2 " inserted by DSP."
+ FORCE++
+ ERR++
+ }
+ if ("OK" == CHK) { # check inter-SID distances:
+ if ("UPDATE" == TYPE) {
+ if (DELTA > U_MAX) {
+ CHK = "FAIL: delta (" $1 - FN "fn) from previous SID UPDATE (@" FN ") too big " DELTA "ms > " U_MAX "ms."
+ ERR++
+ }
+ if ("UPDATE" == $2 && DELTA < U_MIN) {
+ CHK = "FAIL: delta (" $1 - FN "fn) from previous SID UPDATE (@" FN ") too small " DELTA "ms < " U_MIN "ms."
+ ERR++
+ }
+ }
+ if ("FIRST" == TYPE) {
+ if (DELTA > F_MAX) {
+ CHK = "FAIL: delta (" $1 - FN "fn) from previous SID FIRST (@" FN ") too big " DELTA "ms > " F_MAX "ms."
+ ERR++
+ }
+ if ("UPDATE" == $2 && DELTA < F_MIN) {
+ CHK = "FAIL: delta (" $1 - FN "fn) from previous SID UPDATE (@" FN ") too small " DELTA "ms < " F_MIN "ms."
+ ERR++
+ }
+ }
+ }
+ if ("FACCH" == TYPE && "FIRST" != $2 && 1 == SILENCE) { # check FACCH handling
+ CHK = "FAIL: incorrect silence resume after FACCH."
+ ERR++
+ }
+ }
+ if ("SPEECH" == $2 || "ONSET" == $2) { # talkspurt
+ SILENCE = 0
+ }
+ if ("UPDATE" == $2 || "FIRST" == $2) { # silence
+ SILENCE = 1
+ }
+ print $1, $2, CHK, TYPE, DELTA, SILENCE
+ if ($2 != "EMPTY") { # skip over EMPTY records
+ TYPE = $2
+ FN = $1
+ }
+}
+
+END {
+ print "Check completed: found " ERR " errors (" FORCE " events inserted by DSP) in " NR " records."
+}