dexter has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/28170 )
Change subject: filesystem: also return the encoded FCP from probe_file
......................................................................
filesystem: also return the encoded FCP from probe_file
he method probe_file returns the decoded FCP after it managed to
successfully probe the file. Lets also return the encoded FCP string, as
it is needed by the caller.
Change-Id: Ia5659e106fb0d6fb8b77506a10eba309e764723e
---
M pySim/filesystem.py
1 file changed, 3 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, approved
diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index 5bbd57b..7c5d49a 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -1402,7 +1402,7 @@
self.selected_file.add_files([f])
self.selected_file = f
- return select_resp
+ return select_resp, data
def _select_pre(self, cmd_app):
# unregister commands of old file
@@ -1487,7 +1487,8 @@
raise RuntimeError("%s: %s - %s" % (swm.sw_actual, k[0], k[1]))
select_resp = f.decode_select_response(data)
else:
- select_resp = self.probe_file(name, cmd_app)
+ (select_resp, data) = self.probe_file(name, cmd_app)
+
# store the raw + decoded FCP for later reference
self.selected_file_fcp_hex = data
self.selected_file_fcp = select_resp
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/28170
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ia5659e106fb0d6fb8b77506a10eba309e764723e
Gerrit-Change-Number: 28170
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
Hello Jenkins Builder, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-bsc/+/28205
to look at the new patch set (#3).
Change subject: fix performance for chan_counts and all_allocated stats
......................................................................
fix performance for chan_counts and all_allocated stats
The all_allocated_update_bsc() does inefficient iterating to count
active/inactive lchans, which scales badly for high numbers of TRX
managed by osmo-bsc.
We need to update the all_allocated flags immediately (periodic counting
alone would suffer from undersampling), so, until now, we are calling
this inefficient function every time a channel state changes.
Instead of iterating all channels for any chan state changes anywhere,
keep global state of the current channel counts, and on channel state
change only update those ts, trx, bts counts that actually change.
A desirable side effect: for connection stats and handover decision 2,
we can now also use the globally updated channel counts and save a bunch
of inefficient iterations.
To get accurate channel counts at all times, spread around some
chan_counts_ts_update() calls in pivotal places. It re-counts the given
timeslot and cascades counter changes, iff required.
Just in case I missed some channel accounting, still run an inefficient
iterating count regularly that detects errors, logs them and fixes them.
No real harm done if such error appears. None show in ttcn3 BSC_Tests.
It is fine to do the inefficient iteration once per second; channel
state changes can realistically happen hundreds of times per second.
Related: SYS#5976
Change-Id: I580bfae329aac8d4552723164741536af6512011
---
M include/osmocom/bsc/bsc_stats.h
M include/osmocom/bsc/bts.h
M include/osmocom/bsc/bts_trx.h
M include/osmocom/bsc/chan_counts.h
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/bsc_stats.c
M src/osmo-bsc/chan_counts.c
M src/osmo-bsc/handover_decision_2.c
M src/osmo-bsc/lchan_fsm.c
M src/osmo-bsc/osmo_bsc_main.c
M src/osmo-bsc/timeslot_fsm.c
M tests/handover/handover_test.c
13 files changed, 325 insertions(+), 94 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/05/28205/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/28205
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I580bfae329aac8d4552723164741536af6512011
Gerrit-Change-Number: 28205
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
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:
FYI, counting is correct if I only use NM_STATECHG.
But of course that re-counts the TRX on many more occasions than would be necessary.
On the flip side, state changes to NM objects is very rare compared to the runtime of an osmo-bsc process.
So personally I'd like to use NM_STATECHG now,
and move to NM_RUNNING_CHG as soon as that is reliable.
So that I can fix the performance regression sooner rather than later...
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/28205
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I580bfae329aac8d4552723164741536af6512011
Gerrit-Change-Number: 28205
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 01 Jun 2022 21:32:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: neels.
pespin 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:
> hm sorry, the log is hardly readable here in gerrit. […]
Hi, I think that's a bug in the NM FSMs. I think it should move into "disabled dependency" or alike. I'll have a look tomorrow at TS 12.21 and see if osmo-bts also acts properly.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/28205
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I580bfae329aac8d4552723164741536af6512011
Gerrit-Change-Number: 28205
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 01 Jun 2022 21:27:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: comment
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 […]
hm sorry, the log is hardly readable here in gerrit.
point being that RUNNING_CHG is not happening from rf_locked changes.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/28205
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I580bfae329aac8d4552723164741536af6512011
Gerrit-Change-Number: 28205
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 01 Jun 2022 20:19:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: comment
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)
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/28205
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I580bfae329aac8d4552723164741536af6512011
Gerrit-Change-Number: 28205
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 01 Jun 2022 20:16:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: dexter.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/28170 )
Change subject: filesystem: also return the encoded FCP from probe_file
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/28170
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ia5659e106fb0d6fb8b77506a10eba309e764723e
Gerrit-Change-Number: 28170
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 01 Jun 2022 19:48:13 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: dexter.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/28170 )
Change subject: filesystem: also return the encoded FCP from probe_file
......................................................................
Patch Set 2: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/28170
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ia5659e106fb0d6fb8b77506a10eba309e764723e
Gerrit-Change-Number: 28170
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 01 Jun 2022 19:48:06 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: laforge, dexter.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/28163 )
Change subject: pySim-shell: make APDU command available on the lowest level
......................................................................
Patch Set 3: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/28163
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I601b8f17bd6af41dcbf7bbb53c75903dd46beee7
Gerrit-Change-Number: 28163
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 01 Jun 2022 19:47:01 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment