WIP: Propper and save evaluation of realtime capability#4132
Conversation
|
I do think it to be very problematic that getting the RT status is so involved. There should be a simple test that does not involve instantiating larger parts of infrastructure. |
|
:-D The CI has no realtime: It is somewhat a chicken and egg problem. Not involving the RT infrastructure needs separate code and this can always not be in sync with RT. Involving RT runs a lot of stuff. Let's think about this. Exactly the issue here: #4129 What do you think about a parameter / pin? So you can use getp / gets to ask for realtime? Or I could add a new command path to halcmd / rtapi_app that does not start the hal if it is not yet running. |
|
Running non-RT is not an error per se (see CI). Therefore, you cannot and must not "simply" or "blindly" force one or the other. There are use-cases where you want to know the RT status and that does not always mean that you will or will not be running either. Finding out what the RT status is or will be must be lightweight and may be different from where you ask. Doing it in a component or from the cmd-line may be different, depending how you ask and with what intention you ask. |
f1d22a7 to
97bb377
Compare
|
Both CI failures are small:
Two runtime things I noticed while reading:
Minor: |
b73daaf to
5dfd303
Compare
|
Thanks. Fixed. One quirk: RTAI in userspace is called LXRT. I should rename this consistently. |
7f6e60d to
fbf2b81
Compare
|
Hmm, time for a break, to many force pushes, sorry. I will continue tomorrow. So you are OK with the general concept? Then I will polish it up, update the doc and do some more testing in different combinations. Open:
Deferred:
|
|
The CI fixes and the LXRT / fallback handling look good now. On naming, with @BsAtHome's #4099 in mind: For the two open how-tos:
|
Well, I don't own it. However, I agree with the argument to leave the get/set moniker to the hal pin/param data access. |
|
The last few commits are still figuring out ways to solve all issues, not ready for code style review yet. @grandixximo Thanks a lot for the hints. Helps a lot not to have to search everything.
|
6477a97 to
af73e08
Compare
|
And of course, after debian package install, the realtime script is not any more in path. And there was also no define for the path where it is. af73e08 adds one. For scripts, |
|
Due to error handling is annoying not knowing when rtapi_app is running or not: It now works exactly the same as RTAI. And it generated a new ToDo: Cleanup the realtime script. It is a mess. There are a lot of RTAI only parts executed in uspace mode. Like loading an empty list of modules and so on. So far, I just added the things I needed. |
|
Two notes after the latest push. Naming: you're right, I'll withdraw my concern. CI / auto-start: the two failures ( Separately: is dropping the auto-start actually needed for the RT-status goal, or is it a cleanup that could be its own PR? Keeping them decoupled would let the getrt/ |
|
If these test fails due to a missing realtime start, they most probably fail also with RTAI, i have to test it. It is not needed in this PR. However, as soon you like to use I will move it in a separate PR as initialy planned, this one gets already big. |
|
^Rebased to master / removed rtapi_app: start command / do not autostart This commit lives on a new branch to create a PR later: https://github.com/hdiethelm/linuxcnc-fork/tree/rtapi_no_autostart I will wait with this until the PR at hand is merged. There are some conflicts if I rebase rtapi_no_autostart to main. |
|
So, it is slowly taking shape but still not final. I updated the doc and cleaned up some parts. Some things I am considering:
Before merge: The history is a mess. Should I squash it to a single commit or more? The commits could be:
|
|
Please squash 😁 3 commits is clean |
This helps to check if hal functions can be used or if a component needs to be created first.
…_app Python is_rt / is_sim now use "realtime verify" which uses "rtapi_app check_rt" in uspace / returns true in rtai. If realtime not running: rtapi_app performs the checks an returns the state If realtime running: rtapi_app calls master to perform the check and returns the state
The same checks are performed always the same now. If something is not properly checked, makeApp() fill fail instead of just chosing a different RT implementation by itsself. New function: rtapi_realtime_type_t rtapi_get_realtime_type(void)
rtapi_is_realtime() was always unrelaiable. hal_get_realtime_type() returns now the true running realtime type trought the HAL for user and realtime components. This function is also exposed trought python hal.
|
So, squashed and cleanup. New:
ToDo:
I will look into this. Is there a script to do this? |
|
No dedicated rebase script, it's manual. Run |
…istic Query realtime status with 'realtime verify' (from LinuxCNC#4132) rather than probing the setuid bit. latency-histogram asks the realtime layer directly; latency-test relies on the existing "POSIX non-realtime" note.
…istic Query realtime status with 'realtime verify' (from LinuxCNC#4132) rather than probing the setuid bit. latency-histogram asks the realtime layer directly; latency-test relies on the existing "POSIX non-realtime" note.
Intended to be used with:
#4107
Will fix is_sim / is_rt which is broken: #4129
Two new functionality's for two use-cases:
realtime statuscan be used to check if realtime is running.The realtime script is extended with the
verifycommand returning 0 if RT capable, 1 if not.It is intended to use when not running and running.
rtapi_app getrtand returns the stateThere is the new function
hal_get_realtime_type()returning the type of the actually running realtime system trough the hal.is_sim / is_rt use
realtime verifyat init.rtapi_is_realtime()is deprecated: It works only in real time context since #3964 and was never 100% reliable, also according to the doc.