Change in osmo-bts[master]: scheduler: Add rate_ctr informing about too low rts-advance

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
Tue Jun 16 14:48:23 UTC 2020


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


Change subject: scheduler: Add rate_ctr informing about too low rts-advance
......................................................................

scheduler: Add rate_ctr informing about too low rts-advance

Change-Id: I76c3dd4020c6d74192b03b1d42413ae536da5f05
---
M include/osmo-bts/scheduler.h
M src/common/scheduler.c
2 files changed, 26 insertions(+), 0 deletions(-)



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

diff --git a/include/osmo-bts/scheduler.h b/include/osmo-bts/scheduler.h
index f5f346e..e65665f 100644
--- a/include/osmo-bts/scheduler.h
+++ b/include/osmo-bts/scheduler.h
@@ -2,6 +2,7 @@
 #define TRX_SCHEDULER_H
 
 #include <osmocom/core/utils.h>
+#include <osmocom/core/rate_ctr.h>
 
 #include <osmo-bts/gsm_data.h>
 
@@ -142,6 +143,8 @@
 
 	struct llist_head	dl_prims;	/* Queue primitives for TX */
 
+	struct rate_ctr_group	*ctrs;		/* rate counters */
+
 	/* Channel states for all logical channels */
 	struct l1sched_chan_state chan_state[_TRX_CHAN_MAX];
 };
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index c1bd19f..6d9e132 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -30,6 +30,8 @@
 #include <osmocom/core/talloc.h>
 #include <osmocom/core/bits.h>
 #include <osmocom/core/utils.h>
+#include <osmocom/core/rate_ctr.h>
+#include <osmocom/core/stats.h>
 
 #include <osmocom/gsm/protocol/gsm_08_58.h>
 #include <osmocom/gsm/a5.h>
@@ -562,6 +564,22 @@
 	},
 };
 
+enum {
+	L1SCHED_TS_CTR_DL_LATE,
+};
+
+
+static const struct rate_ctr_desc l1sched_ts_ctr_desc[] = {
+	[L1SCHED_TS_CTR_DL_LATE] =	{"l1sched_ts:dl_late", "Downlink frames prepared too late to submit to lower layers"},
+};
+static const struct rate_ctr_group_desc l1sched_ts_ctrg_desc = {
+	"l1sched_ts",
+	"L1 scheduler timeslot",
+	OSMO_STATS_CLASS_GLOBAL,
+	ARRAY_SIZE(l1sched_ts_ctr_desc),
+	l1sched_ts_ctr_desc
+};
+
 /*
  * init / exit
  */
@@ -582,7 +600,9 @@
 		struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn);
 
 		l1ts->mf_index = 0;
+		l1ts->ctrs = rate_ctr_group_alloc(trx, &l1sched_ts_ctrg_desc, (trx->nr + 1) * 100 + tn);
 		INIT_LLIST_HEAD(&l1ts->dl_prims);
+
 		for (i = 0; i < ARRAY_SIZE(l1ts->chan_state); i++) {
 			struct l1sched_chan_state *chan_state;
 			chan_state = &l1ts->chan_state[i];
@@ -604,6 +624,8 @@
 	for (tn = 0; tn < ARRAY_SIZE(l1t->ts); tn++) {
 		struct l1sched_ts *l1ts = l1sched_trx_get_ts(l1t, tn);
 		msgb_queue_flush(&l1ts->dl_prims);
+		rate_ctr_group_free(l1ts->ctrs);
+		l1ts->ctrs = NULL;
 		for (i = 0; i < _TRX_CHAN_MAX; i++) {
 			struct l1sched_chan_state *chan_state;
 			chan_state = &l1ts->chan_state[i];
@@ -670,6 +692,7 @@
 			     prim_fn, l1sap_fn, fn,
 			     get_lchan_by_chan_nr(l1t->trx, chan_nr)->name,
 			     trx_chan_desc[chan].name);
+			     rate_ctr_inc2(l1ts->ctrs, L1SCHED_TS_CTR_DL_LATE);
 			/* unlink and free message */
 			llist_del(&msg->list);
 			msgb_free(msg);

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I76c3dd4020c6d74192b03b1d42413ae536da5f05
Gerrit-Change-Number: 18862
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/20200616/f73ed375/attachment.htm>


More information about the gerrit-log mailing list