Jenkins Builder has posted comments on this change by kirr. ( https://gerrit.osmocom.org/c/osmocom-bb/+/40051?usp=email )
Change subject: trx_toolkit/fake_trx: Split it into fake_trx and _fake_trx modules
......................................................................
Patch Set 1:
(2 comments)
File src/target/trx_toolkit/_fake_trx.py:
Robot Comment from checkpatch (run ID ):
https://gerrit.osmocom.org/c/osmocom-bb/+/40051/comment/1b505f69_07fd4d5d?u… :
PS1, Line 216: msg.burst = None # burst bits are omited
'omited' may be misspelled - perhaps 'omitted'?
Robot Comment from checkpatch (run ID ):
https://gerrit.osmocom.org/c/osmocom-bb/+/40051/comment/28e7a449_edbf9a6e?u… :
PS1, Line 218: # TODO: shoud we make these values configurable?
'shoud' may be misspelled - perhaps 'should'?
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/40051?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Iadffd49de8197564e57bfd9cb660b1d11136ffd4
Gerrit-Change-Number: 40051
Gerrit-PatchSet: 1
Gerrit-Owner: kirr <kirr(a)nexedi.com>
Gerrit-CC: Jenkins Builder
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: osmith <osmith(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 17 Apr 2025 09:52:49 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
kirr has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/40088?usp=email )
Change subject: trx_toolkit/data_msg: TODO random -> C
......................................................................
trx_toolkit/data_msg: TODO random -> C
With this patch I'm completing my optimization work on fake_trx. I have
not had time to convert random routines to C yet. In my testing I was
not activating any FakeTRX random modes at all and so lack of C random
support was not showing in the profiles. But if those random modes will
be activated py-level random will certainly slow things down. Add TODO
entries to fix that.
For the reference compared to the state where Cython was just introduced
in I2159a07bece13bda4f6ccd957063d4644d8b5e4f (trx_toolkit: Move
FakeTRX-related performance-sensitive modules to Cython) we now perform
significantly better: for 1 BTS + 2 ccch_scan fake_trx now takes ~ 25%
of CPU without clock overruns. While at that Pyx-base state it was
taking ~ 70% of CPU with frequent clock overruns.
Profiles at pyx-base and hereby state can be seen here:
http://navytux.spb.ru/~kirr/osmo/fake_trx/pyx-base.htmlhttp://navytux.spb.ru/~kirr/osmo/fake_trx/pyx-optimized.html
and if comparing the effect of whole optimization work starting from
Ic9e16720daeb348b5f9c535c24a682db53a93529 parented on 54a0052a
(fake_trx: Remove unneeded field assignment) the effect is as follows:
Running 1 BTS + 2 Mobiles without Frequency Hopping + 1 ccch_scan
Before optimization work:
fake_trx is occupying 2 CPU cores loading every core close to
100% with hitting clock overrun non-stop.
After optimization work:
fake_Trx is occupying 1 CPU core with loading it ~ 35% by only
one thread without hitting any clock overrun.
Change-Id: If2c091c0a729a04dcac954ab0905b6f3be32a533
---
M src/target/trx_toolkit/data_msg.pyx
1 file changed, 12 insertions(+), 12 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/88/40088/1
diff --git a/src/target/trx_toolkit/data_msg.pyx b/src/target/trx_toolkit/data_msg.pyx
index bdc3119..d62dd63 100644
--- a/src/target/trx_toolkit/data_msg.pyx
+++ b/src/target/trx_toolkit/data_msg.pyx
@@ -131,11 +131,11 @@
def rand_fn(self):
''' Generate a random frame number. '''
- return random.randint(0, GSM_HYPERFRAME)
+ return random.randint(0, GSM_HYPERFRAME) # TODO -> C
def rand_tn(self):
''' Generate a random timeslot number. '''
- return random.randint(0, 7)
+ return random.randint(0, 7) # TODO -> C
def rand_hdr(self):
''' Randomize the message header. '''
@@ -393,7 +393,7 @@
if max is None:
max = PWR_MAX
- return random.randint(min, max)
+ return random.randint(min, max) # TODO -> C
def rand_hdr(self):
''' Randomize message specific header. '''
@@ -457,7 +457,7 @@
def rand_burst(self, length = GMSK_BURST_LEN):
''' Generate a random message specific burst. '''
- self.burst = bytearray([random.randint(0, 1) for _ in range(length)])
+ self.burst = bytearray([random.randint(0, 1) for _ in range(length)]) # TODO -> C
def trans(self, ver = None):
''' Transform this message into RxMsg. '''
@@ -625,7 +625,7 @@
if max is None:
max = RSSI_MAX
- return random.randint(min, max)
+ return random.randint(min, max) # TODO -> C
def rand_toa256(self, min = None, max = None):
''' Generate a random ToA (Time of Arrival) value. '''
@@ -636,7 +636,7 @@
if max is None:
max = TOA256_MAX
- return random.randint(min, max)
+ return random.randint(min, max) # TODO -> C
def rand_hdr(self):
''' Randomize message specific header. '''
@@ -646,15 +646,15 @@
self.toa256 = self.rand_toa256()
if self.ver >= 0x01:
- self.mod_type = random.choice(_mod_registry)
+ self.mod_type = random.choice(_mod_registry) # TODO -> C
if self.mod_type is ModGMSK:
- self.tsc_set = random.randint(0, 3)
+ self.tsc_set = random.randint(0, 3) # TODO -> C
else:
- self.tsc_set = random.randint(0, 1)
- self.tsc = random.randint(0, TSC_MAX)
+ self.tsc_set = random.randint(0, 1) # TODO -> C
+ self.tsc = random.randint(0, TSC_MAX) # TODO -> C
# C/I: Carrier-to-Interference ratio
- self.ci = random.randint(CI_MIN, CI_MAX)
+ self.ci = random.randint(CI_MIN, CI_MAX) # TODO -> C
def desc_hdr(self):
''' Generate human-readable header description. '''
@@ -815,7 +815,7 @@
if length is None:
length = self.mod_type.bl
- self.burst = array.array('b', [random.randint(-127, 127) for _ in range(length)])
+ self.burst = array.array('b', [random.randint(-127, 127) for _ in range(length)]) # TODO -> C
def trans(self, ver = None):
''' Transform this message to TxMsg. '''
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/40088?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: If2c091c0a729a04dcac954ab0905b6f3be32a533
Gerrit-Change-Number: 40088
Gerrit-PatchSet: 1
Gerrit-Owner: kirr <kirr(a)nexedi.com>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: osmith <osmith(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
kirr has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/40090?usp=email )
Change subject: trx_toolkit/transceiver: Use `msg is None` instead of `not msg`
......................................................................
trx_toolkit/transceiver: Use `msg is None` instead of `not msg`
`msg is None` are two pointers comparision. `not msg` goes to py-level
and can generally invoke arbitrary python code.
Change-Id: I1278bed0a83dfac13734467f5333fae30e19bd5a
---
M src/target/trx_toolkit/transceiver.pyx
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/90/40090/1
diff --git a/src/target/trx_toolkit/transceiver.pyx b/src/target/trx_toolkit/transceiver.pyx
index 901a637..2b408a5 100644
--- a/src/target/trx_toolkit/transceiver.pyx
+++ b/src/target/trx_toolkit/transceiver.pyx
@@ -277,7 +277,7 @@
cdef TxMsg recv_data_msg(self): # -> TxMsg | None
# Read and parse data from socket
msg = self.data_if.recv_tx_msg()
- if not msg:
+ if msg is None:
return None
# Make sure that transceiver is configured and running
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/40090?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I1278bed0a83dfac13734467f5333fae30e19bd5a
Gerrit-Change-Number: 40090
Gerrit-PatchSet: 1
Gerrit-Owner: kirr <kirr(a)nexedi.com>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-CC: osmith <osmith(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>