-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Remove rtapi_get_clocks() #4082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hdiethelm
wants to merge
2
commits into
LinuxCNC:master
Choose a base branch
from
hdiethelm:rtapi_get_clocks_removal_v2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this could be a problem. Or, is nobody using it internally or externally?
Or, if the define HAVE_CPU_KHZ is not generally available, then it it would be a non-consistent pin and can/should be dealt with in some way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HAVE_CPU_KHZ was only defined with RTAI: https://github.com/LinuxCNC/linuxcnc/blob/master/src/emc/motion/mot_priv.h#L352
I removed it all together. I grep'ed the repo for last_period_ns, no hits except the two I removed. If someone uses it with RTAI in his .hal file, he can change to use the pin
last_periodwhich was in clocks and is now in ns.The change from clocks to ns for the .time / .last_period might confuse some users but I somewhat expect that most users expected these signals to be in ns. But they where in tsc clocks before this PR.
Is there any reference in the doc about this .time pin's? I did not find anything the last time I searched it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The (small) catch is that
last-periodis integer andlast-period-nsis floating point.The pins are (wrongly) documented as parameters in docs/src/config/core-components.adoc in line 173-176.
There may be some history here to this pin/param confusion that may need some investigation. Commit 2b22052 in 2017 changed both from params to pins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah of course, i grepped for
last_periodinstead oflast-period. There are only occurrences in the doc's, nowhere in code or hal files. I fixed the doc for this pin.However, I am completely new to adoc / po translations. Is there any way to update the .po files in an automated way?
Thanks for the link. I did not even know hal-histogram exists. This commit was mainly about converting motion.servo.last-period from a parameter to a pin. motion.servo.last-period-ns was added but it works only with RTAI. Probably it was added as float, so the division by cpu_khz is straight forward. The other time pins are in s32.
I tested
hal-histogram motion.servo.last-periodwhich works. However, hal-histogram is quite slow in updating and doesn't scale nicely. Just to test, I changed the pin to float, same issue.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the right config, it works fine:

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Translations are done in weblate and they are synced once in a while. Just write text in English in the source adoc and they will be marked in weblate that they need attention for translation.
The slowness of the histogram is how data is taken out of RT into non-RT. It sets an index to read the +/- binnumber[index] and that takes at least 1 thread cycle per bin. So, for +/- 200 bins it takes 0.2 seconds (on a 1kHz thread), just to get the data out (and it is race-tainted data). Actually, the delay is set default at 10 ms and then takes 2 seconds to get the data out.
There is work in progress to fix these histogram programs (none of them work on systems with Tcl9).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so it should be fine then. Just some help needed from others for testing.
@grandixximo fixed already the latency-histogram as I remember. It works perfectly now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only fixed the UI, @BsAtHome actually did the rework on the Hal component, credit goes to him for the response improvement 😁