Change in osmo-bts[master]: measurement: display fn_mod when measuremnet is added

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Thu Sep 6 12:33:57 UTC 2018


dexter has submitted this change and it was merged. ( https://gerrit.osmocom.org/10762 )

Change subject: measurement: display fn_mod when measuremnet is added
......................................................................

measurement: display fn_mod when measuremnet is added

When adding a new measurement also log the frame number by the modulus
of the measurement interval to simplify debuggung

Change-Id: I77a4d947dab32de0d5717ebf13bd8de6179dfe6a
---
M src/common/measurement.c
1 file changed, 32 insertions(+), 7 deletions(-)

Approvals:
  dexter: Verified
  Harald Welte: Looks good to me, approved



diff --git a/src/common/measurement.c b/src/common/measurement.c
index 59f5d83..1e547c8 100644
--- a/src/common/measurement.c
+++ b/src/common/measurement.c
@@ -415,21 +415,46 @@
 	return false;
 }
 
+/* determine the measurement interval modulus by a given lchan */
+static uint8_t modulus_by_lchan(struct gsm_lchan *lchan)
+{
+	enum gsm_phys_chan_config pchan = ts_pchan(lchan->ts);
+
+	switch (pchan) {
+	case GSM_PCHAN_TCH_F:
+	case GSM_PCHAN_TCH_H:
+		return 104;
+		break;
+	case GSM_PCHAN_SDCCH8_SACCH8C:
+	case GSM_PCHAN_SDCCH8_SACCH8C_CBCH:
+	case GSM_PCHAN_CCCH_SDCCH4:
+	case GSM_PCHAN_CCCH_SDCCH4_CBCH:
+		return 102;
+		break;
+	default:
+		/* Invalid */
+		return 1;
+		break;
+	}
+}
+
 /* receive a L1 uplink measurement from L1 (this function is only used
  * internally, it is public to call it from unit-tests)  */
 int lchan_new_ul_meas(struct gsm_lchan *lchan, struct bts_ul_meas *ulm, uint32_t fn)
 {
+	uint32_t fn_mod = fn % modulus_by_lchan(lchan);
+
 	if (lchan->state != LCHAN_S_ACTIVE) {
 		LOGPFN(DMEAS, LOGL_NOTICE, fn,
-		     "%s measurement during state: %s, num_ul_meas=%d\n",
-		     gsm_lchan_name(lchan), gsm_lchans_name(lchan->state),
-		     lchan->meas.num_ul_meas);
+		       "%s measurement during state: %s, num_ul_meas=%d, fn_mod=%u\n",
+		       gsm_lchan_name(lchan), gsm_lchans_name(lchan->state),
+		       lchan->meas.num_ul_meas, fn_mod);
 	}
 
 	if (lchan->meas.num_ul_meas >= ARRAY_SIZE(lchan->meas.uplink)) {
 		LOGPFN(DMEAS, LOGL_NOTICE, fn,
-		     "%s no space for uplink measurement, num_ul_meas=%d\n",
-		     gsm_lchan_name(lchan), lchan->meas.num_ul_meas);
+		       "%s no space for uplink measurement, num_ul_meas=%d, fn_mod=%u\n",
+		       gsm_lchan_name(lchan), lchan->meas.num_ul_meas, fn_mod);
 		return -ENOSPC;
 	}
 
@@ -438,8 +463,8 @@
 	if (!ulm->is_sub)
 		ulm->is_sub = ts45008_83_is_sub(lchan, fn, false);
 
-	DEBUGPFN(DMEAS, fn, "%s adding measurement (is_sub=%u), num_ul_meas=%d\n",
-		gsm_lchan_name(lchan), ulm->is_sub, lchan->meas.num_ul_meas);
+	DEBUGPFN(DMEAS, fn, "%s adding measurement (is_sub=%u), num_ul_meas=%d, fn_mod=%u\n",
+		 gsm_lchan_name(lchan), ulm->is_sub, lchan->meas.num_ul_meas, fn_mod);
 
 	memcpy(&lchan->meas.uplink[lchan->meas.num_ul_meas++], ulm,
 		sizeof(*ulm));

-- 
To view, visit https://gerrit.osmocom.org/10762
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I77a4d947dab32de0d5717ebf13bd8de6179dfe6a
Gerrit-Change-Number: 10762
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-CC: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180906/9082e3c9/attachment.htm>


More information about the gerrit-log mailing list