diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-24 00:58:38 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2013-11-26 20:57:24 +0100 |
commit | 12c039cdb23331156ffb867c6ed4f7fb1e912c7e (patch) | |
tree | 18b9fa8e46568e03c926f9d0c5fb45f0c60abaa2 /src/gprs_rlcmac.cpp | |
parent | a6ba67cb3a8696cbb251ba32c5b8daa877cd2b04 (diff) |
debug_diagram: Remove the special debug_diagram compilation mode
This approach is somehow flawed. We need/want to debug problems on
systems with real traffic and re-compiling it with debug_diagram
is not an option. All internal logging needs to be expressive enough
so we can understand what is going on (e.g. create a script to
post-process the output).
Diffstat (limited to 'src/gprs_rlcmac.cpp')
-rw-r--r-- | src/gprs_rlcmac.cpp | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/src/gprs_rlcmac.cpp b/src/gprs_rlcmac.cpp index 0037e6d6..ac8f2d12 100644 --- a/src/gprs_rlcmac.cpp +++ b/src/gprs_rlcmac.cpp @@ -29,90 +29,6 @@ extern void *tall_pcu_ctx; -#ifdef DEBUG_DIAGRAM -struct timeval diagram_time = {0,0}; -struct timeval diagram_last_tv = {0,0}; - -void debug_diagram(BTS *bts, int diag, const char *format, ...) -{ - va_list ap; - char debug[128]; - char line[1024]; - struct gprs_rlcmac_tbf *tbf, *tbf_a[16]; - int max_diag = -1, i; - uint64_t diff = 0; - - va_start(ap, format); - vsnprintf(debug, sizeof(debug) - 1, format, ap); - debug[19] = ' '; - debug[20] = '\0'; - va_end(ap); - - memset(tbf_a, 0, sizeof(tbf_a)); - llist_for_each_entry(tbf, &bts->bts_data()->ul_tbfs, list) { - if (tbf->diag < 16) { - if (tbf->diag > max_diag) - max_diag = tbf->diag; - tbf_a[tbf->diag] = tbf; - } - } - llist_for_each_entry(tbf, &bts->bts_data()->dl_tbfs, list) { - if (tbf->diag < 16) { - if (tbf->diag > max_diag) - max_diag = tbf->diag; - tbf_a[tbf->diag] = tbf; - } - } - - if (diagram_last_tv.tv_sec) { - diff = (uint64_t)(diagram_time.tv_sec - - diagram_last_tv.tv_sec) * 1000; - diff += diagram_time.tv_usec / 1000; - diff -= diagram_last_tv.tv_usec / 1000; - } - memcpy(&diagram_last_tv, &diagram_time, sizeof(struct timeval)); - - if (diff > 0) { - if (diff > 99999) - strcpy(line, " ... : "); - else - sprintf(line, "%3d.%03d: ", (int)(diff / 1000), - (int)(diff % 1000)); - for (i = 0; i <= max_diag; i++) { - if (tbf_a[i] == NULL) { - strcat(line, " "); - continue; - } - if (tbf_a[i]->diag_new) { - strcat(line, " | "); - continue; - } - strcat(line, " "); - } - puts(line); - } - strcpy(line, " : "); - for (i = 0; i <= max_diag; i++) { - if (tbf_a[i] == NULL) { - strcat(line, " "); - continue; - } - if (tbf_a[i]->diag != diag) { - strcat(line, " | "); - continue; - } - if (strlen(debug) < 19) { - strcat(line, " "); - memcpy(line + strlen(line) - 11 - strlen(debug) / 2, - debug, strlen(debug)); - } else - strcat(line, debug); - tbf_a[i]->diag_new = 1; - } - puts(line); -} -#endif - int gprs_rlcmac_paging_request(uint8_t *ptmsi, uint16_t ptmsi_len, const char *imsi) { |