From patchwork Fri Dec 1 23:25:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 10088279 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3A9D16035E for ; Fri, 1 Dec 2017 23:33:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 29CDF2A7C7 for ; Fri, 1 Dec 2017 23:33:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1EB7B2A817; Fri, 1 Dec 2017 23:33:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 515362A816 for ; Fri, 1 Dec 2017 23:33:18 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 4BD9820352ABF; Fri, 1 Dec 2017 15:28:51 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=dan.j.williams@intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id AF1BA21A10961 for ; Fri, 1 Dec 2017 15:28:49 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Dec 2017 15:33:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,347,1508828400"; d="scan'208";a="9508589" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by fmsmga001.fm.intel.com with ESMTP; 01 Dec 2017 15:33:16 -0800 Subject: [ndctl PATCH 06/17] ndctl, test: emit smart field names From: Dan Williams To: linux-nvdimm@lists.01.org Date: Fri, 01 Dec 2017 15:25:02 -0800 Message-ID: <151217070197.28402.15413187772658826772.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <151217066885.28402.7962437173336388439.stgit@dwillia2-desk3.amr.corp.intel.com> References: <151217066885.28402.7962437173336388439.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP Make the SMART tests easier to debug by emitting the field name. Signed-off-by: Dan Williams --- test/libndctl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/libndctl.c b/test/libndctl.c index 5189f7886481..b534b640cb8d 100644 --- a/test/libndctl.c +++ b/test/libndctl.c @@ -2122,8 +2122,9 @@ static int check_set_config_data(struct ndctl_bus *bus, struct ndctl_dimm *dimm, #define __check_smart(dimm, cmd, field) ({ \ if (ndctl_cmd_smart_get_##field(cmd) != smart_data.field) { \ - fprintf(stderr, "%s dimm: %#x expected field %#x got: %#x\n", \ - __func__, ndctl_dimm_get_handle(dimm), \ + fprintf(stderr, "%s dimm: %#x expected \'" #field \ + "\' %#x got: %#x\n", __func__, \ + ndctl_dimm_get_handle(dimm), \ smart_data.field, \ ndctl_cmd_smart_get_##field(cmd)); \ ndctl_cmd_unref(cmd); \ @@ -2187,8 +2188,9 @@ static int check_smart(struct ndctl_bus *bus, struct ndctl_dimm *dimm, #define __check_smart_threshold(dimm, cmd, field) ({ \ if (ndctl_cmd_smart_threshold_get_##field(cmd) != smart_t_data.field) { \ - fprintf(stderr, "%s dimm: %#x expected field %#x got: %#x\n", \ - __func__, ndctl_dimm_get_handle(dimm), \ + fprintf(stderr, "%s dimm: %#x expected \'" #field \ + "\' %#x got: %#x\n", __func__, \ + ndctl_dimm_get_handle(dimm), \ smart_t_data.field, \ ndctl_cmd_smart_threshold_get_##field(cmd)); \ ndctl_cmd_unref(cmd); \