Change in osmo-trx[master]: Use new stat item/ctr getter APIs

pespin gerrit-no-reply at lists.osmocom.org
Fri Jun 4 15:22:00 UTC 2021


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


Change subject: Use new stat item/ctr getter APIs
......................................................................

Use new stat item/ctr getter APIs

Change-Id: I1fdfdae2810c3c82ff62fe725ffa364df4ebeff5
---
M CommonLibs/trx_rate_ctr.cpp
M TODO-RELEASE
2 files changed, 16 insertions(+), 15 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/47/24547/1

diff --git a/CommonLibs/trx_rate_ctr.cpp b/CommonLibs/trx_rate_ctr.cpp
index e902ff1..ba4fcc0 100644
--- a/CommonLibs/trx_rate_ctr.cpp
+++ b/CommonLibs/trx_rate_ctr.cpp
@@ -147,17 +147,17 @@
 		if (dev_ctrs_pending[chan].chan == PENDING_CHAN_NONE)
 			continue;
 		LOGCHAN(chan, DCTR, DEBUG) << "rate_ctr update";
-		ctr = &rate_ctrs[chan]->ctr[TRX_CTR_DEV_RX_OVERRUNS];
+		ctr = rate_ctr_group_get_ctr(rate_ctrs[chan], TRX_CTR_DEV_RX_OVERRUNS);
 		rate_ctr_add(ctr, dev_ctrs_pending[chan].rx_overruns - ctr->current);
-		ctr = &rate_ctrs[chan]->ctr[TRX_CTR_DEV_TX_UNDERRUNS];
+		ctr = rate_ctr_group_get_ctr(rate_ctrs[chan], TRX_CTR_DEV_TX_UNDERRUNS);
 		rate_ctr_add(ctr, dev_ctrs_pending[chan].tx_underruns - ctr->current);
-		ctr = &rate_ctrs[chan]->ctr[TRX_CTR_DEV_RX_DROP_EV];
+		ctr = rate_ctr_group_get_ctr(rate_ctrs[chan], TRX_CTR_DEV_RX_DROP_EV);
 		rate_ctr_add(ctr, dev_ctrs_pending[chan].rx_dropped_events - ctr->current);
-		ctr = &rate_ctrs[chan]->ctr[TRX_CTR_DEV_RX_DROP_SMPL];
+		ctr = rate_ctr_group_get_ctr(rate_ctrs[chan], TRX_CTR_DEV_RX_DROP_SMPL);
 		rate_ctr_add(ctr, dev_ctrs_pending[chan].rx_dropped_samples - ctr->current);
-		ctr = &rate_ctrs[chan]->ctr[TRX_CTR_DEV_TX_DROP_EV];
+		ctr = rate_ctr_group_get_ctr(rate_ctrs[chan], TRX_CTR_DEV_TX_DROP_EV);
 		rate_ctr_add(ctr, dev_ctrs_pending[chan].tx_dropped_events - ctr->current);
-		ctr = &rate_ctrs[chan]->ctr[TRX_CTR_DEV_TX_DROP_SMPL];
+		ctr = rate_ctr_group_get_ctr(rate_ctrs[chan], TRX_CTR_DEV_TX_DROP_SMPL);
 		rate_ctr_add(ctr, dev_ctrs_pending[chan].tx_dropped_samples - ctr->current);
 
 		/* Mark as done */
@@ -178,21 +178,21 @@
 		if (trx_ctrs_pending[chan].chan == PENDING_CHAN_NONE)
 			continue;
 		LOGCHAN(chan, DCTR, DEBUG) << "rate_ctr update";
-		ctr = &rate_ctrs[chan]->ctr[TRX_CTR_TRX_TX_STALE_BURSTS];
+		ctr = rate_ctr_group_get_ctr(rate_ctrs[chan], TRX_CTR_TRX_TX_STALE_BURSTS);
 		rate_ctr_add(ctr, trx_ctrs_pending[chan].tx_stale_bursts - ctr->current);
