neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/28205 )
Change subject: fix performance for chan_counts and all_allocated stats ......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS2: Pau, I tested with only signal == S_NM_RUNNING_CHG, and this causes counting errors during BSC_Tests.TC_ctrl_trx_rf_locked. I remember now that's the reason why I added S_NM_STATECHG at all. So what do we do now, fix S_NM_RUNNING_CHG or just use S_NM_STATECHG?
Details: this one causes counting errors:
static int chan_counts_sig_cb(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data) { struct nm_running_chg_signal_data *nsd; struct gsm_bts_trx *trx; if (signal != S_NM_RUNNING_CHG) return 0; nsd = signal_data; switch (nsd->obj_class) { case NM_OC_RADIO_CARRIER: trx = (struct gsm_bts_trx *)nsd->obj; break; case NM_OC_BASEB_TRANSC: trx = gsm_bts_bb_trx_get_trx((struct gsm_bts_bb_trx *)nsd->obj); break; default: return 0; } chan_counts_trx_update(trx); return 0; }
The errors I see are that both switching off the TRX via rf_locked as well as switching on the TRX are not caught in the counts.
I added logging for the signal occuring and the log shows that there is never an S_NM_RUNNING_CHG (== 17) fired when rf_locked is changed via CTRL. An NM_STATECHG does happen in there, shown by that 'DLGLOBAL ERROR chan_counts_sig_cb(9)':
20220601220123595 DLGLOBAL NOTICE TTCN3 f_logp(): TC_ctrl_trx_rf_locked: lock BTS 1 TRX 0 (logging_vty.c:1165) 20220601220123597 DLCTRL DEBUG Command: SET bts.1.trx.0.rf_locked = "1" (control_cmd.c:450) 20220601220123597 DNM NOTICE (bts=1,trx=0) Requesting administrative state change Unlocked -> Locked [ctrl] (bts_trx.c:264) 20220601220123597 DNM INFO NM_RCARRIER_OP(bts1-trx0)[0x612000008320]{ENABLED}: Received Event FORCE_LOCK_CHG (bts_trx.c:266) 20220601220123598 DNM DEBUG OC=RADIO-CARRIER(02) INST=(00,00,ff): Rx Change Administrative State ACK Locked (abis_nm.c:810) 20220601220123598 DNM INFO NM_RCARRIER_OP(bts1-trx0)[0x612000008320]{ENABLED}: Received Event STATE_CHG_REP (bts_ipaccess_nanobts.c:176) 20220601220123598 DLGLOBAL ERROR chan_counts_sig_cb(9) (chan_counts.c:231) 20220601220123598 DLGLOBAL DEBUG change in channel counts: ts 1-0-0: { all.max{ SDCCH=-3 CCCH=-1 CBCH=-1 } all.current{ SDCCH=-3 CCCH=-1 CBCH=-1 } all.alloc{ CBCH=-1 } all.f ree{ SDCCH=-3 CCCH=-1 } static.max{ SDCCH=-3 CCCH=-1 CBCH=-1 } static.current{ SDCCH=-3 CCCH=-1 CBCH=-1 } static.alloc{ CBCH=-1 } static.free{ SDCCH=-3 CCCH=-1 } } (chan_cou nts.c:196) [...skipping more "change in channel counts" logging...] 20220601220123599 DNM DEBUG OC=RADIO-CARRIER(02) INST=(00,00,ff): STATE CHG: OP_STATE=Enabled AVAIL=OK(ff) ADM=Locked (No State change detected) (abis_nm.c:306) 20220601220124600 DLCTRL DEBUG Command: GET rf_states (control_cmd.c:417)