[PATCH] osmo-pcu[master]: Initialize logging before initializing rate_ctr

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

Max gerrit-no-reply at lists.osmocom.org
Wed Oct 25 12:36:48 UTC 2017


Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/4411

to look at the new patch set (#2).

Initialize logging before initializing rate_ctr

The library code for rate counter initialization might already want to
log something (particularly after
Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 in libosmocore), so the
logging framework must be initialized before.

Before the rate counters were initialized implicitly in BTS
constructor which makes proper logging init impossible.

Fix this by using explicit init similar to the way we do it for vty.

Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692
---
M src/bts.cpp
M src/bts.h
M src/pcu_main.cpp
M src/pcu_vty.c
M src/pcu_vty.h
M tests/alloc/AllocTest.cpp
M tests/tbf/TbfTest.cpp
M tests/types/TypesTest.cpp
8 files changed, 129 insertions(+), 121 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/11/4411/2

diff --git a/src/bts.cpp b/src/bts.cpp
index b768569..0f7462a 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -50,107 +50,6 @@
 
 static BTS s_bts;
 
-/**
- * For gcc-4.4 compat do not use extended initializer list but keep the
- * order from the enum here. Once we support GCC4.7 and up we can change
- * the code below.
- */
-static const struct rate_ctr_desc bts_ctr_description[] = {
-	{ "tbf.dl.alloc",		"TBF DL Allocated     "},
-	{ "tbf.dl.freed",		"TBF DL Freed         "},
-	{ "tbf.dl.aborted",		"TBF DL Aborted       "},
-	{ "tbf.ul.alloc",		"TBF UL Allocated     "},
-	{ "tbf.ul.freed",		"TBF UL Freed         "},
-	{ "tbf.ul.aborted",		"TBF UL Aborted       "},
-	{ "tbf.reused",			"TBF Reused           "},
-	{ "tbf.alloc.algo-a",		"TBF Alloc Algo A     "},
-	{ "tbf.alloc.algo-b",		"TBF Alloc Algo B     "},
-	{ "tbf.failed.egprs-only",	"TBF Failed EGPRS-only"},
-	{ "rlc.sent",			"RLC Sent             "},
-	{ "rlc.resent",			"RLC Resent           "},
-	{ "rlc.restarted",		"RLC Restarted        "},
-	{ "rlc.stalled",		"RLC Stalled          "},
-	{ "rlc.nacked",			"RLC Nacked           "},
-	{ "rlc.final_block_resent",	"RLC Final Blk resent "},
-	{ "rlc.ass.timedout",		"RLC Assign Timeout   "},
-	{ "rlc.ass.failed",		"RLC Assign Failed    "},
-	{ "rlc.ack.timedout",		"RLC Ack Timeout      "},
-	{ "rlc.ack.failed",		"RLC Ack Failed       "},
-	{ "rlc.rel.timedout",		"RLC Release Timeout  "},
-	{ "rlc.late-block",		"RLC Late Block       "},
-	{ "rlc.sent-dummy",		"RLC Sent Dummy       "},
-	{ "rlc.sent-control",		"RLC Sent Control     "},
-	{ "rlc.dl_bytes",		"RLC DL Bytes         "},
-	{ "rlc.dl_payload_bytes",	"RLC DL Payload Bytes "},
-	{ "rlc.ul_bytes",		"RLC UL Bytes         "},
-	{ "rlc.ul_payload_bytes",	"RLC UL Payload Bytes "},
-	{ "decode.errors",		"Decode Errors        "},
-	{ "sba.allocated",		"SBA Allocated        "},
-	{ "sba.freed",			"SBA Freed            "},
-	{ "sba.timedout",		"SBA Timeout          "},
-	{ "llc.timeout",		"Timedout Frames      "},
-	{ "llc.dropped",		"Dropped Frames       "},
-	{ "llc.scheduled",		"Scheduled Frames     "},
-	{ "llc.dl_bytes",               "RLC encapsulated PDUs"},
-	{ "llc.ul_bytes",               "full PDUs received   "},
-	{ "rach.requests",		"RACH requests        "},
-	{ "11bit_rach.requests",	"11BIT_RACH requests  "},
-	{ "spb.uplink_first_segment",   "First seg of UL SPB  "},
-	{ "spb.uplink_second_segment",  "Second seg of UL SPB "},
-	{ "spb.downlink_first_segment", "First seg of DL SPB  "},
-	{ "spb.downlink_second_segment","Second seg of DL SPB "},
-	{ "immediate.assignment_UL",	"Immediate Assign UL  "},
-	{ "immediate.assignment_rej",   "Immediate Assign Rej "},
-	{ "immediate.assignment_DL",	"Immediate Assign DL  "},
-	{ "channel.request_description","Channel Request Desc "},
-	{ "pkt.ul_assignment",		"Packet UL Assignment "},
-	{ "pkt.access_reject",          "Packet Access Reject "},
-	{ "pkt.dl_assignment",		"Packet DL Assignment "},
-	{ "ul.control",			"UL control Block     "},
-	{ "ul.assignment_poll_timeout",	"UL Assign Timeout    "},
-	{ "ul.assignment_failed",	"UL Assign Failed     "},
-	{ "dl.assignment_timeout",	"DL Assign Timeout    "},
-	{ "dl.assignment_failed",	"DL Assign Failed     "},
-	{ "pkt.ul_ack_nack_timeout",	"PUAN Poll Timeout    "},
-	{ "pkt.ul_ack_nack_failed",	"PUAN poll Failed     "},
-	{ "pkt.dl_ack_nack_timeout",	"PDAN poll Timeout    "},
-	{ "pkt.dl_ack_nack_failed",	"PDAN poll Failed     "},
-	{ "gprs.downlink_cs1",		"CS1 downlink         "},
-	{ "gprs.downlink_cs2",		"CS2 downlink         "},
-	{ "gprs.downlink_cs3",		"CS3 downlink         "},
-	{ "gprs.downlink_cs4",		"CS4 downlink         "},
-	{ "egprs.downlink_mcs1",	"MCS1 downlink        "},
-	{ "egprs.downlink_mcs2",	"MCS2 downlink        "},
-	{ "egprs.downlink_mcs3",	"MCS3 downlink        "},
-	{ "egprs.downlink_mcs4",	"MCS4 downlink        "},
-	{ "egprs.downlink_mcs5",	"MCS5 downlink        "},
-	{ "egprs.downlink_mcs6",	"MCS6 downlink        "},
-	{ "egprs.downlink_mcs7",	"MCS7 downlink        "},
-	{ "egprs.downlink_mcs8",	"MCS8 downlink        "},
-	{ "egprs.downlink_mcs9",	"MCS9 downlink        "},
-	{ "gprs.uplink_cs1",		"CS1 Uplink           "},
-	{ "gprs.uplink_cs2",		"CS2 Uplink           "},
-	{ "gprs.uplink_cs3",		"CS3 Uplink           "},
-	{ "gprs.uplink_cs4",		"CS4 Uplink           "},
-	{ "egprs.uplink_mcs1",		"MCS1 Uplink          "},
-	{ "egprs.uplink_mcs2",		"MCS2 Uplink          "},
-	{ "egprs.uplink_mcs3",		"MCS3 Uplink          "},
-	{ "egprs.uplink_mcs4",		"MCS4 Uplink          "},
-	{ "egprs.uplink_mcs5",		"MCS5 Uplink          "},
-	{ "egprs.uplink_mcs6",		"MCS6 Uplink          "},
-	{ "egprs.uplink_mcs7",		"MCS7 Uplink          "},
-	{ "egprs.uplink_mcs8",		"MCS8 Uplink          "},
-	{ "egprs.uplink_mcs9",		"MCS9 Uplink          "},
-};
-
-static const struct rate_ctr_group_desc bts_ctrg_desc = {
-	"bts",
-	"BTS Statistics",
-	OSMO_STATS_CLASS_GLOBAL,
-	ARRAY_SIZE(bts_ctr_description),
-	bts_ctr_description,
-};
-
 static const struct osmo_stat_item_desc bts_stat_item_description[] = {
 	{ "ms.present",		"MS Present           ",
 		OSMO_STAT_ITEM_NO_UNIT, 4, 0},
@@ -179,11 +78,6 @@
 	return BTS::main_bts()->bts_data();
 }
 
-struct rate_ctr_group *bts_main_data_stats()
-{
-	return BTS::main_bts()->rate_counters();
-}
-
 BTS::BTS()
 	: m_cur_fn(0)
 	, m_cur_blk_fn(-1)
@@ -207,8 +101,6 @@
 		}
 	}
 
