Constant output in syslog of EDAC message
Subsystems (10)
Hi,
I am seeing the constant output of the following messages in syslog, wondering what I can do to resolve this:
Oct 19 13:19:30 hostname kernel: EDAC DEBUG: ie31200_check: MC0
It outputs about once every second.
uname -a
Linux hostname 5.9.0-991.native #1 SMP Mon Oct 12 08:10:54 PDT 2020 x86_64 GNU/Linux
/proc/cpuinfo
processor : 7vendor_id : GenuineIntel
cpu family : 6
model : 158
model name : Intel(R) Xeon(R) CPU E3-1505M v6 @ 3.00GHz stepping : 9
microcode : 0xd6
Borislav Petkov
maintainerQuoted 6 lines · Raymond Bennett
Hi,
I am seeing the constant output of the following messages in syslog, wondering what I can do to resolve this:
Oct 19 13:19:30 hostname kernel: EDAC DEBUG: ie31200_check: MC0
Looks like a debugging leftover. I'll remove it soon unless Jason (CCed) screams.
Leaving in the rest for him.
Quoted 14 lines
It outputs about once every second.
uname -a
Linux hostname 5.9.0-991.native #1 SMP Mon Oct 12 08:10:54 PDT 2020x86_64GNU/Linux
/proc/cpuinfo
processor : 7vendor_id: GenuineIntel
cpu family : 6
model : 158
model name : Intel(R) Xeon(R) CPU E3-1505M v6 @ 3.00GHz stepping : 9
microcode :0xd6
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteJason Baron
maintainerQuoted 11 lines · Borislav Petkov
Quoted 6 lines · Raymond Bennett
Hi,
I am seeing the constant output of the following messages in syslog, wondering what I can do to resolve this:
Oct 19 13:19:30 hostname kernel: EDAC DEBUG: ie31200_check: MC0Looks like a debugging leftover. I'll remove it soon unless Jason (CCed) screams.
Leaving in the rest for him.
Hi,
Yes, I likely was just following what was in other edac drivers at
the time - for example, i3200_check() has a similar debug. I guess
it could have a higher level. But if we remove this one, we may
want to audit some of the other edac drivers as well.
Thanks,
-Jason
Quoted 15 lines
Quoted 15 lines
It outputs about once every second.
uname -a
Linux hostname 5.9.0-991.native #1 SMP Mon Oct 12 08:10:54 PDT 2020x86_64GNU/Linux
/proc/cpuinfo
processor : 7vendor_id: GenuineIntel
cpu family : 6
model : 158
model name : Intel(R) Xeon(R) CPU E3-1505M v6 @ 3.00GHz stepping : 9
microcode :0xd6
Borislav Petkov
maintainerQuoted 4 lines · Jason Baron
Yes, I likely was just following what was in other edac drivers at the time - for example,
i3200_check()has a similar debug. I guess it could have a higher level. But if we remove this one, we may want to audit some of the other edac drivers as well.
Sounds good. So one patch removing them all would make sense. If you feel like doing it, be my guest. Otherwise, it'll land on my ever-growing todo. :-\
Thx.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteBorislav Petkov
maintainerPATCH 1/1 EDAC: Do not issue useless debug statements in the polling routine
From: Borislav Petkov <[email protected]>
They have been spreading around the subsystem by example so remove them all.
--- drivers/edac/amd76x_edac.c | 1 - drivers/edac/e752x_edac.c | 1 - drivers/edac/e7xxx_edac.c | 1 - drivers/edac/i3000_edac.c | 1 - drivers/edac/i3200_edac.c | 1 - drivers/edac/i5000_edac.c | 2 +- drivers/edac/i5400_edac.c | 2 +- drivers/edac/i82443bxgx_edac.c | 1 - drivers/edac/i82860_edac.c | 1 - drivers/edac/i82875p_edac.c | 1 - drivers/edac/i82975x_edac.c | 1 - drivers/edac/ie31200_edac.c | 1 - drivers/edac/r82600_edac.c | 1 - drivers/edac/x38_edac.c | 1 - 14 files changed, 2 insertions(+), 14 deletions(-)
drivers/edac/amd76x_edac.c +0 -1
@@ -179,7 +179,6 @@ static int amd76x_process_error_info(struct mem_ctl_info *mci,static void amd76x_check (struct mem_ctl_info *mci) {struct amd76x_error_info info; -edac_dbg (3 ,"\n" );amd76x_get_error_info (mci, &info);amd76x_process_error_info (mci, &info,1 ); }
drivers/edac/e752x_edac.c +0 -1
@@ -980,7 +980,6 @@ static void e752x_check(struct mem_ctl_info *mci) {struct e752x_error_info info; -edac_dbg (3 ,"\n" );e752x_get_error_info (mci, &info);e752x_process_error_info (mci, &info,1 ); }
drivers/edac/e7xxx_edac.c +0 -1
@@ -333,7 +333,6 @@ static void e7xxx_check(struct mem_ctl_info *mci) {struct e7xxx_error_info info; -edac_dbg (3 ,"\n" );e7xxx_get_error_info (mci, &info);e7xxx_process_error_info (mci, &info,1 ); }
drivers/edac/i3000_edac.c +0 -1
@@ -273,7 +273,6 @@ static void i3000_check(struct mem_ctl_info *mci) {struct i3000_error_info info; -edac_dbg (1 ,"MC%d\n" , mci->mc_idx);i3000_get_error_info (mci, &info);i3000_process_error_info (mci, &info,1 ); }
drivers/edac/i3200_edac.c +0 -1
@@ -253,7 +253,6 @@ static void i3200_check(struct mem_ctl_info *mci) {struct i3200_error_info info; -edac_dbg (1 ,"MC%d\n" , mci->mc_idx);i3200_get_and_clear_error_info (mci, &info);i3200_process_error_info (mci, &info); }
drivers/edac/i5000_edac.c +1 -1
@@ -765,7 +765,7 @@ static void i5000_clear_error(struct mem_ctl_info *mci)static void i5000_check_error (struct mem_ctl_info *mci) {struct i5000_error_info info; -edac_dbg (4 ,"MC%d\n" , mci->mc_idx); +i5000_get_error_info (mci, &info);i5000_process_error_info (mci, &info,1 ); }
drivers/edac/i5400_edac.c +1 -1
@@ -686,7 +686,7 @@ static void i5400_clear_error(struct mem_ctl_info *mci)static void i5400_check_error (struct mem_ctl_info *mci) {struct i5400_error_info info; -edac_dbg (4 ,"MC%d\n" , mci->mc_idx); +i5400_get_error_info (mci, &info);i5400_process_error_info (mci, &info); }
drivers/edac/i82443bxgx_edac.c +0 -1
@@ -176,7 +176,6 @@ static void i82443bxgx_edacmc_check(struct mem_ctl_info *mci) {struct i82443bxgx_edacmc_error_info info; -edac_dbg (1 ,"MC%d\n" , mci->mc_idx);i82443bxgx_edacmc_get_error_info (mci, &info);i82443bxgx_edacmc_process_error_info (mci, &info,1 ); }
drivers/edac/i82860_edac.c +0 -1
@@ -135,7 +135,6 @@ static void i82860_check(struct mem_ctl_info *mci) {struct i82860_error_info info; -edac_dbg (1 ,"MC%d\n" , mci->mc_idx);i82860_get_error_info (mci, &info);i82860_process_error_info (mci, &info,1 ); }
drivers/edac/i82875p_edac.c +0 -1
@@ -262,7 +262,6 @@ static void i82875p_check(struct mem_ctl_info *mci) {struct i82875p_error_info info; -edac_dbg (1 ,"MC%d\n" , mci->mc_idx);i82875p_get_error_info (mci, &info);i82875p_process_error_info (mci, &info,1 ); }
drivers/edac/i82975x_edac.c +0 -1
@@ -330,7 +330,6 @@ static void i82975x_check(struct mem_ctl_info *mci) {struct i82975x_error_info info; -edac_dbg (1 ,"MC%d\n" , mci->mc_idx);i82975x_get_error_info (mci, &info);i82975x_process_error_info (mci, &info,1 ); }
drivers/edac/ie31200_edac.c +0 -1
@@ -333,7 +333,6 @@ static void ie31200_check(struct mem_ctl_info *mci) {struct ie31200_error_info info; -edac_dbg (1 ,"MC%d\n" , mci->mc_idx);ie31200_get_and_clear_error_info (mci, &info);ie31200_process_error_info (mci, &info); }
drivers/edac/r82600_edac.c +0 -1
@@ -204,7 +204,6 @@ static void r82600_check(struct mem_ctl_info *mci) {struct r82600_error_info info; -edac_dbg (1 ,"MC%d\n" , mci->mc_idx);r82600_get_error_info (mci, &info);r82600_process_error_info (mci, &info,1 ); }
drivers/edac/x38_edac.c +0 -1
@@ -238,7 +238,6 @@ static void x38_check(struct mem_ctl_info *mci) {struct x38_error_info info; -edac_dbg (1 ,"MC%d\n" , mci->mc_idx);x38_get_and_clear_error_info (mci, &info);x38_process_error_info (mci, &info); }
Signature · 8 lines
2.21.0
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteJason Baron
maintainerQuoted 6 lines · Borislav Petkov
Quoted 4 lines · Jason Baron
Yes, I likely was just following what was in other edac drivers at the time - for example,
i3200_check()has a similar debug. I guess it could have a higher level. But if we remove this one, we may want to audit some of the other edac drivers as well.
Quoted 6 lines
Sounds good. So one patch removing them all would make sense. If you feel like doing it, be my guest. Otherwise, it'll land on my ever-growing todo. :-\
Thx.
Hi Boris,
I thought a bit about this - and was wondering if it made sense to hook the edac debug messages up to 'dynamic debug'. The idea is that different users may want different debug messages enabled, and this way they can control each message as desired. Jim (added to 'cc) recently exported 'ddebug_exec_queries()' to make that easier to do:
https://lore.kernel.org/lkml/[email protected]/
So, we would still continue to support edac_debug_level=N but the user would have additional control. I tried it out (below) and doesn't look too bad (at least to me).
Thanks,
-Jason
drivers/edac/Kconfig +1 -0
@@ -34,6 +34,7 @@ config EDAC_LEGACY_SYSFS config EDAC_DEBUG bool "Debugging" select DEBUG_FS + select DYNAMIC_DEBUG_CORE help This turns on debugging information for the entire EDAC subsystem. You do so by inserting edac_module with "edac_debug_level=x." Valid
drivers/edac/Makefile +4 -0
@@ -8,6 +8,10 @@ obj-$(CONFIG_EDAC) := edac_core.o +ifdef CONFIG_EDAC_DEBUG +ccflags-y += -DDYNAMIC_DEBUG_MODULE +endif + edac_core-y := edac_mc.o edac_device.o edac_mc_sysfs.o edac_core-y += edac_module.o edac_device_sysfs.o wq.o
drivers/edac/edac_mc.h +6 -5
@@ -48,6 +48,9 @@ #define edac_printk(level, prefix, fmt, arg...) \ printk(level "EDAC " prefix ": " fmt, ##arg) +#define edac_dbg_printk(level, prefix, fmt, arg...) \ + pr_debug("EDAC " prefix #level ": " fmt, ##arg) + #define edac_mc_printk(mci, level, fmt, arg...) \ printk(level "EDAC MC%d: " fmt, mci->mc_idx, ##arg)
@@ -70,11 +73,9 @@ extern const char * const edac_mem_types[];#ifdef CONFIG_EDAC_DEBUG extern int edac_debug_level; -#define edac_dbg (level, fmt, ...) \ -do { \ - if (level <= edac_debug_level) \ - edac_printk(KERN_DEBUG, EDAC_DEBUG, \ - "%s: " fmt, __func__, ##__VA_ARGS__); \ +#define edac_dbg (level, fmt, ...) \ +do { \ + edac_dbg_printk(level, EDAC_DEBUG, "%s: " fmt, __func__, ##__VA_ARGS__);\ } while (0)#else /* !CONFIG_EDAC_DEBUG */
drivers/edac/edac_module.c +28 -4
@@ -11,6 +11,7 @@* */ #include <linux/edac.h> +#include <linux/dynamic_debug.h> #include "edac_mc.h" #include "edac_module.h"
@@ -19,6 +20,29 @@#ifdef CONFIG_EDAC_DEBUG +static int edac_debug_level_initialized; +/* Values of 0 to 4 will generate output */ +int edac_debug_level =2 ; +EXPORT_SYMBOL_GPL (edac_debug_level); + +static void edac_set_dynamic_debug_level (int level) +{ +char buf[32 ]; +int i; + + edac_debug_level_initialized =1 ; +for (i =0 ; i <=4 ; i++) { +snprintf (buf,32 ,"format '^EDAC DEBUG%d' %cp" , i, i <= level ?'+' :'-' ); +dynamic_debug_exec_queries (buf,NULL ); + } +} + +static void edac_set_debug_level_init (void ) +{ +if (!edac_debug_level_initialized) +edac_set_dynamic_debug_level (edac_debug_level); +} +static int edac_set_debug_level (const char *buf,const struct kernel_param *kp) {
@@ -32,13 +56,11 @@ static int edac_set_debug_level(const char *buf,if (val >4 )return -EINVAL ; +edac_set_dynamic_debug_level (val); +return param_set_int (buf, kp); } -/* Values of 0 to 4 will generate output */ -int edac_debug_level =2 ; -EXPORT_SYMBOL_GPL (edac_debug_level); -module_param_call (edac_debug_level, edac_set_debug_level, param_get_int, &edac_debug_level,0644 );MODULE_PARM_DESC (edac_debug_level,"EDAC debug level: [0-4], default: 2" );
@@ -130,6 +152,8 @@ static int __init edac_init(void) goto err_wq; } +edac_set_debug_level_init (); +return 0 ; err_wq:
drivers/edac/edac_module.h +1 -0
@@ -99,6 +99,7 @@ static inline void edac_debugfs_create_x16(const char *name, umode_t mode, struct dentry *parent, u16 *value) { }static inline void edac_debugfs_create_x32 (const char *name,umode_t mode,struct dentry *parent,u32 *value) { } +static inline void edac_set_debug_level_init (void ) { }#endif /*
Borislav Petkov
maintainerHi,
Quoted 2 lines · Jason Baron
So, we would still continue to support edac_debug_level=N but the user would have additional control.
Do you have any actual users needing this? If yes, what are their use cases?
Because I have this aversion towards adding functionality just because and that it potentially might be useful and "users may want". Either they do and they want to use it for X or we don't do anything... yet.
In this particular example, those debug printks are just useless noise so off they go.
Thx.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteJason Baron
maintainerQuoted 9 lines · Borislav Petkov
Hi,
Quoted 2 lines · Jason Baron
So, we would still continue to support edac_debug_level=N but the user would have additional control.
Do you have any actual users needing this? If yes, what are their use cases?
Quoted 9 lines
Because I have this aversion towards adding functionality just because and that it potentially might be useful and "users may want". Either they do and they want to use it for X or we don't do anything... yet.
In this particular example, those debug printks are just useless noise so off they go.
Thx.
Hi Boris,
So I was motivated by this example, where if we had this facility, we could easily say just go turn off that specific print instead of wait for a new kernel. More generally, I think as you crank up the verbosity there may be more of a need to customize the debug information, but I don't have any specific use case in mind beyond that.
I was also curious if various subsystems would find this facility useful.
Thanks,
-Jason