From patchwork Fri Feb 9 08:02:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: QI Fuli X-Patchwork-Id: 10208387 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 1E93560245 for ; Fri, 9 Feb 2018 08:02:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 126622978B for ; Fri, 9 Feb 2018 08:02:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06E2C29795; Fri, 9 Feb 2018 08:02:47 +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 AF28A2979A for ; Fri, 9 Feb 2018 08:02:44 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id D9A96222DE137; Thu, 8 Feb 2018 23:56:57 -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=211.128.242.43; helo=mgwym04.jp.fujitsu.com; envelope-from=qi.fuli@jp.fujitsu.com; receiver=linux-nvdimm@lists.01.org Received: from mgwym04.jp.fujitsu.com (mgwym04.jp.fujitsu.com [211.128.242.43]) (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 F3A79223DB78C for ; Thu, 8 Feb 2018 23:56:55 -0800 (PST) Received: from yt-mxauth.gw.nic.fujitsu.com (unknown [192.168.229.68]) by mgwym04.jp.fujitsu.com with smtp id 3735_a253_5bd949ab_3d99_403f_a876_0e9c0b193f1d; Fri, 09 Feb 2018 17:02:36 +0900 Received: from m3050.s.css.fujitsu.com (msm.b.css.fujitsu.com [10.134.21.208]) by yt-mxauth.gw.nic.fujitsu.com (Postfix) with ESMTP id C04C1AC00DC for ; Fri, 9 Feb 2018 17:02:35 +0900 (JST) Received: from qi-fedora.fujitsu.com (unknown [10.124.196.110]) by m3050.s.css.fujitsu.com (Postfix) with ESMTP id ADC6C3A6; Fri, 9 Feb 2018 17:02:35 +0900 (JST) From: QI Fuli To: linux-nvdimm@lists.01.org Subject: [RFC PATCH v3 1/5] ndctl: nvdimmd: add LOG_NOTICE level to Date: Fri, 9 Feb 2018 17:02:21 +0900 Message-Id: <20180209080225.5137-2-qi.fuli@jp.fujitsu.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180209080225.5137-1-qi.fuli@jp.fujitsu.com> References: <20180209080225.5137-1-qi.fuli@jp.fujitsu.com> X-TM-AS-MML: disable X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP This patch adds LOG_NOTICE level to log_priority for the notifications of nvdimm dimm over threshold event. Currently, the LOG_INFO level is too low, and the notifications are not up to LOG_ERROR level. Signed-off-by: QI Fuli --- util/log.c | 2 ++ util/log.h | 3 +++ 2 files changed, 5 insertions(+) diff --git a/util/log.c b/util/log.c index cc4d7d8..c60ca33 100644 --- a/util/log.c +++ b/util/log.c @@ -50,6 +50,8 @@ static int log_priority(const char *priority) return LOG_INFO; if (strncmp(priority, "debug", 5) == 0) return LOG_DEBUG; + if (strncmp(priority, "notice", 6) == 0) + return LOG_NOTICE; return 0; } diff --git a/util/log.h b/util/log.h index 5fc56e8..495e0d3 100644 --- a/util/log.h +++ b/util/log.h @@ -48,15 +48,18 @@ do { \ # endif # define log_info(ctx, arg...) log_cond(ctx, LOG_INFO, ## arg) # define log_err(ctx, arg...) log_cond(ctx, LOG_ERR, ## arg) +# define log_notice(ctx, arg...) log_cond(ctx, LOG_NOTICE, ## arg) #else # define log_dbg(ctx, arg...) log_null(ctx, ## arg) # define log_info(ctx, arg...) log_null(ctx, ## arg) # define log_err(ctx, arg...) log_null(ctx, ## arg) +# define log_notice(ctx, arg...) log_null(ctx, ## arg) #endif #define dbg(x, arg...) log_dbg(&(x)->ctx, ## arg) #define info(x, arg...) log_info(&(x)->ctx, ## arg) #define err(x, arg...) log_err(&(x)->ctx, ## arg) +#define notice(x, arg...) log_notice(&(x)->ctx, ## arg) #ifndef HAVE_SECURE_GETENV # ifdef HAVE___SECURE_GETENV