IB/mthca: Always build debugging code unless CONFIG_EMBEDDED=y
Change the mthca debugging trace output code so that it can enabled and disabled at runtime with the debug_level module parameter in sysfs. Also, don't allow CONFIG_INFINIBAND_MTHCA_DEBUG to be disabled unless CONFIG_EMBEDDED is selected. We want users (and especially distros) to have this turned on unless they really need to save space, because by the time we want debugging output, it's usually too late to rebuild a kernel. Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
@ -355,8 +355,21 @@ struct mthca_dev {
|
||||
spinlock_t sm_lock;
|
||||
};
|
||||
|
||||
#define mthca_dbg(mdev, format, arg...) \
|
||||
dev_dbg(&mdev->pdev->dev, format, ## arg)
|
||||
#ifdef CONFIG_INFINIBAND_MTHCA_DEBUG
|
||||
extern int mthca_debug_level;
|
||||
|
||||
#define mthca_dbg(mdev, format, arg...) \
|
||||
do { \
|
||||
if (mthca_debug_level) \
|
||||
dev_printk(KERN_DEBUG, &mdev->pdev->dev, format, ## arg); \
|
||||
} while (0)
|
||||
|
||||
#else /* CONFIG_INFINIBAND_MTHCA_DEBUG */
|
||||
|
||||
#define mthca_dbg(mdev, format, arg...) do { (void) mdev; } while (0)
|
||||
|
||||
#endif /* CONFIG_INFINIBAND_MTHCA_DEBUG */
|
||||
|
||||
#define mthca_err(mdev, format, arg...) \
|
||||
dev_err(&mdev->pdev->dev, format, ## arg)
|
||||
#define mthca_info(mdev, format, arg...) \
|
||||
|
Reference in New Issue
Block a user