-	m_ratectrs = rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0);
-	OSMO_ASSERT(m_ratectrs);
 	m_statg = osmo_stat_item_group_alloc(tall_pcu_ctx, &bts_statg_desc, 0);
 	OSMO_ASSERT(m_statg);
 }
@@ -219,7 +111,8 @@
 	 * m_ms_store's destructor */
 	m_ms_store.cleanup();
 
-	rate_ctr_group_free(m_ratectrs);
+	if (m_bts.ctrs)
+		rate_ctr_group_free(m_bts.ctrs);
 	osmo_stat_item_group_free(m_statg);
 }
 
diff --git a/src/bts.h b/src/bts.h
index d65cd2f..c2177ae 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -217,7 +217,7 @@
 	bool si13_is_set;
 	/* 0 to support resegmentation in DL, 1 for no reseg */
 	uint8_t dl_arq_type;
-
+	struct rate_ctr_group *ctrs;
 	uint32_t ms_idle_sec;
 	uint8_t cs_adj_enabled;
 	uint8_t cs_adj_upper_limit;
@@ -482,7 +482,6 @@
 	/*
 	 * Below for C interface for the VTY
 	 */
-	struct rate_ctr_group *rate_counters() const;
 	struct osmo_stat_item_group *stat_items() const;
 
 	LListHead<gprs_rlcmac_tbf>& ul_tbfs();
