From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) by dpdk.org (Postfix) with ESMTP id 63A611B1A3 for ; Thu, 21 Sep 2017 20:44:21 +0200 (CEST) Received: by mail-lf0-f50.google.com with SMTP id y187so6654281lfc.8 for ; Thu, 21 Sep 2017 11:44:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=gdDi/Ik2iJoxjIFz1lzXRM+QHNnmr5GnGFiiHjOJBGE=; b=ir9JqGFFwLh7Qv3kLjEIoRYtlu0AsHDvLT1W4VcCTbnTX1pUKDGANgDaP4PdEzoFkC COPl95xjOGHdfZoNx9oZKrNzaY/yt4mzy1CiZMi/oGacD9/p1fXF2rGhNlUZOaR1pa9P rfb/qoYDRPBGfrpY09tMyEDN+PnbvablLOLfQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=gdDi/Ik2iJoxjIFz1lzXRM+QHNnmr5GnGFiiHjOJBGE=; b=ByNUXAgKiGwGdJ3YctVy0uWuCdGt9zrnj+KPY8HCnnhRQ4PPycdglbrUg265TpuQ5m FptuvSuyTg0g/Yw1BDBKdNa8vsmJyC6hEvTPwwp5u9FugwvH5LOUCwn7S4RzVkAbdWZT tnsQzEBUSgAcK8AH+LFEusb3qHloi3OtiG8nXuwNKsDRUoVOjiajwX4PwsLYfn/Qwu3/ Zgo0O5ubl1DhZZ96EzLewoM8XUFJ3D5zJYtBUqPdCYfnfGd1k5DAZNlWF+6rCg0atGlF R3/0AiVACqqagW2ZmzC5GcDGYS/vnLKzDKtjH4jWttAaRm4J5XaN/fot1BMqw5sQCkMx 0m8Q== X-Gm-Message-State: AHPjjUhOP7z96vNsHnvH+FzpiTNkAHXOeKG6XuFN+V0Wm90C1GXemR3G LU4tCkmoLzaQoKz5+7Rp214Q9TqVc1o= X-Google-Smtp-Source: AOwi7QAdKlrrAyR+LX6CDO9xYlnFbbPBA+TCbsTVxnLm+s+LDBNS465/eNtGH0o8pxtqpOVyvtuZIA== X-Received: by 10.46.21.6 with SMTP id s6mr1362323ljd.70.1506019460846; Thu, 21 Sep 2017 11:44:20 -0700 (PDT) Received: from rad-H81M-S1.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id b8sm421948ljf.60.2017.09.21.11.44.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Sep 2017 11:44:19 -0700 (PDT) From: Radoslaw Biernacki To: dev@dpdk.org Cc: olivier.matz@6wind.com, stable@dpdk.org Date: Thu, 21 Sep 2017 20:44:09 +0200 Message-Id: <1506019449-18782-1-git-send-email-radoslaw.biernacki@linaro.org> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] test/logs: fix dynamic log levels testing X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Sep 2017 18:44:21 -0000 This patch fixes the dynamic log levels testing in logs_autotest. Introduction of rte_log_set_level() in patch c1b5fa94a46f was done with parameter RTE_LOG_EMERG which caused all RTE_LOG() calls an early return due to all given levels were far below EMERG. If first two logs supposed to show up on console, the initial log level must be low (DEBUG). It is than changed above ERR when we test if TESTAPP2 log type can be filtered by log type log level. Fixes: c1b5fa94a46f ("eal: support dynamic log types") Signed-off-by: Radoslaw Biernacki --- test/test/test_logs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test/test_logs.c b/test/test/test_logs.c index 730a86b..2a77064 100644 --- a/test/test/test_logs.c +++ b/test/test/test_logs.c @@ -61,9 +61,9 @@ static int test_logs(void) { - /* enable these logs type */ - rte_log_set_level(RTE_LOGTYPE_TESTAPP1, RTE_LOG_EMERG); - rte_log_set_level(RTE_LOGTYPE_TESTAPP2, RTE_LOG_EMERG); + /* set logtype level low to so we can test global level */ + rte_log_set_level(RTE_LOGTYPE_TESTAPP1, RTE_LOG_DEBUG); + rte_log_set_level(RTE_LOGTYPE_TESTAPP2, RTE_LOG_DEBUG); /* log in error level */ rte_log_set_global_level(RTE_LOG_ERR); @@ -75,8 +75,8 @@ test_logs(void) RTE_LOG(ERR, TESTAPP2, "error message (not displayed)\n"); RTE_LOG(CRIT, TESTAPP2, "critical message\n"); - /* disable one log type */ - rte_log_set_level(RTE_LOGTYPE_TESTAPP2, RTE_LOG_DEBUG); + /* bump up single log type level above global to test it */ + rte_log_set_level(RTE_LOGTYPE_TESTAPP2, RTE_LOG_EMERG); /* log in error level */ rte_log_set_global_level(RTE_LOG_ERR); -- 2.7.4