Change in osmo-bts[master]: Introduce LOGPTRX macro and use it in tx_power.c

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/.

pespin gerrit-no-reply at lists.osmocom.org
Thu Jun 18 17:13:51 UTC 2020


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/18909 )


Change subject: Introduce LOGPTRX macro and use it in tx_power.c
......................................................................

Introduce LOGPTRX macro and use it in tx_power.c

Rename OCTPHY specific LOPGTRX macro to avoid redefine conflicts.

Change-Id: I02878611501aca51039e2ac7e35784ccb93b1db6
---
M include/osmo-bts/gsm_data.h
M src/common/tx_power.c
M src/osmo-bts-octphy/l1_oml.c
M tests/tx_power/tx_power_test.err
4 files changed, 56 insertions(+), 55 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/09/18909/1

diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h
index 80cc0be..9032aeb 100644
--- a/include/osmo-bts/gsm_data.h
+++ b/include/osmo-bts/gsm_data.h
@@ -44,6 +44,7 @@
 #define GSM_BTS_AGCH_QUEUE_HIGH_LEVEL_DEFAULT 91
 
 #define LOGPLCHAN(lchan, ss, lvl, fmt, args...) LOGP(ss, lvl, "%s " fmt, gsm_lchan_name(lchan), ## args)
+#define LOGPTRX(trx, ss, lvl, fmt, args...) LOGP(ss, lvl, "%s " fmt, gsm_trx_name(trx), ## args)
 
 struct gsm_network {
 	struct llist_head bts_list;
diff --git a/src/common/tx_power.c b/src/common/tx_power.c
index db3121d..705038c 100644
--- a/src/common/tx_power.c
+++ b/src/common/tx_power.c
@@ -171,13 +171,13 @@
 	/* compute new effective (= minus ramp and thermal attenuation) TRX output required */
 	p_trxout_eff_mdBm = get_p_trxout_eff_mdBm(trx, tpp->p_total_tgt_mdBm);
 
-	LOGP(DL1C, LOGL_DEBUG, "ramp_timer_cb(cur_pout=%d, tgt_pout=%d, "
+	LOGPTRX(trx, DL1C, LOGL_DEBUG, "ramp_timer_cb(cur_pout=%d, tgt_pout=%d, "
 		"ramp_att=%d, therm_att=%d, user_gain=%d)\n",
 		tpp->p_total_cur_mdBm, tpp->p_total_tgt_mdBm,
 		tpp->ramp.attenuation_mdB, tpp->thermal_attenuation_mdB,
 		tpp->user_gain_mdB);
 
-	LOGP(DL1C, LOGL_INFO,
+	LOGPTRX(trx, DL1C, LOGL_INFO,
 		"ramping TRX board output power to %d mdBm.\n", p_trxout_eff_mdBm);
 
 	/* Instruct L1 to apply new effective TRX output power required */
@@ -196,9 +196,9 @@
 	/* for now we simply write an error message, but in the future
 	 * we might use the value (again) as part of our math? */
 	if (p_trxout_cur_mdBm != p_trxout_should_mdBm) {
-		LOGP(DL1C, LOGL_ERROR, "bts_model notifies us of %u mdBm TRX "
-		     "output power.  However, it should be %u mdBm!\n",
-		     p_trxout_cur_mdBm, p_trxout_should_mdBm);
+		LOGPTRX(trx, DL1C, LOGL_ERROR, "bts_model notifies us of %u mdBm TRX "
+			"output power.  However, it should be %u mdBm!\n",
+			p_trxout_cur_mdBm, p_trxout_should_mdBm);
 	}
 
 	/* and do another step... */
@@ -244,13 +244,13 @@
 	 * the maximum total system power subtracted by OML as well as RSL
 	 * reductions */
 
-	LOGP(DL1C, LOGL_INFO, "power_ramp_start(cur=%d, tgt=%d)\n",
+	LOGPTRX(trx, DL1C, LOGL_INFO, "power_ramp_start(cur=%d, tgt=%d)\n",
 		tpp->p_total_cur_mdBm, p_total_tgt_mdBm);
 
 	if (!bypass && (p_total_tgt_mdBm > get_p_nominal_mdBm(trx))) {
-		LOGP(DL1C, LOGL_ERROR, "Asked to ramp power up to "
-		     "%d mdBm, which exceeds P_max_out (%d)\n",
-		     p_total_tgt_mdBm, get_p_nominal_mdBm(trx));
+		LOGPTRX(trx, DL1C, LOGL_ERROR, "Asked to ramp power up to "
+			"%d mdBm, which exceeds P_max_out (%d)\n",
+			p_total_tgt_mdBm, get_p_nominal_mdBm(trx));
 		return -ERANGE;
 	}
 
@@ -262,7 +262,7 @@
 
 	if (we_are_ramping_up(trx)) {
 		if (tpp->p_total_tgt_mdBm <= tpp->ramp.max_initial_pout_mdBm) {
-			LOGP(DL1C, LOGL_INFO,
+			LOGPTRX(trx, DL1C, LOGL_INFO,
 				"target_power(%d) is below max.initial power\n",
 				tpp->p_total_tgt_mdBm);
 			/* new setting is below the maximum initial output
diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c
index 9c5dd19..0f36662 100644
--- a/src/osmo-bts-octphy/l1_oml.c
+++ b/src/osmo-bts-octphy/l1_oml.c
@@ -54,7 +54,7 @@
 
 bool no_fw_check = 0;
 
-#define LOGPTRX(byTrxId, level, fmt, args...) \
+#define LOGPOCTTRX(byTrxId, level, fmt, args...) \
 	LOGP(DL1C, level, "(byTrxId %u) " fmt, byTrxId, ## args)
 
 /* Map OSMOCOM logical channel type to OctPHY Logical channel type */
@@ -381,7 +381,7 @@
 	mOCTVC1_GSM_MSG_TRX_ACTIVATE_LOGICAL_CHANNEL_RSP_SWAP(ar);
 	trx = trx_by_l1h(fl1, ar->TrxId.byTrxId);
 	if (!trx) {
-		LOGPTRX(ar->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during lchan activation\n");
+		LOGPOCTTRX(ar->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during lchan activation\n");
 		return -EINVAL;
 	}
 
@@ -496,7 +496,7 @@
 
 	trx = trx_by_l1h(fl1, pcr->TrxId.byTrxId);
 	if (!trx) {
-		LOGPTRX(pcr->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during cipher mode activation\n");
+		LOGPOCTTRX(pcr->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during cipher mode activation\n");
 		return -EINVAL;
 	}
 
@@ -700,7 +700,7 @@
 	mOCTVC1_GSM_MSG_TRX_DEACTIVATE_LOGICAL_CHANNEL_RSP_SWAP(ldr);
 	trx = trx_by_l1h(fl1, ldr->TrxId.byTrxId);
 	if (!trx) {
-		LOGPTRX(ldr->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during lchan deactivation\n");
+		LOGPOCTTRX(ldr->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during lchan deactivation\n");
 		return -EINVAL;
 	}
 
@@ -1283,7 +1283,7 @@
 	mOCTVC1_GSM_MSG_TRX_OPEN_RSP_SWAP(or);
 	trx = trx_by_l1h(fl1h, or->TrxId.byTrxId);
 	if (!trx) {
-		LOGPTRX(or->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during TRX opening procedure -- abort\n");
+		LOGPOCTTRX(or->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during TRX opening procedure -- abort\n");
 		exit(1);
 	}
 
@@ -1470,7 +1470,7 @@
 	mOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_RSP_SWAP(ar);
 	trx = trx_by_l1h(fl1, ar->TrxId.byTrxId);
 	if (!trx) {
-		LOGPTRX(ar->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during physical channel activation -- abort\n");
+		LOGPOCTTRX(ar->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during physical channel activation -- abort\n");
 		exit(1);
 	}
 
@@ -1553,7 +1553,7 @@
 
 	trx = trx_by_l1h(fl1, ar->TrxId.byTrxId);
 	if (!trx) {
-		LOGPTRX(ar->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during ts disconnection\n");
+		LOGPOCTTRX(ar->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id during ts disconnection\n");
 		return -EINVAL;
 	}
 
@@ -1581,7 +1581,7 @@
 	mOCTVC1_GSM_MSG_TRX_ACTIVATE_PHYSICAL_CHANNEL_RSP_SWAP(ar);
 	trx = trx_by_l1h(fl1, ar->TrxId.byTrxId);
 	if (!trx) {
-		LOGPTRX(ar->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id while connecting ts\n");
+		LOGPOCTTRX(ar->TrxId.byTrxId, LOGL_ERROR, "response with unexpected physical transceiver-id while connecting ts\n");
 		return -EINVAL;
 	}
 
diff --git a/tests/tx_power/tx_power_test.err b/tests/tx_power/tx_power_test.err
index bf33b42..03130b2 100644
--- a/tests/tx_power/tx_power_test.err
+++ b/tests/tx_power/tx_power_test.err
@@ -1,38 +1,38 @@
-power_ramp_start(cur=0, tgt=40000)
-Asked to ramp power up to 40000 mdBm, which exceeds P_max_out (33000)
-power_ramp_start(cur=0, tgt=33000)
-ramp_timer_cb(cur_pout=2000, tgt_pout=33000, ramp_att=31000, therm_att=0, user_gain=0)
-ramping TRX board output power to -8000 mdBm.
-ramp_timer_cb(cur_pout=4000, tgt_pout=33000, ramp_att=29000, therm_att=0, user_gain=0)
-ramping TRX board output power to -6000 mdBm.
-ramp_timer_cb(cur_pout=6000, tgt_pout=33000, ramp_att=27000, therm_att=0, user_gain=0)
-ramping TRX board output power to -4000 mdBm.
-ramp_timer_cb(cur_pout=8000, tgt_pout=33000, ramp_att=25000, therm_att=0, user_gain=0)
-ramping TRX board output power to -2000 mdBm.
-ramp_timer_cb(cur_pout=10000, tgt_pout=33000, ramp_att=23000, therm_att=0, user_gain=0)
-ramping TRX board output power to 0 mdBm.
-ramp_timer_cb(cur_pout=12000, tgt_pout=33000, ramp_att=21000, therm_att=0, user_gain=0)
-ramping TRX board output power to 2000 mdBm.
-ramp_timer_cb(cur_pout=14000, tgt_pout=33000, ramp_att=19000, therm_att=0, user_gain=0)
-ramping TRX board output power to 4000 mdBm.
-ramp_timer_cb(cur_pout=16000, tgt_pout=33000, ramp_att=17000, therm_att=0, user_gain=0)
-ramping TRX board output power to 6000 mdBm.
-ramp_timer_cb(cur_pout=18000, tgt_pout=33000, ramp_att=15000, therm_att=0, user_gain=0)
-ramping TRX board output power to 8000 mdBm.
-ramp_timer_cb(cur_pout=20000, tgt_pout=33000, ramp_att=13000, therm_att=0, user_gain=0)
-ramping TRX board output power to 10000 mdBm.
-ramp_timer_cb(cur_pout=22000, tgt_pout=33000, ramp_att=11000, therm_att=0, user_gain=0)
-ramping TRX board output power to 12000 mdBm.
-ramp_timer_cb(cur_pout=24000, tgt_pout=33000, ramp_att=9000, therm_att=0, user_gain=0)
-ramping TRX board output power to 14000 mdBm.
-ramp_timer_cb(cur_pout=26000, tgt_pout=33000, ramp_att=7000, therm_att=0, user_gain=0)
-ramping TRX board output power to 16000 mdBm.
-ramp_timer_cb(cur_pout=28000, tgt_pout=33000, ramp_att=5000, therm_att=0, user_gain=0)
-ramping TRX board output power to 18000 mdBm.
-ramp_timer_cb(cur_pout=30000, tgt_pout=33000, ramp_att=3000, therm_att=0, user_gain=0)
-ramping TRX board output power to 20000 mdBm.
-ramp_timer_cb(cur_pout=32000, tgt_pout=33000, ramp_att=1000, therm_att=0, user_gain=0)
-ramping TRX board output power to 22000 mdBm.
-ramp_timer_cb(cur_pout=33000, tgt_pout=33000, ramp_att=0, therm_att=0, user_gain=0)
-ramping TRX board output power to 23000 mdBm.
+(bts=0,trx=1) power_ramp_start(cur=0, tgt=40000)
+(bts=0,trx=1) Asked to ramp power up to 40000 mdBm, which exceeds P_max_out (33000)
+(bts=0,trx=1) power_ramp_start(cur=0, tgt=33000)
+(bts=0,trx=1) ramp_timer_cb(cur_pout=2000, tgt_pout=33000, ramp_att=31000, therm_att=0, user_gain=0)
+(bts=0,trx=1) ramping TRX board output power to -8000 mdBm.
+(bts=0,trx=1) ramp_timer_cb(cur_pout=4000, tgt_pout=33000, ramp_att=29000, therm_att=0, user_gain=0)
+(bts=0,trx=1) ramping TRX board output power to -6000 mdBm.
+(bts=0,trx=1) ramp_timer_cb(cur_pout=6000, tgt_pout=33000, ramp_att=27000, therm_att=0, user_gain=0)
+(bts=0,trx=1) ramping TRX board output power to -4000 mdBm.
+(bts=0,trx=1) ramp_timer_cb(cur_pout=8000, tgt_pout=33000, ramp_att=25000, therm_att=0, user_gain=0)
+(bts=0,trx=1) ramping TRX board output power to -2000 mdBm.
+(bts=0,trx=1) ramp_timer_cb(cur_pout=10000, tgt_pout=33000, ramp_att=23000, therm_att=0, user_gain=0)
+(bts=0,trx=1) ramping TRX board output power to 0 mdBm.
+(bts=0,trx=1) ramp_timer_cb(cur_pout=12000, tgt_pout=33000, ramp_att=21000, therm_att=0, user_gain=0)
+(bts=0,trx=1) ramping TRX board output power to 2000 mdBm.
+(bts=0,trx=1) ramp_timer_cb(cur_pout=14000, tgt_pout=33000, ramp_att=19000, therm_att=0, user_gain=0)
+(bts=0,trx=1) ramping TRX board output power to 4000 mdBm.
+(bts=0,trx=1) ramp_timer_cb(cur_pout=16000, tgt_pout=33000, ramp_att=17000, therm_att=0, user_gain=0)
+(bts=0,trx=1) ramping TRX board output power to 6000 mdBm.
+(bts=0,trx=1) ramp_timer_cb(cur_pout=18000, tgt_pout=33000, ramp_att=15000, therm_att=0, user_gain=0)
+(bts=0,trx=1) ramping TRX board output power to 8000 mdBm.
+(bts=0,trx=1) ramp_timer_cb(cur_pout=20000, tgt_pout=33000, ramp_att=13000, therm_att=0, user_gain=0)
+(bts=0,trx=1) ramping TRX board output power to 10000 mdBm.
+(bts=0,trx=1) ramp_timer_cb(cur_pout=22000, tgt_pout=33000, ramp_att=11000, therm_att=0, user_gain=0)
+(bts=0,trx=1) ramping TRX board output power to 12000 mdBm.
+(bts=0,trx=1) ramp_timer_cb(cur_pout=24000, tgt_pout=33000, ramp_att=9000, therm_att=0, user_gain=0)
+(bts=0,trx=1) ramping TRX board output power to 14000 mdBm.
+(bts=0,trx=1) ramp_timer_cb(cur_pout=26000, tgt_pout=33000, ramp_att=7000, therm_att=0, user_gain=0)
+(bts=0,trx=1) ramping TRX board output power to 16000 mdBm.
+(bts=0,trx=1) ramp_timer_cb(cur_pout=28000, tgt_pout=33000, ramp_att=5000, therm_att=0, user_gain=0)
+(bts=0,trx=1) ramping TRX board output power to 18000 mdBm.
+(bts=0,trx=1) ramp_timer_cb(cur_pout=30000, tgt_pout=33000, ramp_att=3000, therm_att=0, user_gain=0)
+(bts=0,trx=1) ramping TRX board output power to 20000 mdBm.
+(bts=0,trx=1) ramp_timer_cb(cur_pout=32000, tgt_pout=33000, ramp_att=1000, therm_att=0, user_gain=0)
+(bts=0,trx=1) ramping TRX board output power to 22000 mdBm.
+(bts=0,trx=1) ramp_timer_cb(cur_pout=33000, tgt_pout=33000, ramp_att=0, therm_att=0, user_gain=0)
+(bts=0,trx=1) ramping TRX board output power to 23000 mdBm.
 
\ No newline at end of file

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/18909
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I02878611501aca51039e2ac7e35784ccb93b1db6
Gerrit-Change-Number: 18909
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200618/7b7e339a/attachment.htm>


More information about the gerrit-log mailing list