diff options
author | Roland Dreier <rolandd@cisco.com> | 2006-04-02 17:39:20 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-04-02 17:39:20 -0400 |
commit | 227c939b00cf786b5e2e95fc904518206f478421 (patch) | |
tree | f62cd8a2f0663d3c9853eead57ba91dd9626a572 /drivers/infiniband/hw/mthca/mthca_dev.h | |
parent | f5545d24b8aa9fccd8071203e83bc9f4b26e17a6 (diff) |
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>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_dev.h')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_dev.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_dev.h b/drivers/infiniband/hw/mthca/mthca_dev.h index ad52edbefe98..bb2a9d628d7d 100644 --- a/drivers/infiniband/hw/mthca/mthca_dev.h +++ b/drivers/infiniband/hw/mthca/mthca_dev.h | |||
@@ -355,8 +355,21 @@ struct mthca_dev { | |||
355 | spinlock_t sm_lock; | 355 | spinlock_t sm_lock; |
356 | }; | 356 | }; |
357 | 357 | ||
358 | #define mthca_dbg(mdev, format, arg...) \ | 358 | #ifdef CONFIG_INFINIBAND_MTHCA_DEBUG |
359 | dev_dbg(&mdev->pdev->dev, format, ## arg) | 359 | extern int mthca_debug_level; |
360 | |||
361 | #define mthca_dbg(mdev, format, arg...) \ | ||
362 | do { \ | ||
363 | if (mthca_debug_level) \ | ||
364 | dev_printk(KERN_DEBUG, &mdev->pdev->dev, format, ## arg); \ | ||
365 | } while (0) | ||
366 | |||
367 | #else /* CONFIG_INFINIBAND_MTHCA_DEBUG */ | ||
368 | |||
369 | #define mthca_dbg(mdev, format, arg...) do { (void) mdev; } while (0) | ||
370 | |||
371 | #endif /* CONFIG_INFINIBAND_MTHCA_DEBUG */ | ||
372 | |||
360 | #define mthca_err(mdev, format, arg...) \ | 373 | #define mthca_err(mdev, format, arg...) \ |
361 | dev_err(&mdev->pdev->dev, format, ## arg) | 374 | dev_err(&mdev->pdev->dev, format, ## arg) |
362 | #define mthca_info(mdev, format, arg...) \ | 375 | #define mthca_info(mdev, format, arg...) \ |