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/.
daniel gerrit-no-reply at lists.osmocom.orgdaniel has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/19735 ) Change subject: Add bts counters to count BTS events where we don't have a bts ...................................................................... Add bts counters to count BTS events where we don't have a bts In some (error-) cases we might be unable to determine which BTS to use when counting handover events. We don't want to loose these events because then ctr(bsc) == sum(ctr(bsc->bts)) would not be true anymore. Those events are now counted by a counter in struct gsm_network which uses an index that is out of range for regular BTS (65536). Change-Id: Ic0f3edd5dc014c4eac5e8423133633a3e5d4c13e Related: SYS#4877 --- M include/osmocom/bsc/gsm_data.h M src/osmo-bsc/bsc_init.c M src/osmo-bsc/bsc_subscr_conn_fsm.c M src/osmo-bsc/handover_fsm.c 4 files changed, 45 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/35/19735/1 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 60db07b..33b2ec1 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -1089,6 +1089,11 @@ BSC_STAT_NUM_BTS_TOTAL, }; +/* BTS counter index if a BTS could not be found + * Currently we are limited to bts 0 - 255 in the VTY, but that might change in + * the future so use 2**16 */ +#define BTS_STAT_IDX_UNKNOWN (UINT16_MAX + 1) + struct gsm_tz { int override; /* if 0, use system's time zone instead. */ int hr; /* hour */ @@ -1123,6 +1128,11 @@ struct llist_head bts_list; struct llist_head bts_rejected; + /* BTS-based counters when we can't find the actual BTS + * e.g. when conn->lchan is NULL */ + struct rate_ctr_group *bts_unknown_ctrs; + struct osmo_stat_item_group *bts_unknown_statg; + /* see gsm_network_T_defs */ struct osmo_tdef *T_defs; diff --git a/src/osmo-bsc/bsc_init.c b/src/osmo-bsc/bsc_init.c index e45b5e8..22eba50 100644 --- a/src/osmo-bsc/bsc_init.c +++ b/src/osmo-bsc/bsc_init.c @@ -90,8 +90,7 @@ net->cbc = talloc_zero(net, struct bsc_cbc_link); if (!net->cbc) { - talloc_free(net); - return NULL; + goto err_out; } /* Init back pointer */ @@ -104,16 +103,19 @@ /* init statistics */ net->bsc_ctrs = rate_ctr_group_alloc(net, &bsc_ctrg_desc, 0); - if (!net->bsc_ctrs) { - talloc_free(net); - return NULL; - } + if (!net->bsc_ctrs) + goto err_out; net->bsc_statg = osmo_stat_item_group_alloc(net, &bsc_statg_desc, 0); - if (!net->bsc_statg) { - rate_ctr_group_free(net->bsc_ctrs); - talloc_free(net); - return NULL; - } + if (!net->bsc_statg) + goto err_free_bsc_ctr; + + /* init statistics */ + net->bts_unknown_ctrs = rate_ctr_group_alloc(net, &bts_ctrg_desc, BTS_STAT_IDX_UNKNOWN); + if (!net->bts_unknown_ctrs) + goto err_free_bsc_ctr_stat; + net->bts_unknown_statg = osmo_stat_item_group_alloc(net, &bts_statg_desc, BTS_STAT_IDX_UNKNOWN); + if (!net->bts_unknown_statg) + goto err_free_all; INIT_LLIST_HEAD(&net->bts_rejected); gsm_net_update_ctype(net); @@ -134,6 +136,16 @@ net->cbc->config.listen_hostname = talloc_strdup(net->cbc, "127.0.0.1"); return net; + +err_free_all: + rate_ctr_group_free(net->bts_unknown_ctrs); +err_free_bsc_ctr_stat: + osmo_stat_item_group_free(net->bsc_statg); +err_free_bsc_ctr: + rate_ctr_group_free(net->bsc_ctrs); +err_out: + talloc_free(net); + return NULL; } int bsc_network_alloc(void) diff --git a/src/osmo-bsc/bsc_subscr_conn_fsm.c b/src/osmo-bsc/bsc_subscr_conn_fsm.c index 04718da..22aa70a 100644 --- a/src/osmo-bsc/bsc_subscr_conn_fsm.c +++ b/src/osmo-bsc/bsc_subscr_conn_fsm.c @@ -386,6 +386,8 @@ rate_ctr_inc(&conn->network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED]); if (bts) rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_HANDOVER_ATTEMPTED]); + else + rate_ctr_inc(&conn->network->bts_unknown_ctrs->ctr[BTS_CTR_HANDOVER_ATTEMPTED]); /* Rely on handover_fsm timeout */ if (osmo_fsm_inst_state_chg(fi, ST_HANDOVER, 0, 0)) diff --git a/src/osmo-bsc/handover_fsm.c b/src/osmo-bsc/handover_fsm.c index edf91e7..3e1ee9a 100644 --- a/src/osmo-bsc/handover_fsm.c +++ b/src/osmo-bsc/handover_fsm.c @@ -96,6 +96,8 @@ bts_ctr_description[counter].description); \ if (bts) \ rate_ctr_inc(&bts->bts_ctrs->ctr[counter]); \ + else \ + rate_ctr_inc(&conn->network->bts_unknown_ctrs->ctr[counter]); \ } while(0) #define ho_count(bts, counter) do { \ @@ -701,7 +703,6 @@ } \ } -FUNC_RESULT_COUNTER(BSC, ASSIGNMENT) FUNC_RESULT_COUNTER(BSC, HANDOVER) FUNC_RESULT_COUNTER(BSC, INTRA_CELL_HO) FUNC_RESULT_COUNTER(BSC, INTRA_BSC_HO) @@ -724,13 +725,14 @@ static int result_counter_bsc(enum handover_scope scope, enum handover_result result) { switch (scope) { - case HO_INTRA_CELL: - return result_counter_BSC_INTRA_CELL_HO(result); default: LOGP(DHO, LOGL_ERROR, "invalid enum handover_scope value: %s\n", handover_scope_name(scope)); - /* use "normal" HO_INTRA_BSC counter... */ + /* use "normal" HO counter... */ case HO_NO_HANDOVER: + return result_counter_BSC_HANDOVER(result); + case HO_INTRA_CELL: + return result_counter_BSC_INTRA_CELL_HO(result); case HO_INTRA_BSC: return result_counter_BSC_INTRA_BSC_HO(result); case HO_INTER_BSC_OUT: @@ -740,7 +742,6 @@ } } -FUNC_RESULT_COUNTER(BTS, ASSIGNMENT) FUNC_RESULT_COUNTER(BTS, HANDOVER) FUNC_RESULT_COUNTER(BTS, INTRA_CELL_HO) FUNC_RESULT_COUNTER(BTS, INTRA_BSC_HO) @@ -763,13 +764,14 @@ static int result_counter_bts(enum handover_scope scope, enum handover_result result) { switch (scope) { - case HO_INTRA_CELL: - return result_counter_BTS_INTRA_CELL_HO(result); default: LOGP(DHO, LOGL_ERROR, "invalid enum handover_scope value: %s\n", handover_scope_name(scope)); - /* use "normal" HO_INTRA_BSC counter... */ + /* use "normal" HO counter... */ case HO_NO_HANDOVER: + return result_counter_BTS_HANDOVER(result); + case HO_INTRA_CELL: + return result_counter_BTS_INTRA_CELL_HO(result); case HO_INTRA_BSC: return result_counter_BTS_INTRA_BSC_HO(result); case HO_INTER_BSC_OUT: -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/19735 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ic0f3edd5dc014c4eac5e8423133633a3e5d4c13e Gerrit-Change-Number: 19735 Gerrit-PatchSet: 1 Gerrit-Owner: daniel <dwillmann at sysmocom.de> Gerrit-MessageType: newchange -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200820/3f887c02/attachment.htm>