-
Notifications
You must be signed in to change notification settings - Fork 61
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
Reduce logging of wmi_*_fancurve_custom #276
Comments
Thanks for this report. This crazy logging got into main by accident. Try the new version on main branch, where it now should log to "debug" level. Currently, this is needed for debugging but will later be completely removed. Do you see any other problems? |
Thank you. After building that I can confirm the level changed - journalctl prints the messages in a darker grey - but the messages still were printed to the journal, and dynamic debug was not able to see them. If I apply the following patch then the For now, I now know how to suppress logging better via patches and recompiling, but I would still like to request less debug logging when possible, maybe a module option :). New messages:
Patch: diff --git a/kernel_module/legion-laptop.c b/kernel_module/legion-laptop.c
index 227588e..3094f7f 100644
--- a/kernel_module/legion-laptop.c
+++ b/kernel_module/legion-laptop.c
@@ -2878,7 +2878,7 @@ static ssize_t wmi_read_fancurve_custom(const struct model_config *model,
err = wmi_exec_noarg_ints(WMI_GUID_LENOVO_FAN_METHOD, 0,
WMI_METHOD_ID_FAN_GET_TABLE, buffer,
sizeof(buffer));
- print_hex_dump(KERN_DEBUG, "legion_laptop fan table wmi buffer",
+ print_hex_dump_debug("legion_laptop fan table wmi buffer",
DUMP_PREFIX_ADDRESS, 16, 1, buffer, sizeof(buffer),
true);
if (!err) {
@@ -2936,7 +2936,7 @@ static ssize_t wmi_write_fancurve_custom(const struct model_config *model,
buffer[0x16] = fancurve->points[8].speed1;
buffer[0x18] = fancurve->points[9].speed1;
- print_hex_dump(KERN_DEBUG, "legion_laptop fan table wmi write buffer",
+ print_hex_dump_debug("legion_laptop fan table wmi write buffer",
DUMP_PREFIX_ADDRESS, 16, 1, buffer, sizeof(buffer),
true);
err = wmi_exec_arg(WMI_GUID_LENOVO_FAN_METHOD, 0, And for my reference, dynamic debug can control the messages when the module is loaded and this has output: # grep legion /sys/kernel/debug/dynamic_debug/control
/var/lib/dkms/lenovolegionlinux/1.0.0/build/legion-laptop.c:2881 [legion_laptop]wmi_read_fancurve_custom =_ "legion_laptop fan table wmi buffer"
/var/lib/dkms/lenovolegionlinux/1.0.0/build/legion-laptop.c:2939 [legion_laptop]wmi_write_fancurve_custom =_ "legion_laptop fan table wmi write buffer" And control looks like this, to enable: echo -n "module legion_laptop +p" > /sys/kernel/debug/dynamic_debug/control or disable: echo -n "module legion_laptop -p" > /sys/kernel/debug/dynamic_debug/control |
Is your feature request related to a problem? Please describe.
My log files are huge. Please help reduce. 36,000 messages in an hour:
# journalctl -b0 -S "1 hour ago" | grep -c "legion_laptop fan table wmi" 36012
mostly of the form:
Which, as a user who hasn't even seen a need to customize fan curves, I cannot see the use of.
I'm not actually sure what's causing it, as the printing doesn't seem to be related to reading the sensors with
sensors
ortelegraf
.Describe the solution you'd like
LenovoLegionLinux/kernel_module/legion-laptop.c
Lines 2877 to 2883 in 2912438
Consider commenting it out, or making it (logging) configurable with a module option, or using
print_hex_dump_debug()
instead (then I'd probably be able to filter it out with dynamic debugging). Line 2939 as well.Describe alternatives you've considered
print_hex_dump()
Model and Debug Info
Distribution: Arch, using lenovolegionlinux-dkms-git r834.714cd25-1 and lenovolegionlinux-git r832.680ed61-1 from AUR.
Model name: Legion Pro 5 16ARX8
CPU model:AMD Ryzen 9 7945HX
GPU model: GeForce RTX 4070 Max-Q
Keyboard backlight: Off/don't care
Light in lid or logo: ???
Light at IO-Ports at back: ???
Output of
sudo dmidecode -t system
. Please remove Serial Number and UUID for privacy:Output of
sudo dmidecode -t bios
:Output of
sudo cat /sys/kernel/debug/legion/fancurve
:The text was updated successfully, but these errors were encountered: