see https://gitlab.eurecom.fr/oai/openairinterface5g/issues/227
When the UE connects to the eNodeB and receives its IP address from the
network, it calls system() to set it in the linux kernel world. This call
is not done in a realtime thread, but in the NAS, which uses its own thread,
independent of the realtime processing.
In some situations this totally disrupts realtime processing.
It is difficult to know precisely why that happens, but it seems that calling
fork(), as system() does, in a multi-threaded program is not a good idea. (So
say several people on the internet.) It is not clear why the softmodem is
impacted, but it seems that fork() is really what triggers the disruption.
Several tests lead to that conclusion.
To fix the problem, we create a child background process very early in main()
(before anything else basically). Then instead of calling system(), the main
process sends the string to the background process. The background process
gets the string, passes it to system() and reports the success/failure back
to the main process.
This solution involves a lot of system calls, but calling system() in the
first place is not cheap either. As long as no realtime thread uses this
mechanism, things should be fine. Time will tell.
Prior to this commit, the following command failed to build dlsim:
./build_oai --phy_simulators -c
Choice has been made to define it in a .h file as a static inline
function.
We now have 4 versions of T_HEADER:
- bad quality C++ version with time
- good quality C version with time
- bad quality C++ version without time
- good quality C version without time
Normally it is used to display throughput.
The computation it does is to sum up the wanted value for the last
second (1000 TTIs) and send this value to the views associated to
this logger, at each TTI.
- change paint function:
when the XY plot is resized we scale. Previously
the last range was put in the middle of the new range
(say when we increase the size).
We may get aspect ratio changes if the resize is not identical
vertically and horizontally, but I think this behaviour is more
'natural'.
- fix a bug:
the last horizontal tick label was printed to far on the right,
out of the bouding box of the XY plot. This is not totally fixed
in the case the label is larger than the XY plot. Now the part
out of the bounding box will be printed on the left. No big deal,
make the plot big enough. (Before, even if big enough you had a
problem.)
- add a new vertical tick display, to be used for throughput mostly.
See in enb.c the difference between 'input signal' and throughput
plots (those throughput plots will come in later commits).
The problem was visible when DL MCS was set to 20
(do a ping -c 192.172.0.1 -i0.2 to get it). The dots
were not plotted at the exact line of the tick mark.
Not sure the fix is always correct.
No big deal anyway.
A new logger is there: the "ticked TTI logger".
Similar to TTI logger (used by the PUCCH1 energy plot)
but takes another input, the "tick" (think subframe)
and a default value for when no event is triggered between
two ticks.
This is used for the UL and DL MCS plots in enb.c (next commit).
When the user clicks on "next UE" or "prev UE" we change the
filters of loggers.
At the same time, the main thread of enb.c processes events
received from the soft-modem and uses the filters, some of them
maybe in the process of being changed.
Changing the filters is not atomic and has to be protected.
Just below the logo you see the current UE, eg. [UE 0],
and near that you have two "buttons" [prev UE] and [next UE].
You click with left button of mouse on those and the various
plots that depend on the UE are now done for the new UE (say UE 1
instead of UE 0 if you click on [next UE]).
The plots are not cleared when you switch.
Let's say it's a feature.