From patchwork Wed Dec 17 16:45:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 5507941 Return-Path: X-Original-To: patchwork-intel-gfx@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 581E0BEEA8 for ; Wed, 17 Dec 2014 16:46:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AE63920A31 for ; Wed, 17 Dec 2014 16:46:00 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E663C209A3 for ; Wed, 17 Dec 2014 16:45:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 74B026E959; Wed, 17 Dec 2014 08:45:55 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by gabe.freedesktop.org (Postfix) with ESMTP id B4E716E958 for ; Wed, 17 Dec 2014 08:45:52 -0800 (PST) Received: by mail-wi0-f181.google.com with SMTP id r20so16760164wiv.8 for ; Wed, 17 Dec 2014 08:45:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=mFjqs38JMV73tG14vHWZjz3LrahBG0PBq4mfEnMPxiU=; b=RQQAKFVvoW4D8T28NK3Ukw2v9RmLIek7JPdvG+WN7iKPZd0YxkXQUSvm0LTbuNw7rA b4YSH5HVX1K74vjY2FECZJhleJjq1LFmYOfB20bQSYHNzR0g0nkiw8mS/8SdPV0m4pT8 YASWLnHC1WLP7fue/FbfFDTl49b2c0QgfrG2lB1zx96rOD/CglICyVSWgDIf9rT7u2Am J1aDcPsKu/1xKWzl8kJ8xs3FRrkP7QsYdP+R+BG5qpuxesjZaFxvAQccGVW4m6aQQLWn Fp2sG+/HmYoLDOQx5Cy0ZUULuKeVaWKx7eSze7nAKGib84vFPRXy5N8bHISS8QxGbhQl qTzA== X-Gm-Message-State: ALoCoQlyAXb8UIeZmOpuD2DEEU7FczRNI96eyuHQeEzcJRuhmLF0W5C5jUUaN4qe0H5EmSNFHy0v X-Received: by 10.180.107.193 with SMTP id he1mr15873558wib.69.1418834751784; Wed, 17 Dec 2014 08:45:51 -0800 (PST) Received: from pistachio.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id ec2sm6762267wib.23.2014.12.17.08.45.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Dec 2014 08:45:51 -0800 (PST) From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Wed, 17 Dec 2014 16:45:44 +0000 Message-Id: <1418834747-5598-2-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1418834747-5598-1-git-send-email-thomas.wood@intel.com> References: <1418834747-5598-1-git-send-email-thomas.wood@intel.com> Subject: [Intel-gfx] [PATCH i-g-t 2/5] lib: add a critical warning level X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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 Signed-off-by: Thomas Wood --- lib/igt_core.c | 10 ++++++---- lib/igt_core.h | 10 ++++++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/igt_core.c b/lib/igt_core.c index 457b3b1..6159a8c 100644 --- a/lib/igt_core.c +++ b/lib/igt_core.c @@ -1494,9 +1494,10 @@ void igt_skip_on_simulation(void) * between SUCESS and FAILURE. * * The log level can be set through the IGT_LOG_LEVEL environment variable with - * values "debug", "info", "warn" and "none". By default verbose debug message - * are disabled. "none" completely disables all output and is not recommended - * since crucial issues only reported at the IGT_LOG_WARN level are ignored. + * values "debug", "info", "warn", "critical" and "none". By default verbose + * debug message are disabled. "none" completely disables all output and is not + * recommended since crucial issues only reported at the IGT_LOG_WARN level are + * ignored. */ void igt_log(const char *domain, enum igt_log_level level, const char *format, ...) { @@ -1530,6 +1531,7 @@ void igt_vlog(const char *domain, enum igt_log_level level, const char *format, "DEBUG", "INFO", "WARNING", + "CRITICAL", "NONE" }; @@ -1577,7 +1579,7 @@ void igt_vlog(const char *domain, enum igt_log_level level, const char *format, goto out; } - if (level == IGT_LOG_WARN) { + if (level > IGT_LOG_WARN) { file = stderr; fflush(stdout); } diff --git a/lib/igt_core.h b/lib/igt_core.h index 5c5ee25..f184d75 100644 --- a/lib/igt_core.h +++ b/lib/igt_core.h @@ -520,6 +520,7 @@ enum igt_log_level { IGT_LOG_DEBUG, IGT_LOG_INFO, IGT_LOG_WARN, + IGT_LOG_CRITICAL, IGT_LOG_NONE, }; __attribute__((format(printf, 3, 4))) @@ -550,6 +551,15 @@ void igt_vlog(const char *domain, enum igt_log_level level, const char *format, * Wrapper for igt_log() for message at the IGT_LOG_WARN level. */ #define igt_warn(f...) igt_log(IGT_LOG_DOMAIN, IGT_LOG_WARN, f) + +/** + * igt_critical: + * @...: format string and optional arguments + * + * Wrapper for igt_log() for message at the IGT_LOG_CRITICAL level. + */ +#define igt_critical(f...) igt_log(IGT_LOG_DOMAIN, IGT_LOG_CRITICAL, f) + extern enum igt_log_level igt_log_level; /**