<p>osmith <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/26384">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  pespin: Looks good to me, but someone else must approve
  fixeria: Looks good to me, but someone else must approve
  osmith: Looks good to me, approved
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">stats: add bsc.paging:expired<br><br>Similar to paging:attempted, count paging:expired not only per BTS, but<br>also for the whole BSC. Add active_paging_requests to struct bsc_subscr,<br>to increase the counter only once if paging expires, and not once per<br>BTS where paging expired.<br><br>Related: SYS#4878<br>Change-Id: I9c118e7e3d61ed8c9f1951111255b196905eba4d<br>---<br>M include/osmocom/bsc/bsc_stats.h<br>M include/osmocom/bsc/bsc_subscriber.h<br>M src/osmo-bsc/bsc_stats.c<br>M src/osmo-bsc/paging.c<br>4 files changed, 11 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/bsc/bsc_stats.h b/include/osmocom/bsc/bsc_stats.h</span><br><span>index 9140f85..801a2c1 100644</span><br><span>--- a/include/osmocom/bsc/bsc_stats.h</span><br><span>+++ b/include/osmocom/bsc/bsc_stats.h</span><br><span>@@ -76,6 +76,7 @@</span><br><span>        BSC_CTR_PAGING_ATTEMPTED,</span><br><span>    BSC_CTR_PAGING_DETACHED,</span><br><span>     BSC_CTR_PAGING_RESPONDED,</span><br><span style="color: hsl(120, 100%, 40%);">+     BSC_CTR_PAGING_EXPIRED,</span><br><span>      BSC_CTR_PAGING_NO_ACTIVE_PAGING,</span><br><span>     BSC_CTR_UNKNOWN_UNIT_ID,</span><br><span>     BSC_CTR_MSCPOOL_SUBSCR_NO_MSC,</span><br><span>diff --git a/include/osmocom/bsc/bsc_subscriber.h b/include/osmocom/bsc/bsc_subscriber.h</span><br><span>index 6fffafd..f9e8eb2 100644</span><br><span>--- a/include/osmocom/bsc/bsc_subscriber.h</span><br><span>+++ b/include/osmocom/bsc/bsc_subscriber.h</span><br><span>@@ -17,6 +17,8 @@</span><br><span> </span><br><span>  char imsi[GSM23003_IMSI_MAX_DIGITS+1];</span><br><span>       uint32_t tmsi;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+      uint32_t active_paging_requests;</span><br><span> };</span><br><span> </span><br><span> const char *bsc_subscr_name(struct bsc_subscr *bsub);</span><br><span>diff --git a/src/osmo-bsc/bsc_stats.c b/src/osmo-bsc/bsc_stats.c</span><br><span>index c789aea..b48c90a 100644</span><br><span>--- a/src/osmo-bsc/bsc_stats.c</span><br><span>+++ b/src/osmo-bsc/bsc_stats.c</span><br><span>@@ -93,6 +93,7 @@</span><br><span>         [BSC_CTR_PAGING_ATTEMPTED] =            {"paging:attempted", "Paging attempts for a subscriber"},</span><br><span>        [BSC_CTR_PAGING_DETACHED] =             {"paging:detached", "Paging request send failures because no responsible BTS was found"},</span><br><span>        [BSC_CTR_PAGING_RESPONDED] =            {"paging:responded", "Paging attempts with successful response"},</span><br><span style="color: hsl(120, 100%, 40%);">+ [BSC_CTR_PAGING_EXPIRED] =              {"paging:expired", "Paging Request expired because of timeout T3113"},</span><br><span>   [BSC_CTR_PAGING_NO_ACTIVE_PAGING] =     {"paging:no_active_paging", "Paging response without an active paging request (arrived after paging expiration?)"},</span><br><span> </span><br><span>  [BSC_CTR_UNKNOWN_UNIT_ID] =             {"abis:unknown_unit_id", "Connection attempts from unknown IPA CCM Unit ID"},</span><br><span>diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c</span><br><span>index 04512be..721ea31 100644</span><br><span>--- a/src/osmo-bsc/paging.c</span><br><span>+++ b/src/osmo-bsc/paging.c</span><br><span>@@ -66,6 +66,7 @@</span><br><span> static void paging_remove_request(struct gsm_bts_paging_state *paging_bts,</span><br><span>                                   struct gsm_paging_request *to_be_deleted)</span><br><span> {</span><br><span style="color: hsl(120, 100%, 40%);">+      to_be_deleted->bsub->active_paging_requests--;</span><br><span>         osmo_timer_del(&to_be_deleted->T3113);</span><br><span>        llist_del(&to_be_deleted->entry);</span><br><span>     bsc_subscr_put(to_be_deleted->bsub, BSUB_USE_PAGING_REQUEST);</span><br><span>@@ -284,6 +285,11 @@</span><br><span>      /* must be destroyed before calling cbfn, to prevent double free */</span><br><span>  rate_ctr_inc(rate_ctr_group_get_ctr(req->bts->bts_ctrs, BTS_CTR_PAGING_EXPIRED));</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+   /* If last BTS paging times out (active_paging_requests will be</span><br><span style="color: hsl(120, 100%, 40%);">+        * decremented in paging_remove_request below): */</span><br><span style="color: hsl(120, 100%, 40%);">+    if (req->bsub->active_paging_requests == 1)</span><br><span style="color: hsl(120, 100%, 40%);">+             rate_ctr_inc(rate_ctr_group_get_ctr(bsc_gsmnet->bsc_ctrs, BSC_CTR_PAGING_EXPIRED));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>     /* destroy it now. Do not access req afterwards */</span><br><span>   paging_remove_request(&req->bts->paging, req);</span><br><span> </span><br><span>@@ -341,6 +347,7 @@</span><br><span>   }</span><br><span> </span><br><span>        LOG_PAGING_BTS(params, bts, DPAG, LOGL_DEBUG, "Start paging\n");</span><br><span style="color: hsl(120, 100%, 40%);">+    params->bsub->active_paging_requests++;</span><br><span>        req = talloc_zero(tall_paging_ctx, struct gsm_paging_request);</span><br><span>       OSMO_ASSERT(req);</span><br><span>    req->reason = params->reason;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/26384">change 26384</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-bsc/+/26384"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I9c118e7e3d61ed8c9f1951111255b196905eba4d </div>
<div style="display:none"> Gerrit-Change-Number: 26384 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>