aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac
diff options
context:
space:
mode:
authorHitoshi Mitake <h.mitake@gmail.com>2009-04-02 19:58:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-02 22:05:02 -0400
commitcc18e3cd5345715544e4d61b32a7442360817195 (patch)
treed578a9a09eb1a1e0f603505838c9d3aa94f7a235 /drivers/edac
parent15746fcaa3a00753bbab2326088b85b10c1ba36a (diff)
edac: add more verbose debug info
A patch for making a debugging information more verbose for use in development debugging. By enabling the new option "More verbose debugging", information about source file and line number will be added to debugging message. This is sample output, EDAC MC0: Giving out device to 'e7xxx_edac' 'E7205': DEV 0000:00:00.0 EDAC DEBUG: in drivers/edac/edac_pci.c, line at 48: edac_pci_alloc_ctl_info() EDAC DEBUG: in drivers/edac/edac_pci.c, line at 334: edac_pci_add_device() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Signed-off-by: Hitoshi Mitake <h.mitake@gmail.com> Signed-off-by: Doug Thompson <dougthompson@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/edac')
-rw-r--r--drivers/edac/Kconfig8
-rw-r--r--drivers/edac/edac_core.h15
2 files changed, 22 insertions, 1 deletions
diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig
index eee47fd16d79..56021f64ee22 100644
--- a/drivers/edac/Kconfig
+++ b/drivers/edac/Kconfig
@@ -40,6 +40,14 @@ config EDAC_DEBUG
40 there're four debug levels (x=0,1,2,3 from low to high). 40 there're four debug levels (x=0,1,2,3 from low to high).
41 Usually you should select 'N'. 41 Usually you should select 'N'.
42 42
43config EDAC_DEBUG_VERBOSE
44 bool "More verbose debugging"
45 depends on EDAC_DEBUG
46 help
47 This option makes debugging information more verbose.
48 Source file name and line number where debugging message
49 printed will be added to debugging message.
50
43config EDAC_MM_EDAC 51config EDAC_MM_EDAC
44 tristate "Main Memory EDAC (Error Detection And Correction) reporting" 52 tristate "Main Memory EDAC (Error Detection And Correction) reporting"
45 default y 53 default y
diff --git a/drivers/edac/edac_core.h b/drivers/edac/edac_core.h
index 4b55ec607a88..3189c76fe62e 100644
--- a/drivers/edac/edac_core.h
+++ b/drivers/edac/edac_core.h
@@ -49,6 +49,10 @@
49#define edac_printk(level, prefix, fmt, arg...) \ 49#define edac_printk(level, prefix, fmt, arg...) \
50 printk(level "EDAC " prefix ": " fmt, ##arg) 50 printk(level "EDAC " prefix ": " fmt, ##arg)
51 51
52#define edac_printk_verbose(level, prefix, fmt, arg...) \
53 printk(level "EDAC " prefix ": " "in %s, line at %d: " fmt, \
54 __FILE__, __LINE__, ##arg)
55
52#define edac_mc_printk(mci, level, fmt, arg...) \ 56#define edac_mc_printk(mci, level, fmt, arg...) \
53 printk(level "EDAC MC%d: " fmt, mci->mc_idx, ##arg) 57 printk(level "EDAC MC%d: " fmt, mci->mc_idx, ##arg)
54 58
@@ -71,11 +75,20 @@
71#ifdef CONFIG_EDAC_DEBUG 75#ifdef CONFIG_EDAC_DEBUG
72extern int edac_debug_level; 76extern int edac_debug_level;
73 77
78#ifndef CONFIG_EDAC_DEBUG_VERBOSE
74#define edac_debug_printk(level, fmt, arg...) \ 79#define edac_debug_printk(level, fmt, arg...) \
75 do { \ 80 do { \
76 if (level <= edac_debug_level) \ 81 if (level <= edac_debug_level) \
77 edac_printk(KERN_DEBUG, EDAC_DEBUG, fmt, ##arg); \ 82 edac_printk(KERN_DEBUG, EDAC_DEBUG, fmt, ##arg); \
78 } while(0) 83 } while (0)
84#else /* CONFIG_EDAC_DEBUG_VERBOSE */
85#define edac_debug_printk(level, fmt, arg...) \
86 do { \
87 if (level <= edac_debug_level) \
88 edac_printk_verbose(KERN_DEBUG, EDAC_DEBUG, fmt, \
89 ##arg); \
90 } while (0)
91#endif
79 92
80#define debugf0( ... ) edac_debug_printk(0, __VA_ARGS__ ) 93#define debugf0( ... ) edac_debug_printk(0, __VA_ARGS__ )
81#define debugf1( ... ) edac_debug_printk(1, __VA_ARGS__ ) 94#define debugf1( ... ) edac_debug_printk(1, __VA_ARGS__ )