Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/2389 to look at the new patch set (#8). 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 --- M src/common/measurement.c M src/common/rsl.c 2 files changed, 36 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/89/2389/8 diff --git a/src/common/measurement.c b/src/common/measurement.c index aed5847..78f027c 100644 --- a/src/common/measurement.c +++ b/src/common/measurement.c @@ -93,14 +93,14 @@ /* 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; @@ -108,34 +108,39 @@ 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; } @@ -250,11 +255,9 @@ int32_t taqb_sum = 0; unsigned int num_meas_sub = 0; int i; - int32_t ms_timing_offset = 0; /* 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 */ @@ -307,6 +310,14 @@ 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; diff --git a/src/common/rsl.c b/src/common/rsl.c index a1b5953..7ee4da4 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -2245,8 +2245,9 @@ uint8_t chan_nr = gsm_lchan2chan_nr(lchan); int res_valid = lchan->meas.flags & LC_UL_M_F_RES_VALID; - LOGP(DRSL, LOGL_DEBUG, "%s Tx MEAS RES valid(%d)\n", - gsm_lchan_name(lchan), res_valid); + LOGP(DRSL, LOGL_DEBUG, + "%s chan_num:%d Tx MEAS RES valid(%d), flags(%d)\n", + gsm_lchan_name(lchan), chan_nr, res_valid, lchan->meas.flags); if (!res_valid) return -EINPROGRESS; @@ -2255,6 +2256,17 @@ if (!msg) return -ENOMEM; + LOGP(DRSL, LOGL_DEBUG, + "%s Send Meas RES: NUM:%d, RXLEV_FULL:%d, RXLEV_SUB:%d, RXQUAL_FULL:%d, RXQUAL_SUB:%d, MS_PWR:%d, UL_TA:%d, L3_LEN:%d, TimingOff:%u\n", + gsm_lchan_name(lchan), + lchan->meas.res_nr, + lchan->meas.ul_res.full.rx_lev, + lchan->meas.ul_res.sub.rx_lev, + lchan->meas.ul_res.full.rx_qual, + lchan->meas.ul_res.sub.rx_qual, + lchan->meas.l1_info[0], + lchan->meas.l1_info[1], l3_len, ms_to2rsl(lchan, le) - MEAS_MAX_TIMING_ADVANCE); + msgb_tv_put(msg, RSL_IE_MEAS_RES_NR, lchan->meas.res_nr++); size_t ie_len = gsm0858_rsl_ul_meas_enc(&lchan->meas.ul_res, lchan->tch.dtx.dl_active, -- To view, visit https://gerrit.osmocom.org/2389 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic871eed6dcbc7d10aca6cd11dbc803b3e6da449f Gerrit-PatchSet: 8 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter <pma...@sysmocom.de> Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org> Gerrit-Reviewer: Jenkins Builder