From patchwork Tue Nov 12 01:13:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 3170391 X-Patchwork-Delegate: dan.j.williams@gmail.com Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2E060C045B for ; Tue, 12 Nov 2013 01:13:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 873A12042A for ; Tue, 12 Nov 2013 01:13:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B478A2041D for ; Tue, 12 Nov 2013 01:13:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753864Ab3KLBNr (ORCPT ); Mon, 11 Nov 2013 20:13:47 -0500 Received: from mga09.intel.com ([134.134.136.24]:3273 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754545Ab3KLBNr (ORCPT ); Mon, 11 Nov 2013 20:13:47 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 11 Nov 2013 17:10:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,535,1378882800"; d="scan'208";a="433566738" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by orsmga002.jf.intel.com with ESMTP; 11 Nov 2013 17:13:46 -0800 Received: from orsmsx107.amr.corp.intel.com ([169.254.1.35]) by ORSMSX106.amr.corp.intel.com ([169.254.5.158]) with mapi id 14.03.0123.003; Mon, 11 Nov 2013 17:13:45 -0800 From: "Williams, Dan J" To: Linus Walleij CC: "dmaengine@vger.kernel.org" , "Koul, Vinod" , Andy Shevchenko Subject: Re: [PATCH] dmatest: verbose mode Thread-Topic: [PATCH] dmatest: verbose mode Thread-Index: AQHO3McWsNiiFy+jBU2fGDaMhWCmN5ogTPaAgAEIdgA= Date: Tue, 12 Nov 2013 01:13:45 +0000 Message-ID: <1384218826.2047.8.camel@dwillia2-mobl1.amr.corp.intel.com> References: <20131108211040.27762.45313.stgit@viggo.jf.intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.7.189.152] Content-ID: MIME-Version: 1.0 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Subject: [PATCH v2] dmatest: verbose mode From: Dan Williams 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 Signed-off-by: Dan Williams --- On Mon, 2013-11-11 at 10:27 +0100, Linus Walleij wrote: > Now that is definately a compile-time thing, not runtime like > this, but to avoid confusion, maybe a dma-unique name like > pr_dmavdbg() or something could be used? > Like this. drivers/dma/dmatest.c | 25 ++++++++++++++++++------- 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);