aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bsc/paging.c
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2021-11-25 12:14:09 +0100
committerOliver Smith <osmith@sysmocom.de>2021-11-29 11:33:34 +0100
commit2df65db3dab8545bd31dcbbed88fc156630ee246 (patch)
tree80e113f54616d8656a04fbb154ae4e47dcc0a9bb /src/osmo-bsc/paging.c
parent61e041d92a1fadf544f055cc2960d05290f8cd4d (diff)
stats: add bsc.paging:expired
Similar to paging:attempted, count paging:expired not only per BTS, but also for the whole BSC. Add active_paging_requests to struct bsc_subscr, to increase the counter only once if paging expires, and not once per BTS where paging expired. Related: SYS#4878 Change-Id: I9c118e7e3d61ed8c9f1951111255b196905eba4d
Diffstat (limited to 'src/osmo-bsc/paging.c')
-rw-r--r--src/osmo-bsc/paging.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c
index 04512be92..721ea31f2 100644
--- a/src/osmo-bsc/paging.c
+++ b/src/osmo-bsc/paging.c
@@ -66,6 +66,7 @@ void *tall_paging_ctx = NULL;
static void paging_remove_request(struct gsm_bts_paging_state *paging_bts,
struct gsm_paging_request *to_be_deleted)
{
+ to_be_deleted->bsub->active_paging_requests--;
osmo_timer_del(&to_be_deleted->T3113);
llist_del(&to_be_deleted->entry);
bsc_subscr_put(to_be_deleted->bsub, BSUB_USE_PAGING_REQUEST);
@@ -284,6 +285,11 @@ static void paging_T3113_expired(void *data)
/* must be destroyed before calling cbfn, to prevent double free */
rate_ctr_inc(rate_ctr_group_get_ctr(req->bts->bts_ctrs, BTS_CTR_PAGING_EXPIRED));
+ /* If last BTS paging times out (active_paging_requests will be
+ * decremented in paging_remove_request below): */
+ if (req->bsub->active_paging_requests == 1)
+ rate_ctr_inc(rate_ctr_group_get_ctr(bsc_gsmnet->bsc_ctrs, BSC_CTR_PAGING_EXPIRED));
+
/* destroy it now. Do not access req afterwards */
paging_remove_request(&req->bts->paging, req);
@@ -341,6 +347,7 @@ static int _paging_request(const struct bsc_paging_params *params, struct gsm_bt
}
LOG_PAGING_BTS(params, bts, DPAG, LOGL_DEBUG, "Start paging\n");
+ params->bsub->active_paging_requests++;
req = talloc_zero(tall_paging_ctx, struct gsm_paging_request);
OSMO_ASSERT(req);
req->reason = params->reason;