@@ -493,7 +492,6 @@
 	struct gprs_rlcmac_bts m_bts;
 	PollController m_pollController;
 	SBAController m_sba;
-	struct rate_ctr_group *m_ratectrs;
 	struct osmo_stat_item_group *m_statg;
 
 	GprsMsStorage m_ms_store;
@@ -570,11 +568,6 @@
 	return m_assigned_tfi[dir];
 }
 
-inline struct rate_ctr_group *BTS::rate_counters() const
-{
-	return m_ratectrs;
-}
-
 inline struct osmo_stat_item_group *BTS::stat_items() const
 {
 	return m_statg;
@@ -582,12 +575,14 @@
 
 #define CREATE_COUNT_ADD_INLINE(func_name, ctr_name) \
 	inline void BTS::func_name(int inc) {\
-		rate_ctr_add(&m_ratectrs->ctr[ctr_name], inc); \
+		OSMO_ASSERT(m_bts.ctrs); \
+		rate_ctr_add(&m_bts.ctrs->ctr[ctr_name], inc); \
 	}
 
 #define CREATE_COUNT_INLINE(func_name, ctr_name) \
 	inline void BTS::func_name() {\
-		rate_ctr_inc(&m_ratectrs->ctr[ctr_name]); \
+		OSMO_ASSERT(m_bts.ctrs); \
+		rate_ctr_inc(&m_bts.ctrs->ctr[ctr_name]); \
 	}
 
 CREATE_COUNT_INLINE(tbf_dl_created, CTR_TBF_DL_ALLOCATED)
@@ -705,7 +700,6 @@
 extern "C" {
 #endif
 	struct gprs_rlcmac_bts *bts_main_data();
-	struct rate_ctr_group *bts_main_data_stats();
 	struct osmo_stat_item_group *bts_main_data_stat_items();
 #ifdef __cplusplus
 }
diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp
index b7574f9..afc1d96 100644
--- a/src/pcu_main.cpp
+++ b/src/pcu_main.cpp
@@ -251,6 +251,7 @@
 
 	vty_init(&pcu_vty_info);
 	pcu_vty_init(&gprs_log_info);
+	bts->ctrs = pcu_ctr_init();
 
 	handle_options(argc, argv);
 	if ((!!spoof_mcc) + (!!spoof_mnc) == 1) {
diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index 5ec16ea..d4926cd 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -9,6 +9,7 @@
 #include <osmocom/vty/misc.h>
 #include <osmocom/core/linuxlist.h>
 #include <osmocom/core/rate_ctr.h>
+#include <osmocom/core/stats.h>
 #include <osmocom/pcu/pcuif_proto.h>
 #include "pcu_vty.h"
 #include "gprs_rlcmac.h"
@@ -836,7 +837,9 @@
       "show bts statistics",
       SHOW_STR "BTS related functionality\nStatistics\n")
 {
-	vty_out_rate_ctr_group(vty, "", bts_main_data_stats());
+	struct gprs_rlcmac_bts *bts = bts_main_data();
+
+	vty_out_rate_ctr_group(vty, "", bts->ctrs);
 	return CMD_SUCCESS;
 }
 
@@ -1199,3 +1202,104 @@
 
 	return 0;
 }
