summaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2013-11-08 12:26:26 -0800
committerDan Williams <dan.j.williams@intel.com>2013-11-14 11:04:41 -0800
commit50137a7df982f3767fe0b3b0cd0b9cfaf09c2cd9 (patch)
treee693261dc30f2e053c4fdcc40710c0e4216d4692 /drivers/dma
parent4076e755dbec078c85352a8f77cec4c10181da4e (diff)
downloadblackbird-op-linux-50137a7df982f3767fe0b3b0cd0b9cfaf09c2cd9.tar.gz
blackbird-op-linux-50137a7df982f3767fe0b3b0cd0b9cfaf09c2cd9.zip
dmatest: verbose mode
Verbose mode turns on test success messages, by default we only output test summaries and failure results. Also cleaned up some stray quotes, leftover from putting the result message format string all on one line. Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/dmatest.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index 0d050d2324e3..329b7cf02f8e 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -70,6 +70,10 @@ static bool noverify;
module_param(noverify, bool, S_IRUGO | S_IWUSR);
MODULE_PARM_DESC(noverify, "Disable random data setup and verification");
+static bool verbose;
+module_param(verbose, bool, S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(verbose, "Enable \"success\" result messages (default: off)");
+
/**
* struct dmatest_params - test parameters.
* @buf_size: size of the memcpy test buffer
@@ -336,7 +340,7 @@ static unsigned int min_odd(unsigned int x, unsigned int y)
static void result(const char *err, unsigned int n, unsigned int src_off,
unsigned int dst_off, unsigned int len, unsigned long data)
{
- pr_info("%s: result #%u: '%s' with src_off=0x%x ""dst_off=0x%x len=0x%x (%lu)",
+ pr_info("%s: result #%u: '%s' with src_off=0x%x dst_off=0x%x len=0x%x (%lu)",
current->comm, n, err, src_off, dst_off, len, data);
}
@@ -344,10 +348,17 @@ static void dbg_result(const char *err, unsigned int n, unsigned int src_off,
unsigned int dst_off, unsigned int len,
unsigned long data)
{
- pr_debug("%s: result #%u: '%s' with src_off=0x%x ""dst_off=0x%x len=0x%x (%lu)",
- current->comm, n, err, src_off, dst_off, len, data);
+ pr_debug("%s: result #%u: '%s' with src_off=0x%x dst_off=0x%x len=0x%x (%lu)",
+ current->comm, n, err, src_off, dst_off, len, data);
}
+#define verbose_result(err, n, src_off, dst_off, len, data) ({ \
+ if (verbose) \
+ result(err, n, src_off, dst_off, len, data); \
+ else \
+ dbg_result(err, n, src_off, dst_off, len, data); \
+})
+
static unsigned long long dmatest_persec(s64 runtime, unsigned int val)
{
unsigned long long per_sec = 1000000;
@@ -640,8 +651,8 @@ static int dmatest_func(void *data)
dmaengine_unmap_put(um);
if (params->noverify) {
- dbg_result("test passed", total_tests, src_off, dst_off,
- len, 0);
+ verbose_result("test passed", total_tests, src_off,
+ dst_off, len, 0);
continue;
}
@@ -670,8 +681,8 @@ static int dmatest_func(void *data)
len, error_count);
failed_tests++;
} else {
- dbg_result("test passed", total_tests, src_off, dst_off,
- len, 0);
+ verbose_result("test passed", total_tests, src_off,
+ dst_off, len, 0);
}
}
runtime = ktime_us_delta(ktime_get(), ktime);
OpenPOWER on IntegriCloud