Conversation
Unfortunately, no. The print message/debug interface is an all-or-nothing proposition. For real module/component/level differentiating debug messages we need to build a different interface. Maybe using a "channels" idea to select what kind of debug is enabled. And, IMO, we should be able to switch debug off and not being build/included at all to see what that does in performance (instead of executing the many if(level >...) statements). |
|
You can change the debug level in the HAL file. This is something that I added, and I am not sure how well it works. Prior to adding the HAL command the way to change debug level on the fly was "echo 7 > /proc/rtapi/debug". But that had stopped working by the time I added the HAL command. Possibly it only ever worked in RTAI? |
Like |
|
I just did a bit digging: At least without rtlinux, do_set_debug_cmd() can not work because it is called in the halcmd process and sets the msg_level of this process. So not inside the rtapi_app process where it would have an effect. I hacked something together which seams to work. I will make it nicer and create yet an other PR in a few days. |
|
In uspace, there is a UNIX socket linking the master and slave The slave will send a command down the socket for the RT part to execute (like load an RT component). This command simply seems to be the |
|
Yes, i figured that already out and it is already working well. I just have to remove my debug code and then I will create a PR. |
While working on #3839, I activated debug and found that the output had random newlines.
The reason is that at the end of emcmotCommandHandler_locked(), a newline is printed and not every command had a rtapi_print_msg().
ABORT doesn't use joint_num, so I see no reason to print it.
To test, I added rtapi_set_msg_level(RTAPI_MSG_ALL); in control.c emcmotController(). This is temporary, not in this PR. Is there any other way to activate debug per module?
Alternative: Remove the rtapi_print_msg(RTAPI_MSG_DBG, "\n"); at the end and add a newline to all other rtapi_print_msg(); Advantage: Less issues in the future. Disadvantage: You don't see if someone forgot to add prints and there will be more changed lines.