+
+struct rate_ctr_group *pcu_ctr_init()
+{
+	const struct rate_ctr_desc bts_ctr_description[] = {
+		{ "tbf.dl.alloc",		"TBF DL Allocated     "},
+		{ "tbf.dl.freed",		"TBF DL Freed         "},
+		{ "tbf.dl.aborted",		"TBF DL Aborted       "},
+		{ "tbf.ul.alloc",		"TBF UL Allocated     "},
+		{ "tbf.ul.freed",		"TBF UL Freed         "},
+		{ "tbf.ul.aborted",		"TBF UL Aborted       "},
+		{ "tbf.reused",			"TBF Reused           "},
+		{ "tbf.alloc.algo-a",		"TBF Alloc Algo A     "},
+		{ "tbf.alloc.algo-b",		"TBF Alloc Algo B     "},
+		{ "tbf.failed.egprs-only",	"TBF Failed EGPRS-only"},
+		{ "rlc.sent",			"RLC Sent             "},
+		{ "rlc.resent",			"RLC Resent           "},
+		{ "rlc.restarted",		"RLC Restarted        "},
+		{ "rlc.stalled",		"RLC Stalled          "},
+		{ "rlc.nacked",			"RLC Nacked           "},
+		{ "rlc.final_block_resent",	"RLC Final Blk resent "},
+		{ "rlc.ass.timedout",		"RLC Assign Timeout   "},
+		{ "rlc.ass.failed",		"RLC Assign Failed    "},
+		{ "rlc.ack.timedout",		"RLC Ack Timeout      "},
+		{ "rlc.ack.failed",		"RLC Ack Failed       "},
+		{ "rlc.rel.timedout",		"RLC Release Timeout  "},
+		{ "rlc.late-block",		"RLC Late Block       "},
+		{ "rlc.sent-dummy",		"RLC Sent Dummy       "},
+		{ "rlc.sent-control",		"RLC Sent Control     "},
+		{ "rlc.dl_bytes",		"RLC DL Bytes         "},
+		{ "rlc.dl_payload_bytes",	"RLC DL Payload Bytes "},
+		{ "rlc.ul_bytes",		"RLC UL Bytes         "},
+		{ "rlc.ul_payload_bytes",	"RLC UL Payload Bytes "},
+		{ "decode.errors",		"Decode Errors        "},
+		{ "sba.allocated",		"SBA Allocated        "},
+		{ "sba.freed",			"SBA Freed            "},
+		{ "sba.timedout",		"SBA Timeout          "},
+		{ "llc.timeout",		"Timedout Frames      "},
+		{ "llc.dropped",		"Dropped Frames       "},
+		{ "llc.scheduled",		"Scheduled Frames     "},
+		{ "llc.dl_bytes",               "RLC encapsulated PDUs"},
+		{ "llc.ul_bytes",               "full PDUs received   "},
+		{ "rach.requests",		"RACH requests        "},
+		{ "11bit_rach.requests",	"11BIT_RACH requests  "},
+		{ "spb.uplink_first_segment",   "First seg of UL SPB  "},
+		{ "spb.uplink_second_segment",  "Second seg of UL SPB "},
+		{ "spb.downlink_first_segment", "First seg of DL SPB  "},
+		{ "spb.downlink_second_segment","Second seg of DL SPB "},
+		{ "immediate.assignment_UL",	"Immediate Assign UL  "},
+		{ "immediate.assignment_rej",   "Immediate Assign Rej "},
+		{ "immediate.assignment_DL",	"Immediate Assign DL  "},
+		{ "channel.request_description","Channel Request Desc "},
+		{ "pkt.ul_assignment",		"Packet UL Assignment "},
+		{ "pkt.access_reject",          "Packet Access Reject "},
+		{ "pkt.dl_assignment",		"Packet DL Assignment "},
+		{ "ul.control",			"UL control Block     "},
+		{ "ul.assignment_poll_timeout",	"UL Assign Timeout    "},
+		{ "ul.assignment_failed",	"UL Assign Failed     "},
+		{ "dl.assignment_timeout",	"DL Assign Timeout    "},
+		{ "dl.assignment_failed",	"DL Assign Failed     "},
+		{ "pkt.ul_ack_nack_timeout",	"PUAN Poll Timeout    "},
+		{ "pkt.ul_ack_nack_failed",	"PUAN poll Failed     "},
+		{ "pkt.dl_ack_nack_timeout",	"PDAN poll Timeout    "},
+		{ "pkt.dl_ack_nack_failed",	"PDAN poll Failed     "},
+		{ "gprs.downlink_cs1",		"CS1 downlink         "},
+		{ "gprs.downlink_cs2",		"CS2 downlink         "},
+		{ "gprs.downlink_cs3",		"CS3 downlink         "},
+		{ "gprs.downlink_cs4",		"CS4 downlink         "},
+		{ "egprs.downlink_mcs1",	"MCS1 downlink        "},
+		{ "egprs.downlink_mcs2",	"MCS2 downlink        "},
+		{ "egprs.downlink_mcs3",	"MCS3 downlink        "},
+		{ "egprs.downlink_mcs4",	"MCS4 downlink        "},
+		{ "egprs.downlink_mcs5",	"MCS5 downlink        "},
+		{ "egprs.downlink_mcs6",	"MCS6 downlink        "},
+		{ "egprs.downlink_mcs7",	"MCS7 downlink        "},
+		{ "egprs.downlink_mcs8",	"MCS8 downlink        "},
+		{ "egprs.downlink_mcs9",	"MCS9 downlink        "},
+		{ "gprs.uplink_cs1",		"CS1 Uplink           "},
+		{ "gprs.uplink_cs2",		"CS2 Uplink           "},
+		{ "gprs.uplink_cs3",		"CS3 Uplink           "},
+		{ "gprs.uplink_cs4",		"CS4 Uplink           "},
+		{ "egprs.uplink_mcs1",		"MCS1 Uplink          "},
+		{ "egprs.uplink_mcs2",		"MCS2 Uplink          "},
+		{ "egprs.uplink_mcs3",		"MCS3 Uplink          "},
+		{ "egprs.uplink_mcs4",		"MCS4 Uplink          "},
+		{ "egprs.uplink_mcs5",		"MCS5 Uplink          "},
+		{ "egprs.uplink_mcs6",		"MCS6 Uplink          "},
+		{ "egprs.uplink_mcs7",		"MCS7 Uplink          "},
+		{ "egprs.uplink_mcs8",		"MCS8 Uplink          "},
+		{ "egprs.uplink_mcs9",		"MCS9 Uplink          "},
+	};
+
+	const struct rate_ctr_group_desc bts_ctrg_desc = {
+		"bts",
+		"BTS Statistics",
+		OSMO_STATS_CLASS_GLOBAL,
+		ARRAY_SIZE(bts_ctr_description),
+		bts_ctr_description,
+	};
+
+	return rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0);
+}
diff --git a/src/pcu_vty.h b/src/pcu_vty.h
index a075350..0371597 100644
--- a/src/pcu_vty.h
+++ b/src/pcu_vty.h
@@ -13,6 +13,7 @@
 int pcu_vty_is_config_node(struct vty *vty, int node);
 
 int pcu_vty_init(const struct log_info *cat);
