I have an application running on Torizon OS 6 which implements rpmsg communication between Torizon OS and M7.
The communication itself works, but I noticed some CPU usage from systemd-journald process (~7%).
I run journalctl command to see the logs and I see all the messages received from M7.
I don’t see the messages sent by Torizon OS.
Her is a snippet of the log
I don’t think that these messages should be logged into the journal log. This waste resources and increases eMMC wear.
Is there a way to disable the logging of rpmsg messages?
Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!
Did you like my answer?
Hello,
To address the issue of rpmsg messages being logged into the journal log on Torizon OS, you can take the following steps to disable or control the verbosity of these logs. The messages you’re seeing are kernel log messages, and their logging behavior can be adjusted through the kernel’s dynamic debug feature or by configuring the log level.
Dynamic Debug: Linux kernel’s dynamic debug feature allows you to control how much logging is output by different kernel modules. You can disable logging for the rpmsg module by echoing a command to the dynamic debug control file. For example:
This command disables logging for all files in the drivers/rpmsg directory. Note that the path might vary based on the kernel version and configuration. You might need to adjust the path according to your setup.
Kernel Log Level: You can also control the verbosity of the kernel log messages by setting the log level. The kernel log level can be set at boot time via the kernel command line or at runtime using the dmesg command. To reduce the verbosity to only show warnings and more critical messages, you can do:
At boot time, add loglevel=4 to the kernel command line parameters.
At runtime, execute dmesg -n 4.
This sets the log level to 4, which corresponds to warnings. Messages with a higher log level (numerically lower) will be shown, but debug and informational messages will be suppressed.
Systemd-journald Configuration: While the above methods control the kernel’s logging behavior, systemd-journald also has configurations that can affect logging. You can adjust the SystemMaxUse and RuntimeMaxUse parameters in /etc/systemd/journald.conf to limit the amount of disk and RAM used for logs, respectively. However, this does not directly stop rpmsg messages from being logged but can help manage the resource usage.
Please note, adjusting logging levels and disabling specific logs should be done with caution, as it may hinder your ability to diagnose issues in the future. Always ensure that you have an alternative means of capturing necessary logs, especially when debugging system issues.
Best regards,
Toradex AI Assistant
Please, also check if these links can help you solve your problem:
By default, Torizon OS doesn’t have persistent storage for jounald. After rebooting the module you can see that the messages from the previous boot won’t be there anymore.
Related:
And, of course you can also modify the driver so it will never print any messages. But you might want to keep the messages there for a future debugging case
Hi @henrique.tx
thank you very much for your answer.
I agree that probably the best option is to leverage on Dynamic Debug approach.
I read the documentation you linked and here is what I learned/understood:
/proc/dynamic_debug/control exists, and so kernel of Torizon OS has Dynamic Debug - good
head /proc/dynamic_debug/control shows the currently configured behaviour, and the items I see are all related to net/bluetooth/bnep/core.c
If I would like disabling debug logging for module imx_rpmsg_tty I should run the following command
But nothing changes and I get all the debug messages in journalctl.
From the documentation you linked I read that I can specify the Dynamic Debug while loading the module, and in Torizon OS I load it using /etc/modules-load.d as suggested by @jeremias.txhere.
Should I load it using /etc/modprobe.d so that I can specify more advanced options?
If defined(CONFIG_DYNAMIC_DEBUG) || (defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE)) is true (A), then print_hex_dump_debug will be defined as dynamic_hex_dump, which I guess this is the thing that makes us able to control dynamic debug.
Otherwise (elif), if defined(DEBUG) is true (B), then print_hex_dump_debug will simply be print_hex_dump with KERN_DEBUG.
So, since (A) will be true (and (B) won’t be evaluated), andprint_hex_dump_debug is not used by the this driver, I guess that controlling the log using dynamic debug won’t be possible.
But I think that setting the log level will still have effect:
Be aware that I didn’t tested nor tried anything by myself. While you keep trying on your side, I will try to get someone’s time to review this message
I’ve talked to NXP tech support and they agree that print_hex_dump_debug() should be used inside imx_rpmsg_tty.c instead of print_hex_dump(KERN_DEBUG, ...).
I’ve opened this PR on github but I think that Toradex can patch in this way its own fork of the repo.
Honestly speaking… I haven’t.
Based on my knowledge, build a Yocto recipe is not a task that I feel under muy control.
This is one of the most important reasons why I decided to go with an out-of-the-box OS like Torizon OS.