Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!
Did you like my answer?
Hello Arthur,
Thank you for reaching out with your question about enabling logs in your kernel driver. It sounds like you’re on the right track with using printk
for logging. Here are some steps to help ensure your logging works as expected:
-
Correct Use of
printk
:- Ensure your
printk
statements are correctly formatted, such asprintk(KERN_INFO "Your message here\n");
. TheKERN_INFO
level is suitable for informational messages.
- Ensure your
-
Dynamic Debug Configuration:
- You’ve correctly enabled dynamic debug for your module. Make sure the command
echo "module panel-sitronix-st7701 +p" > /sys/kernel/debug/dynamic_debug/control
is executed after the module is loaded. - Verify that
CONFIG_DYNAMIC_DEBUG=y
is set in your kernel configuration.
- You’ve correctly enabled dynamic debug for your module. Make sure the command
-
Kernel Boot Parameters:
- Check that your kernel boot parameters do not suppress log levels. The
loglevel
parameter should be set to includeKERN_INFO
(e.g.,loglevel=7
).
- Check that your kernel boot parameters do not suppress log levels. The
-
Review
dmesg
Settings:- Ensure
dmesg
is configured to display the log level you are using. You can adjust thedmesg
log level withdmesg -n 7
to show all messages.
- Ensure
-
Troubleshooting Tips:
- If logs are still not visible, try using
KERN_DEBUG
instead ofKERN_INFO
for more verbosity. - Confirm that your changes to the driver file are compiled and loaded correctly. Adding a simple
printk
at the start of the driver’s initialization function can help verify that your changes are active. - Reboot the system after making changes to ensure all configurations are applied.
- If logs are still not visible, try using
By following these steps, you should be able to see the logs from your driver in dmesg
. If issues persist, double-check your kernel configuration and ensure the module is correctly loaded with the updated code.
Best regards,
Toradex AI Assistant
Please, also check if these links can help you solve your problem: