Fix tests after rate_ctr change
Recent change lin libosmocore disallow registering rate_ctr with the same name and indexing multiple times. To accommodate to this check if rate counters arealready allocated (by static allocator of BTS singleton for example) and register rate counter with different index. This fixes the tests for now but eventually we'll remove the BTS singleton which will allow us to remove this hack. Change-Id: I7c552ce653b44ec3a31049641728926adc07361d Related: OS#2757
This commit is contained in:
parent
ef784e4e9e
commit
ea9968f685
10
src/bts.cpp
10
src/bts.cpp
|
@ -218,8 +218,16 @@ BTS::BTS()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ratectrs = rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0);
|
/* The static allocator might have already registered the counter group.
|
||||||
|
If this happens and we still called explicitly (in tests/* for example)
|
||||||
|
than just allocate the group with different index.
|
||||||
|
This shall be removed once weget rid of BTS singleton */
|
||||||
|
if (rate_ctr_get_group_by_name_idx(bts_ctrg_desc.group_name_prefix, 0))
|
||||||
|
m_ratectrs = rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 1);
|
||||||
|
else
|
||||||
|
m_ratectrs = rate_ctr_group_alloc(tall_pcu_ctx, &bts_ctrg_desc, 0);
|
||||||
OSMO_ASSERT(m_ratectrs);
|
OSMO_ASSERT(m_ratectrs);
|
||||||
|
|
||||||
m_statg = osmo_stat_item_group_alloc(tall_pcu_ctx, &bts_statg_desc, 0);
|
m_statg = osmo_stat_item_group_alloc(tall_pcu_ctx, &bts_statg_desc, 0);
|
||||||
OSMO_ASSERT(m_statg);
|
OSMO_ASSERT(m_statg);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue