kirr has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmocom-bb/+/40063?usp=email )
Change subject: trx_toolkit/_fake_trx: Invoke CLCKGen.tick via C
......................................................................
trx_toolkit/_fake_trx: Invoke CLCKGen.tick via C
As can be seen from
http://navytux.spb.ru/~kirr/osmo/fake_trx/pyx-base.html
(Runner_5loop)
there is a lot of overhead to invoke things via py-level.
-> Avoid that for invoking CLCK_gen.tick by switching to use C-level for
this call.
We will deal with switching other things to C later.
Change-Id: I19a7a90cd420b481c555f37f3fb7f2ebb513d6e8
---
M src/target/trx_toolkit/_clck_gen.pxd
M src/target/trx_toolkit/_clck_gen.pyx
M src/target/trx_toolkit/_fake_trx.pyx
3 files changed, 4 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/63/40063/1
diff --git a/src/target/trx_toolkit/_clck_gen.pxd b/src/target/trx_toolkit/_clck_gen.pxd
index f4de595..447d0be 100644
--- a/src/target/trx_toolkit/_clck_gen.pxd
+++ b/src/target/trx_toolkit/_clck_gen.pxd
@@ -19,4 +19,5 @@
cdef int _t_tick
+ cdef _tick(self)
cdef send_clck_ind(self)
diff --git a/src/target/trx_toolkit/_clck_gen.pyx b/src/target/trx_toolkit/_clck_gen.pyx
index e63eacb..3a6bfc7 100644
--- a/src/target/trx_toolkit/_clck_gen.pyx
+++ b/src/target/trx_toolkit/_clck_gen.pyx
@@ -88,6 +88,8 @@
# - client code can also poll/select on ._timerfd to wait for GSM frame.
# After ._timerfd becomes ready it is guaranteed that the next .tick call will not
block.
def tick(self):
+ self._tick()
+ cdef _tick(self):
# run .send_clck_ind() every .ctr_interval
# NOTE timerfd is careful not to accumulate timing error when organizing the clock
loop
diff --git a/src/target/trx_toolkit/_fake_trx.pyx b/src/target/trx_toolkit/_fake_trx.pyx
index 8803b24..f4cf7f6 100644
--- a/src/target/trx_toolkit/_fake_trx.pyx
+++ b/src/target/trx_toolkit/_fake_trx.pyx
@@ -408,7 +408,7 @@
# clock is priority
if self.clck_gen._timerfd in r_event:
- self.clck_gen.tick()
+ self.clck_gen._tick()
# Iterate over all transceivers
for trx in self.trx_list:
--
To view, visit
https://gerrit.osmocom.org/c/osmocom-bb/+/40063?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: I19a7a90cd420b481c555f37f3fb7f2ebb513d6e8
Gerrit-Change-Number: 40063
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>