+struct rate_ctr_group *pcu_ctr_init();
 
 extern struct vty_app_info pcu_vty_info;
 
diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp
index a88f477..37d9718 100644
--- a/tests/alloc/AllocTest.cpp
+++ b/tests/alloc/AllocTest.cpp
@@ -30,6 +30,7 @@
 #include <osmocom/core/msgb.h>
 #include <osmocom/core/talloc.h>
 #include <osmocom/core/utils.h>
+#include <pcu_vty.h>
 }
 
 /* globals used by the code */
@@ -117,6 +118,7 @@
 	printf("Testing alloc_a direction(%d)\n", dir);
 
 	bts = the_bts.bts_data();
+	bts->ctrs = pcu_ctr_init();
 	bts->alloc_algorithm = alloc_algorithm_a;
 
 	struct gprs_rlcmac_trx *trx = &bts->trx[0];
@@ -195,6 +197,7 @@
 		printf("Testing UL then DL assignment.\n");
 
 		bts = the_bts.bts_data();
+		bts->ctrs = pcu_ctr_init();
 		bts->alloc_algorithm = alloc_algorithm_b;
 
 		trx = &bts->trx[0];
@@ -237,6 +240,7 @@
 		printf("Testing DL then UL assignment followed by update\n");
 
 		bts = the_bts.bts_data();
