<p>neels has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/25975">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">implement all_allocated:{static_sdcch,static_tch} rate counters<br><br>Same as all_allocated:{sdcch,tch}, but already trigger when all<br>non-dynamic timeslots are allocated.<br><br>Related: SYS#4878<br>Related: Ib3997a827c9cc43d1361bb0cf3bfab9f6d91bf82 (osmo-ttcn3-hacks)<br>Change-Id: I2fa14531f16d3f07085620f1c50eb839c420da6a<br>---<br>M include/osmocom/bsc/bsc_stats.h<br>M include/osmocom/bsc/bts.h<br>M include/osmocom/bsc/gsm_data.h<br>M src/osmo-bsc/bsc_init.c<br>M src/osmo-bsc/bsc_stats.c<br>M src/osmo-bsc/bts.c<br>6 files changed, 82 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/75/25975/1</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 9a2f36c..9140f85 100644</span><br><span>--- a/include/osmocom/bsc/bsc_stats.h</span><br><span>+++ b/include/osmocom/bsc/bsc_stats.h</span><br><span>@@ -82,7 +82,9 @@</span><br><span>      BSC_CTR_MSCPOOL_EMERG_FORWARDED,</span><br><span>     BSC_CTR_MSCPOOL_EMERG_LOST,</span><br><span>  BSC_CTR_ALL_ALLOCATED_SDCCH,</span><br><span style="color: hsl(120, 100%, 40%);">+  BSC_CTR_ALL_ALLOCATED_STATIC_SDCCH,</span><br><span>  BSC_CTR_ALL_ALLOCATED_TCH,</span><br><span style="color: hsl(120, 100%, 40%);">+    BSC_CTR_ALL_ALLOCATED_STATIC_TCH,</span><br><span> };</span><br><span> </span><br><span> extern const struct rate_ctr_desc bsc_ctr_description[];</span><br><span>diff --git a/include/osmocom/bsc/bts.h b/include/osmocom/bsc/bts.h</span><br><span>index 26ffaf1..4ea0735 100644</span><br><span>--- a/include/osmocom/bsc/bts.h</span><br><span>+++ b/include/osmocom/bsc/bts.h</span><br><span>@@ -145,7 +145,9 @@</span><br><span>       BTS_CTR_SRVCC_FAILED,</span><br><span>        BTS_CTR_SRVCC_ERROR,</span><br><span>         BTS_CTR_ALL_ALLOCATED_SDCCH,</span><br><span style="color: hsl(120, 100%, 40%);">+  BTS_CTR_ALL_ALLOCATED_STATIC_SDCCH,</span><br><span>  BTS_CTR_ALL_ALLOCATED_TCH,</span><br><span style="color: hsl(120, 100%, 40%);">+    BTS_CTR_ALL_ALLOCATED_STATIC_TCH,</span><br><span> };</span><br><span> </span><br><span> extern const struct rate_ctr_desc bts_ctr_description[];</span><br><span>@@ -580,7 +582,9 @@</span><br><span>        enum imm_ass_time imm_ass_time;</span><br><span> </span><br><span>  struct time_cc all_allocated_sdcch;</span><br><span style="color: hsl(120, 100%, 40%);">+   struct time_cc all_allocated_static_sdcch;</span><br><span>   struct time_cc all_allocated_tch;</span><br><span style="color: hsl(120, 100%, 40%);">+     struct time_cc all_allocated_static_tch;</span><br><span> };</span><br><span> </span><br><span> #define GSM_BTS_SI2Q(bts, i)   (struct gsm48_system_information_type_2quater *)((bts)->si_buf[SYSINFO_TYPE_2quater][i])</span><br><span>diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h</span><br><span>index 2917be3..e1bba80 100644</span><br><span>--- a/include/osmocom/bsc/gsm_data.h</span><br><span>+++ b/include/osmocom/bsc/gsm_data.h</span><br><span>@@ -1262,7 +1262,9 @@</span><br><span>        struct smlc_config *smlc;</span><br><span> </span><br><span>        struct time_cc all_allocated_sdcch;</span><br><span style="color: hsl(120, 100%, 40%);">+   struct time_cc all_allocated_static_sdcch;</span><br><span>   struct time_cc all_allocated_tch;</span><br><span style="color: hsl(120, 100%, 40%);">+     struct time_cc all_allocated_static_tch;</span><br><span> };</span><br><span> </span><br><span> struct gsm_audio_support {</span><br><span>diff --git a/src/osmo-bsc/bsc_init.c b/src/osmo-bsc/bsc_init.c</span><br><span>index 11cda69..9328707 100644</span><br><span>--- a/src/osmo-bsc/bsc_init.c</span><br><span>+++ b/src/osmo-bsc/bsc_init.c</span><br><span>@@ -131,6 +131,17 @@</span><br><span>                     .T_defs = net->T_defs,</span><br><span>            },</span><br><span>   };</span><br><span style="color: hsl(120, 100%, 40%);">+    net->all_allocated_static_sdcch = (struct time_cc){</span><br><span style="color: hsl(120, 100%, 40%);">+                .cfg = {</span><br><span style="color: hsl(120, 100%, 40%);">+                      .gran_usec = 1*1000000,</span><br><span style="color: hsl(120, 100%, 40%);">+                       .forget_sum_usec = 60*1000000,</span><br><span style="color: hsl(120, 100%, 40%);">+                        .rate_ctr = rate_ctr_group_get_ctr(net->bsc_ctrs, BSC_CTR_ALL_ALLOCATED_STATIC_SDCCH),</span><br><span style="color: hsl(120, 100%, 40%);">+                     .T_gran = -16,</span><br><span style="color: hsl(120, 100%, 40%);">+                        .T_round_threshold = -17,</span><br><span style="color: hsl(120, 100%, 40%);">+                     .T_forget_sum = -18,</span><br><span style="color: hsl(120, 100%, 40%);">+                  .T_defs = net->T_defs,</span><br><span style="color: hsl(120, 100%, 40%);">+             },</span><br><span style="color: hsl(120, 100%, 40%);">+    };</span><br><span>   net->all_allocated_tch = (struct time_cc){</span><br><span>                .cfg = {</span><br><span>                     .gran_usec = 1*1000000,</span><br><span>@@ -142,6 +153,17 @@</span><br><span>                       .T_defs = net->T_defs,</span><br><span>            },</span><br><span>   };</span><br><span style="color: hsl(120, 100%, 40%);">+    net->all_allocated_static_tch = (struct time_cc){</span><br><span style="color: hsl(120, 100%, 40%);">+          .cfg = {</span><br><span style="color: hsl(120, 100%, 40%);">+                      .gran_usec = 1*1000000,</span><br><span style="color: hsl(120, 100%, 40%);">+                       .forget_sum_usec = 60*1000000,</span><br><span style="color: hsl(120, 100%, 40%);">+                        .rate_ctr = rate_ctr_group_get_ctr(net->bsc_ctrs, BSC_CTR_ALL_ALLOCATED_STATIC_TCH),</span><br><span style="color: hsl(120, 100%, 40%);">+                       .T_gran = -16,</span><br><span style="color: hsl(120, 100%, 40%);">+                        .T_round_threshold = -17,</span><br><span style="color: hsl(120, 100%, 40%);">+                     .T_forget_sum = -18,</span><br><span style="color: hsl(120, 100%, 40%);">+                  .T_defs = net->T_defs,</span><br><span style="color: hsl(120, 100%, 40%);">+             },</span><br><span style="color: hsl(120, 100%, 40%);">+    };</span><br><span> </span><br><span>       INIT_LLIST_HEAD(&net->bts_rejected);</span><br><span>  gsm_net_update_ctype(net);</span><br><span>diff --git a/src/osmo-bsc/bsc_stats.c b/src/osmo-bsc/bsc_stats.c</span><br><span>index cae5300..cb2c025 100644</span><br><span>--- a/src/osmo-bsc/bsc_stats.c</span><br><span>+++ b/src/osmo-bsc/bsc_stats.c</span><br><span>@@ -103,7 +103,11 @@</span><br><span>       [BSC_CTR_MSCPOOL_EMERG_LOST] =          {"mscpool:emerg:lost",</span><br><span>                                              "Emergency call requests lost because no MSC was found available"},</span><br><span>       [BSC_CTR_ALL_ALLOCATED_SDCCH] =         {"all_allocated:sdcch", "Cumulative counter of seconds where all SDCCH channels were allocated"},</span><br><span style="color: hsl(120, 100%, 40%);">+ [BSC_CTR_ALL_ALLOCATED_STATIC_SDCCH] =  {"all_allocated:static_sdcch",</span><br><span style="color: hsl(120, 100%, 40%);">+                                               "Cumulative counter of seconds where all non-dynamic SDCCH channels were allocated"},</span><br><span>     [BSC_CTR_ALL_ALLOCATED_TCH] =           {"all_allocated:tch", "Cumulative counter of seconds where all TCH channels were allocated"},</span><br><span style="color: hsl(120, 100%, 40%);">+     [BSC_CTR_ALL_ALLOCATED_STATIC_TCH] =    {"all_allocated:static_tch",</span><br><span style="color: hsl(120, 100%, 40%);">+                                                 "Cumulative counter of seconds where all non-dynamic TCH channels were allocated"},</span><br><span> };</span><br><span> </span><br><span> const struct rate_ctr_group_desc bsc_ctrg_desc = {</span><br><span>@@ -214,12 +218,22 @@</span><br><span>                                bts_counts[CHAN_COUNTS1_ALL][CHAN_COUNTS2_MAX_TOTAL][GSM_LCHAN_SDCCH]</span><br><span>                                && !bts_counts[CHAN_COUNTS1_ALL][CHAN_COUNTS2_FREE][GSM_LCHAN_SDCCH]);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+           time_cc_set_flag(&bts->all_allocated_static_sdcch,</span><br><span style="color: hsl(120, 100%, 40%);">+                              bts_counts[CHAN_COUNTS1_STATIC][CHAN_COUNTS2_MAX_TOTAL][GSM_LCHAN_SDCCH]</span><br><span style="color: hsl(120, 100%, 40%);">+                              && !bts_counts[CHAN_COUNTS1_STATIC][CHAN_COUNTS2_FREE][GSM_LCHAN_SDCCH]);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>                 time_cc_set_flag(&bts->all_allocated_tch,</span><br><span>                              (bts_counts[CHAN_COUNTS1_ALL][CHAN_COUNTS2_MAX_TOTAL][GSM_LCHAN_TCH_F]</span><br><span>                                + bts_counts[CHAN_COUNTS1_ALL][CHAN_COUNTS2_MAX_TOTAL][GSM_LCHAN_TCH_H])</span><br><span>                            && !(bts_counts[CHAN_COUNTS1_ALL][CHAN_COUNTS2_FREE][GSM_LCHAN_TCH_F]</span><br><span>                                     + bts_counts[CHAN_COUNTS1_ALL][CHAN_COUNTS2_FREE][GSM_LCHAN_TCH_H]));</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+               time_cc_set_flag(&bts->all_allocated_static_tch,</span><br><span style="color: hsl(120, 100%, 40%);">+                                (bts_counts[CHAN_COUNTS1_STATIC][CHAN_COUNTS2_MAX_TOTAL][GSM_LCHAN_TCH_F]</span><br><span style="color: hsl(120, 100%, 40%);">+                              + bts_counts[CHAN_COUNTS1_STATIC][CHAN_COUNTS2_MAX_TOTAL][GSM_LCHAN_TCH_H])</span><br><span style="color: hsl(120, 100%, 40%);">+                          && !(bts_counts[CHAN_COUNTS1_STATIC][CHAN_COUNTS2_FREE][GSM_LCHAN_TCH_F]</span><br><span style="color: hsl(120, 100%, 40%);">+                                   + bts_counts[CHAN_COUNTS1_STATIC][CHAN_COUNTS2_FREE][GSM_LCHAN_TCH_H]));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>             chan_counts_add(bsc_counts, bts_counts);</span><br><span>     }</span><br><span> </span><br><span>@@ -227,9 +241,19 @@</span><br><span>                          bsc_counts[CHAN_COUNTS1_ALL][CHAN_COUNTS2_MAX_TOTAL][GSM_LCHAN_SDCCH]</span><br><span>                        && !bsc_counts[CHAN_COUNTS1_ALL][CHAN_COUNTS2_FREE][GSM_LCHAN_SDCCH]);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+   time_cc_set_flag(&net->all_allocated_static_sdcch,</span><br><span style="color: hsl(120, 100%, 40%);">+                      bsc_counts[CHAN_COUNTS1_STATIC][CHAN_COUNTS2_MAX_TOTAL][GSM_LCHAN_SDCCH]</span><br><span style="color: hsl(120, 100%, 40%);">+                      && !bsc_counts[CHAN_COUNTS1_STATIC][CHAN_COUNTS2_FREE][GSM_LCHAN_SDCCH]);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>         time_cc_set_flag(&net->all_allocated_tch,</span><br><span>                      (bsc_counts[CHAN_COUNTS1_ALL][CHAN_COUNTS2_MAX_TOTAL][GSM_LCHAN_TCH_F]</span><br><span>                        + bsc_counts[CHAN_COUNTS1_ALL][CHAN_COUNTS2_MAX_TOTAL][GSM_LCHAN_TCH_H])</span><br><span>                    && !(bsc_counts[CHAN_COUNTS1_ALL][CHAN_COUNTS2_FREE][GSM_LCHAN_TCH_F]</span><br><span>                             + bsc_counts[CHAN_COUNTS1_ALL][CHAN_COUNTS2_FREE][GSM_LCHAN_TCH_H]));</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ time_cc_set_flag(&net->all_allocated_static_tch,</span><br><span style="color: hsl(120, 100%, 40%);">+                        (bsc_counts[CHAN_COUNTS1_STATIC][CHAN_COUNTS2_MAX_TOTAL][GSM_LCHAN_TCH_F]</span><br><span style="color: hsl(120, 100%, 40%);">+                      + bsc_counts[CHAN_COUNTS1_STATIC][CHAN_COUNTS2_MAX_TOTAL][GSM_LCHAN_TCH_H])</span><br><span style="color: hsl(120, 100%, 40%);">+                  && !(bsc_counts[CHAN_COUNTS1_STATIC][CHAN_COUNTS2_FREE][GSM_LCHAN_TCH_F]</span><br><span style="color: hsl(120, 100%, 40%);">+                           + bsc_counts[CHAN_COUNTS1_STATIC][CHAN_COUNTS2_FREE][GSM_LCHAN_TCH_H]));</span><br><span> }</span><br><span>diff --git a/src/osmo-bsc/bts.c b/src/osmo-bsc/bts.c</span><br><span>index 95015ba..5202e31 100644</span><br><span>--- a/src/osmo-bsc/bts.c</span><br><span>+++ b/src/osmo-bsc/bts.c</span><br><span>@@ -222,6 +222,17 @@</span><br><span>                      .T_defs = net->T_defs,</span><br><span>            },</span><br><span>   };</span><br><span style="color: hsl(120, 100%, 40%);">+    bts->all_allocated_static_sdcch = (struct time_cc){</span><br><span style="color: hsl(120, 100%, 40%);">+                .cfg = {</span><br><span style="color: hsl(120, 100%, 40%);">+                      .gran_usec = 1*1000000,</span><br><span style="color: hsl(120, 100%, 40%);">+                       .forget_sum_usec = 60*1000000,</span><br><span style="color: hsl(120, 100%, 40%);">+                        .rate_ctr = rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_ALL_ALLOCATED_STATIC_SDCCH),</span><br><span style="color: hsl(120, 100%, 40%);">+                     .T_gran = -16,</span><br><span style="color: hsl(120, 100%, 40%);">+                        .T_round_threshold = -17,</span><br><span style="color: hsl(120, 100%, 40%);">+                     .T_forget_sum = -18,</span><br><span style="color: hsl(120, 100%, 40%);">+                  .T_defs = net->T_defs,</span><br><span style="color: hsl(120, 100%, 40%);">+             },</span><br><span style="color: hsl(120, 100%, 40%);">+    };</span><br><span>   bts->all_allocated_tch = (struct time_cc){</span><br><span>                .cfg = {</span><br><span>                     .gran_usec = 1*1000000,</span><br><span>@@ -233,6 +244,17 @@</span><br><span>                       .T_defs = net->T_defs,</span><br><span>            },</span><br><span>   };</span><br><span style="color: hsl(120, 100%, 40%);">+    bts->all_allocated_static_tch = (struct time_cc){</span><br><span style="color: hsl(120, 100%, 40%);">+          .cfg = {</span><br><span style="color: hsl(120, 100%, 40%);">+                      .gran_usec = 1*1000000,</span><br><span style="color: hsl(120, 100%, 40%);">+                       .forget_sum_usec = 60*1000000,</span><br><span style="color: hsl(120, 100%, 40%);">+                        .rate_ctr = rate_ctr_group_get_ctr(bts->bts_ctrs, BTS_CTR_ALL_ALLOCATED_STATIC_TCH),</span><br><span style="color: hsl(120, 100%, 40%);">+                       .T_gran = -16,</span><br><span style="color: hsl(120, 100%, 40%);">+                        .T_round_threshold = -17,</span><br><span style="color: hsl(120, 100%, 40%);">+                     .T_forget_sum = -18,</span><br><span style="color: hsl(120, 100%, 40%);">+                  .T_defs = net->T_defs,</span><br><span style="color: hsl(120, 100%, 40%);">+             },</span><br><span style="color: hsl(120, 100%, 40%);">+    };</span><br><span> </span><br><span>       /* create our primary TRX */</span><br><span>         bts->c0 = gsm_bts_trx_alloc(bts);</span><br><span>@@ -1231,9 +1253,15 @@</span><br><span>        [BTS_CTR_ALL_ALLOCATED_SDCCH] =</span><br><span>              { "all_allocated:sdcch",</span><br><span>             "Cumulative counter of seconds where all SDCCH channels were allocated" },</span><br><span style="color: hsl(120, 100%, 40%);">+        [BTS_CTR_ALL_ALLOCATED_STATIC_SDCCH] =</span><br><span style="color: hsl(120, 100%, 40%);">+                { "all_allocated:static_sdcch",</span><br><span style="color: hsl(120, 100%, 40%);">+               "Cumulative counter of seconds where all non-dynamic SDCCH channels were allocated" },</span><br><span>   [BTS_CTR_ALL_ALLOCATED_TCH] =</span><br><span>                { "all_allocated:tch",</span><br><span>               "Cumulative counter of seconds where all TCH channels were allocated" },</span><br><span style="color: hsl(120, 100%, 40%);">+  [BTS_CTR_ALL_ALLOCATED_STATIC_TCH] =</span><br><span style="color: hsl(120, 100%, 40%);">+          { "all_allocated:static_tch",</span><br><span style="color: hsl(120, 100%, 40%);">+                 "Cumulative counter of seconds where all non-dynamic TCH channels were allocated" },</span><br><span> };</span><br><span> </span><br><span> const struct rate_ctr_group_desc bts_ctrg_desc = {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/25975">change 25975</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/+/25975"/><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: I2fa14531f16d3f07085620f1c50eb839c420da6a </div>
<div style="display:none"> Gerrit-Change-Number: 25975 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>