diff options
author | Philipp Maier <pmaier@sysmocom.de> | 2017-04-19 13:13:05 +0200 |
---|---|---|
committer | dexter <pmaier@sysmocom.de> | 2017-06-13 10:06:24 +0000 |
commit | 0e7886d37957dacec7831b8a8fc337beeb7b0907 (patch) | |
tree | 5aa071bd7adfe01b0f6f465890fe6cfedd724aea /src/common/measurement.c | |
parent | 3e2de526b0ec314ac0dbacb58d5004e7aea04dfb (diff) |
measurement: Improve log output
The debug log does not print much information about the measured
rxlev and rxqual values. This commit adds debug output to make
measurement debugging simpler
Change-Id: Ic871eed6dcbc7d10aca6cd11dbc803b3e6da449f
Diffstat (limited to 'src/common/measurement.c')
-rw-r--r-- | src/common/measurement.c | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/src/common/measurement.c b/src/common/measurement.c index bd2af7ed..6ddc05ab 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -88,14 +88,14 @@ static const uint8_t sdcch4_meas_rep_fn102[] = { /* determine if a measurement period ends at the given frame number */ -static int is_meas_complete(enum gsm_phys_chan_config pchan, unsigned int ts, - unsigned int subch, uint32_t fn) +static int is_meas_complete(struct gsm_lchan *lchan, uint32_t fn) { unsigned int fn_mod = -1; const uint8_t *tbl; int rc = 0; + enum gsm_phys_chan_config pchan = ts_pchan(lchan->ts); - if (ts >= 8) + if (lchan->ts->nr >= 8) return -EINVAL; if (pchan >= _GSM_PCHAN_MAX) return -EINVAL; @@ -103,34 +103,39 @@ static int is_meas_complete(enum gsm_phys_chan_config pchan, unsigned int ts, switch (pchan) { case GSM_PCHAN_TCH_F: fn_mod = fn % 104; - if (tchf_meas_rep_fn104[ts] == fn_mod) + if (tchf_meas_rep_fn104[lchan->ts->nr] == fn_mod) rc = 1; break; case GSM_PCHAN_TCH_H: fn_mod = fn % 104; - if (subch == 0) + if (lchan->nr == 0) tbl = tchh0_meas_rep_fn104; else tbl = tchh1_meas_rep_fn104; - if (tbl[ts] == fn_mod) + if (tbl[lchan->ts->nr] == fn_mod) rc = 1; break; case GSM_PCHAN_SDCCH8_SACCH8C: case GSM_PCHAN_SDCCH8_SACCH8C_CBCH: fn_mod = fn % 102; - if (sdcch8_meas_rep_fn102[subch] == fn_mod) + if (sdcch8_meas_rep_fn102[lchan->nr] == fn_mod) rc = 1; break; case GSM_PCHAN_CCCH_SDCCH4: case GSM_PCHAN_CCCH_SDCCH4_CBCH: fn_mod = fn % 102; - if (sdcch4_meas_rep_fn102[subch] == fn_mod) + if (sdcch4_meas_rep_fn102[lchan->nr] == fn_mod) rc = 1; break; default: rc = 0; break; } + + DEBUGP(DMEAS, + "%s meas period end fn:%u, fn_mod:%i, status:%d, pchan:%s\n", + gsm_lchan_name(lchan), fn, fn_mod, rc, gsm_pchan_name(pchan)); + return rc; } @@ -247,8 +252,7 @@ int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn) int i; /* if measurement period is not complete, abort */ - if (!is_meas_complete(ts_pchan(lchan->ts), lchan->ts->nr, - lchan->nr, fn)) + if (!is_meas_complete(lchan, fn)) return 0; /* if there are no measurements, skip computation */ @@ -301,6 +305,14 @@ int lchan_meas_check_compute(struct gsm_lchan *lchan, uint32_t fn) mru->full.rx_qual = ber10k_to_rxqual(ber_full_sum); mru->sub.rx_qual = ber10k_to_rxqual(ber_sub_sum); + DEBUGP(DMEAS, "%s UL MEAS RXLEV_FULL(%u), RXLEV_SUB(%u)," + "RXQUAL_FULL(%u), RXQUAL_SUB(%u), num_meas_sub(%u), num_ul_meas(%u) \n", + gsm_lchan_name(lchan), + mru->full.rx_lev, + mru->sub.rx_lev, + mru->full.rx_qual, + mru->sub.rx_qual, num_meas_sub, lchan->meas.num_ul_meas); + lchan->meas.flags |= LC_UL_M_F_RES_VALID; lchan->meas.num_ul_meas = 0; |