-		ctr = &rate_ctrs[chan]->ctr[TRX_CTR_TRX_TX_UNAVAILABLE_BURSTS];
+		ctr = rate_ctr_group_get_ctr(rate_ctrs[chan], TRX_CTR_TRX_TX_UNAVAILABLE_BURSTS);
 		rate_ctr_add(ctr, trx_ctrs_pending[chan].tx_unavailable_bursts - ctr->current);
-		ctr = &rate_ctrs[chan]->ctr[TRX_CTR_TRX_TRXD_FN_REPEATED];
+		ctr = rate_ctr_group_get_ctr(rate_ctrs[chan], TRX_CTR_TRX_TRXD_FN_REPEATED);
 		rate_ctr_add(ctr, trx_ctrs_pending[chan].tx_trxd_fn_repeated - ctr->current);
-		ctr = &rate_ctrs[chan]->ctr[TRX_CTR_TRX_TRXD_FN_OUTOFORDER];
+		ctr = rate_ctr_group_get_ctr(rate_ctrs[chan], TRX_CTR_TRX_TRXD_FN_OUTOFORDER);
 		rate_ctr_add(ctr, trx_ctrs_pending[chan].tx_trxd_fn_outoforder - ctr->current);
-		ctr = &rate_ctrs[chan]->ctr[TRX_CTR_TRX_TRXD_FN_SKIPPED];
+		ctr = rate_ctr_group_get_ctr(rate_ctrs[chan], TRX_CTR_TRX_TRXD_FN_SKIPPED);
 		rate_ctr_add(ctr, trx_ctrs_pending[chan].tx_trxd_fn_skipped - ctr->current);
-		ctr = &rate_ctrs[chan]->ctr[TRX_CTR_TRX_RX_EMPTY_BURST];
+		ctr = rate_ctr_group_get_ctr(rate_ctrs[chan], TRX_CTR_TRX_RX_EMPTY_BURST);
 		rate_ctr_add(ctr, trx_ctrs_pending[chan].rx_empty_burst - ctr->current);
-		ctr = &rate_ctrs[chan]->ctr[TRX_CTR_TRX_RX_CLIPPING];
+		ctr = rate_ctr_group_get_ctr(rate_ctrs[chan], TRX_CTR_TRX_RX_CLIPPING);
 		rate_ctr_add(ctr, trx_ctrs_pending[chan].rx_clipping - ctr->current);
-		ctr = &rate_ctrs[chan]->ctr[TRX_CTR_TRX_RX_NO_BURST_DETECTED];
+		ctr = rate_ctr_group_get_ctr(rate_ctrs[chan], TRX_CTR_TRX_RX_NO_BURST_DETECTED);
 		rate_ctr_add(ctr, trx_ctrs_pending[chan].rx_no_burst_detected - ctr->current);
 		/* Mark as done */
 		trx_ctrs_pending[chan].chan = PENDING_CHAN_NONE;
@@ -263,7 +263,7 @@
 
 	llist_for_each_entry(ctr_thr, &threshold_list, list) {
 		for (chan = 0; chan < chan_len; chan++) {
-			rate_ctr = &rate_ctrs[chan]->ctr[ctr_thr->ctr_id];
+			rate_ctr = rate_ctr_group_get_ctr(rate_ctrs[chan], ctr_thr->ctr_id);
 			LOGCHAN(chan, DCTR, INFO) << "checking threshold: " << ctr_threshold_2_vty_str(ctr_thr)
 						   << " ("<< rate_ctr->intv[ctr_thr->intv].rate << " vs " << ctr_thr->val << ")";
 			if (rate_ctr->intv[ctr_thr->intv].rate >= ctr_thr->val) {
diff --git a/TODO-RELEASE b/TODO-RELEASE
index e69de29..ab54c42 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -0,0 +1 @@
+libosmocore > 1.5.1  require APIs osmo_stat_item_group_get_item, rate_ctr_group_get_ctr

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

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I1fdfdae2810c3c82ff62fe725ffa364df4ebeff5
Gerrit-Change-Number: 24547
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/20210604/0a4041b1/attachment.htm>


More information about the gerrit-log mailing list