dexter has submitted this change and it was merged.

Change subject: measurement: Improve log output
......................................................................


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(+), 12 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/common/measurement.c b/src/common/measurement.c
index bd2af7e..6ddc05a 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -88,14 +88,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;
@@ -103,34 +103,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;
 }
 
@@ -247,8 +252,7 @@
        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 @@
        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 101d13f..eab9379 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:%u Tx MEAS RES valid(%d), flags(%02x)\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:%u, RXLEV_FULL:%u, RXLEV_SUB:%u, 
RXQUAL_FULL:%u, RXQUAL_SUB:%u, MS_PWR:%u, UL_TA:%u, 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: merged
Gerrit-Change-Id: Ic871eed6dcbc7d10aca6cd11dbc803b3e6da449f
Gerrit-PatchSet: 11
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter <pma...@sysmocom.de>
Gerrit-Reviewer: Harald Welte <lafo...@gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pma...@sysmocom.de>

Reply via email to