From b829eac9bc6c6dddcc0814d85ac560c6c48c36e1 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 12 Apr 2010 10:45:52 +0200 Subject: [statistics] Keep track of OML/RSL failures of the BTS. --- openbsc/include/openbsc/gsm_data.h | 4 ++++ openbsc/src/bsc_init.c | 5 +++++ openbsc/src/gsm_data.c | 2 ++ openbsc/src/vty_interface_cmds.c | 3 +++ 4 files changed, 14 insertions(+) diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index d7ddca715..50a172042 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -566,6 +566,10 @@ struct gsmnet_stats { struct counter *rf_fail; struct counter *rll_err; } chan; + struct { + struct counter *oml_fail; + struct counter *rsl_fail; + } bts; }; enum gsm_auth_policy { diff --git a/openbsc/src/bsc_init.c b/openbsc/src/bsc_init.c index 78b575302..dc1ab07da 100644 --- a/openbsc/src/bsc_init.c +++ b/openbsc/src/bsc_init.c @@ -920,6 +920,11 @@ void input_event(int event, enum e1inp_sign_type type, struct gsm_bts_trx *trx) case EVT_E1_TEI_DN: LOGP(DMI, LOGL_ERROR, "Lost some E1 TEI link: %d %p\n", type, trx); + if (type == E1INP_SIGN_OML) + counter_inc(trx->bts->network->stats.bts.oml_fail); + else if (type == E1INP_SIGN_RSL) + counter_inc(trx->bts->network->stats.bts.rsl_fail); + /* * free all allocated channels. change the nm_state so the * trx and trx_ts becomes unusable and chan_alloc.c can not diff --git a/openbsc/src/gsm_data.c b/openbsc/src/gsm_data.c index 55c45cdc9..e817a5dd7 100644 --- a/openbsc/src/gsm_data.c +++ b/openbsc/src/gsm_data.c @@ -283,6 +283,8 @@ struct gsm_network *gsm_network_init(u_int16_t country_code, u_int16_t network_c net->stats.call.connected = counter_alloc("net.call.connected"); net->stats.chan.rf_fail = counter_alloc("net.chan.rf_fail"); net->stats.chan.rll_err = counter_alloc("net.chan.rll_err"); + net->stats.bts.oml_fail = counter_alloc("net.bts.oml_fail"); + net->stats.bts.rsl_fail = counter_alloc("net.bts.rsl_fail"); net->mncc_recv = mncc_recv; diff --git a/openbsc/src/vty_interface_cmds.c b/openbsc/src/vty_interface_cmds.c index 8ade51851..671351e1c 100644 --- a/openbsc/src/vty_interface_cmds.c +++ b/openbsc/src/vty_interface_cmds.c @@ -240,6 +240,9 @@ void openbsc_vty_print_statistics(struct vty *vty, struct gsm_network *net) counter_get(net->stats.paging.attempted), counter_get(net->stats.paging.completed), counter_get(net->stats.paging.expired), VTY_NEWLINE); + vty_out(vty, "BTS failures : %lu OML, %lu RSL%s", + counter_get(net->stats.bts.oml_fail), + counter_get(net->stats.bts.rsl_fail), VTY_NEWLINE); } void openbsc_vty_add_cmds() -- cgit v1.2.3