+		bts->ctrs = pcu_ctr_init();
 		bts->alloc_algorithm = alloc_algorithm_b;
 
 		trx = &bts->trx[0];
@@ -284,6 +288,7 @@
 		printf("Testing jolly example\n");
 
 		bts = the_bts.bts_data();
+		bts->ctrs = pcu_ctr_init();
 		bts->alloc_algorithm = alloc_algorithm_b;
 
 		trx = &bts->trx[0];
@@ -345,6 +350,7 @@
 		gprs_rlcmac_tbf *ul_tbf, *dl_tbf;
 
 		bts = the_bts.bts_data();
+		bts->ctrs = pcu_ctr_init();
 		bts->alloc_algorithm = alloc_algorithm_b;
 
 		trx = &bts->trx[0];
@@ -389,6 +395,7 @@
 		gprs_rlcmac_dl_tbf *dl_tbf;
 
 		bts = the_bts.bts_data();
+		bts->ctrs = pcu_ctr_init();
 		bts->alloc_algorithm = alloc_algorithm_b;
 
 		trx = &bts->trx[0];
@@ -482,6 +489,7 @@
 	uint8_t trx_no = -1;
 
 	bts = the_bts->bts_data();
+	bts->ctrs = pcu_ctr_init();
 
 	gprs_rlcmac_tbf *tbf = NULL;
 
@@ -663,6 +671,7 @@
 	printf("Going to test assignment with many TBF, %s\n", text);
 
 	bts = the_bts.bts_data();
+	bts->ctrs = pcu_ctr_init();
 	bts->alloc_algorithm = algo;
 
 	trx = &bts->trx[0];
@@ -701,6 +710,7 @@
 	printf("Going to test assignment with many connections, %s\n", text);
 
 	bts = the_bts.bts_data();
+	bts->ctrs = pcu_ctr_init();
 	bts->alloc_algorithm = algo;
 
 	trx = &bts->trx[0];
@@ -809,6 +819,7 @@
 	printf("Testing DL TS allocation for Multi UEs\n");
 
 	bts = the_bts.bts_data();
+	bts->ctrs = pcu_ctr_init();
 	bts->alloc_algorithm = alloc_algorithm_b;
 
 	trx = &bts->trx[0];
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index 0db7fde..5b626a8 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -74,6 +74,7 @@
 
 	printf("=== start %s ===\n", __func__);
 
+	the_bts.bts_data()->ctrs = pcu_ctr_init();
 	the_bts.bts_data()->alloc_algorithm = alloc_algorithm_a;
 	the_bts.bts_data()->trx[0].pdch[2].enable();
 	the_bts.bts_data()->trx[0].pdch[3].enable();
@@ -148,6 +149,7 @@
 	gprs_rlcmac_trx *trx;
 
 	bts = the_bts->bts_data();
+	bts->ctrs = pcu_ctr_init();
 	bts->alloc_algorithm = alloc_algorithm_a;
 	bts->initial_cs_dl = cs;
 	bts->initial_cs_ul = cs;
diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp
index 7d09108..e71993a 100644
--- a/tests/types/TypesTest.cpp
+++ b/tests/types/TypesTest.cpp
@@ -30,6 +30,7 @@
 #include <osmocom/core/msgb.h>
 #include <osmocom/core/talloc.h>
 #include <osmocom/core/utils.h>
+#include <pcu_vty.h>
 }
 
 #define OSMO_ASSERT_STR_EQ(a, b) \
@@ -351,6 +352,7 @@
 		int bsn_begin, bsn_end, num_blocks;
 		Ack_Nack_Description_t desc;
 
+		dummy_bts.bts_data()->ctrs = pcu_ctr_init();
 		dl_win.m_v_b.reset();
 
 		OSMO_ASSERT(dl_win.window_empty());

-- 
To view, visit https://gerrit.osmocom.org/4411
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ibf557d21552d9ff1d6b595b0594f2c7b18db4692
Gerrit-PatchSet: 2
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list